[Ethereum] Out of gas problem with transaction

out-of-gasthe-daotransactions

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?

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