I want to transfer ETH to all recipients from recipient contract like below.

What is the limit of 'total'? for average.

How much gas for one internal transaction? Is it 500?

If 500 is right, 16,000 internal transactions can be processed? (gas limit for a block is approx 8,000,000 and I divide it by 500)

function return() public {
    uint256 total = recipient.getTotalNumber();
    for(uint256 i = 0; i < total; i++) {
  • yes, but if after running 15.999 times and the last one reverts, evertying is lost and you loose all the gas – Luiz Soares May 22 '18 at 19:32
  • @LuizSoares I'm aware of that. and I changed the question. I have no idea how much gas is needed for one internal transaction. – Leo Moon May 22 '18 at 19:36
  • Internal transaction is a call. And it isn´t that simple. You have to add to that math gas for loading data from recipient. You have 2 loads, getAddress and getAmount. And you have the cost of i++. For you to get a more realistic number, I suggest simulate it using Remix. I will try later – Luiz Soares May 23 '18 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.