Govur University Logo
--> --> --> -->
...

If a contract hits a special `assert(false)` error, how much gas money does it get back compared to if it hit a `require(false)` or `revert()` error?



Gas is the unit of computational effort required to execute operations on the Ethereum blockchain, and every transaction requires a certain amount of gas, paid by the sender, to cover the resources consumed by the network. When a contract execution encounters an error that causes it to revert, all state changes made during that transaction are undone, as if the transaction never happened. The gas that was already consumed by the operations executed before the error point is never refunded, regardless of the error type. The difference in gas cost lies in how the *remainingunused gas ....

Log in to view the answer



Redundant Elements