function() payable external {
    eth_balance[msg.sender] += msg.value;  

This is not working. The execution is reverted and uses about 21,000 gas. No matter if I set the gas crazy high like 800,000 it still fails. This is on rinkeby network. Any ideas? I'm using Remix IDE.

  • What msg.value are you using and what is the balance of msg.sender? – goodvibration Oct 24 '19 at 5:02
  • Or in other words, a wild guess: msg.sender.balance < msg.value. – goodvibration Oct 24 '19 at 5:04
  • 1
    is eth_balance a mapping between address -> uint256 ? – Majd TL Oct 24 '19 at 6:40
  • Yes, yes it is. – Fifth Dimension Dragon Oct 25 '19 at 2:33

It turns out the contract is fine. The gas during certain times, no matter how high it's set will not allow the transaction to go through. I believe a lot of it has ethereum congestion. If you run into similar situations I would set the contract gas to something like 800,000 gas on the test network and try a different time of day.

Your Answer

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

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