August 2019
Intermediate to advanced
486 pages
13h 52m
English
In Solidity code, when certain conditions are met, you can throw an exception and fail the transactions. You can check for method input argument's correctness and revert the transaction if arguments are not in order.
One important thing to note here is that when a transaction is reverted or failed, all of its state changes and variable modifications are reverted. Also, the gas consumption it has consumed till the revert of the transaction will be consumed and sent to miner, and the rest of the remaining gas will be refunded back to the transaction initiator. The error handling methods are as follows: