[Ethereum] Out of gas problem with transaction


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:


Can anyone please help me understand what happened?

Best Answer

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.

Related Topic