I want to transfer the same amount of ether to 100 different addresses. I'd like to reduce the amount of gas for it.
I tried to do it with such contract:
contract MultiTransfer {
function transferEther(uint amount, address[] users) public payable {
require(amount * users.length == msg.value);
for (uint i = 0; i < users.length; i++) {
users[i].transfer(amount);
}
}
}
As result, it requires 3422830 gas for tx with 100 addresses. ~ 34K gas per 1 address. But it costs only 21K if transfer ether directly without contracts.
So smart contracts can't help to reduce gas for this task?