2

I tested fallback function in my smart contract, and noticed, that there is no transaction on etherscan from smart contract to my account.

In short: i try to send money to contract and receive back a half of sent amount. Here is a code of fallback function (really simple):

function () payable {
    uint money = msg.value;
    uint half = money / 2;
    msg.sender.transfer(half);
}

For example, when i send 6 eth on contract, i receive back 3. It works, and i see transaction of sending 6 eth to contract in etherscan. But i don't see transaction of sending 3 eth back to my address.

Why?

1 Answer 1

1

There's no second transaction. Sending the 6 ether and getting 3 ether back are part of the same transaction. If you link to the transaction on Etherscan, I can help more, but generally look for the "Internal Transactions" tab when viewing the transaction to see what sorts of things happened during the transaction.

2
  • Thank you! Yeah, i wanted to see internal transactions, but there is no "internal transactions" tab. Here is a link to transaction: rinkeby.etherscan.io/tx/… Commented Feb 16, 2018 at 10:05
  • Sorry, perhaps only calls to other smart contracts show up in "internal transactions"?
    – user19510
    Commented Feb 16, 2018 at 10:10

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.