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?
Asked
Active
Viewed 239 times
1
MShakeG
- 1,603
- 6
- 37
1 Answers
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.
Richard
- 4,934
- 2
- 7
- 25