当我调用它时,固体功能超出了气体限制,我不知道如何使气体成本最小化,因为我需要该功能按原样进行包含的传输。
我已经找到了解决方案,但是我发现的只是充实代码,但我做不到。预先感谢
function distribute () public onlyOwner returns (bool) {
vEGPContract vEGP = vEGPContract(vEGPAddress);
uint balance = vEGP.balanceOf(address(this));
require(balance > 0, "No balance to be distribute");
vEGP.transfer(organizer.accountAddress, balance.div(100).mul(organizer.percentage));
vEGP.transfer(celebrity.accountAddress, balance.div(100).mul(celebrity.percentage));
vEGP.transfer(promoter.accountAddress, balance.div(100).mul(celebrity.percentage));
vEGP.transfer(virtuBlock.accountAddress, balance.div(100).mul(virtuBlock.percentage));
return true;
}
期望该功能正常工作并成功完成交易