1

According to this and this answer any remaining gas after a require statements assert condition fails is returned/refunded back to msg.sender but what about any ETHER sent in that transaction call i.e. msg.value? Is that also refunded/returned back to the user?

1 Answer 1

1

Transfering ETH (which is done by setting msg.value) is a state change. When your transaction reverts any state change is also reverted. This means the value "stays" in the original wallet.

As you mentioned the only change that is done to the blockchain is the fee payment.

Note: If an internal transaction reverts, it doesn't mean that the whole Ethereum transaction reverted. The value transfer will only undone if the (internal) transaction related to that transfer is reverted.

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.