0
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.

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

1 Answer 1

0

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 and acknowledge you have read our privacy policy.

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