8

If you check out the account 0xe358b3b9f29c67cb810c5184e6fde27d66ce036c you will see several incoming transactions with 100 Finney each. Yet the overall balance is 31 Finney. How is that possible?

If I imagined this were my account, and I were just confirming transactions with a block explorer, how could I figure out whether a transaction is really funding my account? Where did the 100 Finney go and why?

10

If you look at the VM trace, you can see that the 100 Finney transactions ran into Out-of-Gas exceptions. In the case of an exception, all value included in the transaction is returned to the sender.

To answer the second part of your question, I would use http://live.ether.camp as your block explorer, since it shows contract-produced transactions and errors.

To be clear, while contracts cannot initiate transactions, they can send ether to other addresses. Since these operations are not separate transactions but side-effects of the contract's execution, they are often not listed with the other transactions, creating confusion.

On the ether.camp explorer, these balance transfers are listed as "internal transactions", underneath the transaction that produced them. ether.camp internal transaction

On the etherchain explorer, they are listed as "contract invoked transactions", directly underneath the contract that initiated them. It is less clear that these are part of the transaction above, but if you click the parent transaction has, you will see "invoked" transactions listed etherchain contract initiated transaction

  • vm trace, very cool! – Afr Jan 25 '16 at 20:36
  • 1
    Yes, I have always been impressed with the ether.camp explorer. – Tjaden Hess Jan 25 '16 at 20:41
  • While ether.camp is great at revealing out of gas exceptions for example, it does not actually recognize contract-initiated transactions. A contract-initiated transaction such as that coming from a contract-based wallet, as of now, is only displayed by Etherchain.org, as far as I know. In the case of the above Account, for instance, only Etherchain lists 7 transactions including 2 initiated by contracts: etherchain.org/account/… The other block explorers list only 5. – KLmoney Jan 30 '16 at 5:37
  • That's not entirely true. If you look at the incoming transactions you'll see that #2 and 3 have "internal transactions." This is technically more correct, since they were not separate transactions but produced as a result of transactions 2 and 3 respectively. – Tjaden Hess Jan 30 '16 at 5:41
  • Yes, transactions #2 & #3 produced 1 internal transaction in the receiving contract-based wallet (created by transaction #1) as they completed with adequate gas. But all 5 transactions shown in ether.camp are from Externally Owned Accounts. Transactions initiated by a contract (contract-based wallet) would not show. – KLmoney Jan 30 '16 at 6:22
5

The transaction ran Out of Gas, as can be seen on https://live.ether.camp/transaction/abddd676a2dc65dc4790463121bd77cafce4e0fb878d0b386556b055e0cae2d0/vmtrace#0

enter image description here

Here's the transaction where the 100 Finney was sent and it shows "Gas Limit" is 21000: https://live.ether.camp/transaction/abddd676a2dc65

contract invocation

So the user (0xbf27f..) specified that the transaction can consume up to 21000.

21000 gas is exactly what's required in Frontier, for a value transfer. You can see from here (deselect other filters except for "value transfer") that 21000 gas is enough to send any amounts of Ether.

So why did the transaction run Out of Gas?

Because the transaction was a contract invocation (see upper right of image)

Let's take a look at the receive address:0xe358b3b9f29c67cb810c5184e6fde27d66ce036c

enter image description here

See how it has code? Whenever a transaction is sent to an address with code, that code is invoked, starts getting executed and consuming the gas, just like a car consumes its fuel. If the gas is depleted before the transaction is able to complete, an Out of Gas exception is generated and basically everything the transaction did is undone. That's why the 100 Finney remains with the sender.

From the transaction if you click on "vmtrace", you will see the Out of Gas. This transaction didn't have enough gas to even do a single computation step, but if a little more gas provided, the vmtrace would should some computations being performed, until the point of Out of Gas.

Specifying more gas would prevent the issue. It is safe to specify more gas, because any unused gas remains with the sender.

For example, if 123456 gas was specified and the transaction only consumed 50000 gas, the remaining gas (73456) would remain with the sender.

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.