4

I had some small amount of ether remaining in one of my accounts so I decided to send everything to the DAO. But the contract execution failed with an exception - out of gas. I was trying to investigate why this happened only to find out strange gas cost on the last instruction in this vm trace:

http://etherscan.io/vmtrace?txhash=0x72db0d1d7e3494a94ca410ddbb3b0a9c64ace95bcfdac878f413d651778ba576

Can anyone please help me understand what happened?

  • Please consider voting the answer up, if it solved the question. Keep the community active. – niksmac May 24 '16 at 5:46
7

An easier to interpret trace can be seen here at ether.camp.

What happened is that the contract tried to call another contract, specifying a gas quantity of self.gas - 34050. Since your execution had less than that much gas remaining at the time it was called, the result was a negative number, which translates into a very large positive number in unsigned arithmetic. It then attempted to make a call with that, and the EVM threw an exception because it was attempting to spend more gas than was available.

EVM exceptions result in all gas being consumed, and the transaction being rolled back.

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.