I have a function that in first call just counts values and in next calls transfer some amount of ETH. It's like:

function() public {
  if (val !=0) {
 val = msg.value;

The first call requires 368,351 of gas and the second call cannot be sent because of

Gas estimation errored with the following message (see below). 
The transaction execution will likely fail. Do you want to force sending? 
gas required exceeds allowance (7007659) or always failing transaction

If I delete 5 transfers then it works. As I know transfer requires only 2100 of gas so I have a question: is it possible that 6 transfers increase gas requiements so high or I have a mistake anywhere in my code?

1 Answer 1


Transfer may fail because there is not enough ether on sender contract's balance, or because recipient is a smart contract that does not accept payments, or needs more than 2300 gas in order to process incoming ether transfers.

Assuming that part1 + part2 + ... + part6 ≤ 100 I would guess, that at least one of your destination addresses is a smart contract and there are some problems with it.

  • Thanks for your answer! Every out of 6 addresses is a smart-contract with a payable fallback function. Sender's contract has to have enough ether too...
    – Aleksandr
    Commented Apr 29, 2019 at 16:47
  • OK, then we have only one option left: one of these fallback functions needs more than 2300 gas. Commented Apr 29, 2019 at 17:20
  • Ah, yes. There was a stupid mistake. One of smart-contracts was looping this transaction.
    – Aleksandr
    Commented Apr 30, 2019 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.