Handling the revert exceptions in Solidity by Mudit Gupta (Devcon5)
Devcon 5 · 27 Nov 2019 · 3:28
Mudit Gupta discusses handling revert exceptions in Solidity at Devcon5 in Osaka, covering how smart contracts should respond when a called function reverts partway through execution. The talk addresses common pitfalls developers hit when error handling across contract calls is done carelessly.
Speakers
Topics
From Devcon 5, hosted by Ethereum Foundation.
Transcript
[Applause] from Vienna and I'll be talking about a short topic or finding little exceptions it's all relative so by default if an induction will reverse the whole state is devoted on everything done before that is rebutted anything so for example if you're going up that's transfer and one of the transfer fees all the other transfers will free Lisbeth sometimes you might want to just skip that transfer and let the others continue it's not needed be possible it's already is 0.5 and earlier versions but it is of non-feature in solitaire 0.6 that is the
upcoming me diversion but even if not right now we can't emulate this try/catch behavior using little everyone's so I will be talking about will go down one disadvantage of using low-level parts is that it'll buy us some of these targets that is all signify provides so if you use this technique you should know that you might be missing some strategies so this is a sample good I know you might not be able to see but how it essentially works is the it's a two-step process first you generate the core data but you have to use to call a low-level smart contract user role everyone in that you enter the function name and the parameters and the data that we have to pass particle then
solidly using the function in Corvette selector will generate core data that will be passed on in the United States to call he needs that can be used for any small contract the next step is to assess for this my contract using a low-level con so of nodal because God says that it will never ever if these subsequent controverts it will return false as a result time they will be able to handle the reverb yourself so in this case you can see and to England oil coal and if it reverts it will return the result response if it goes successfully it will return the result as true if it returns false then I love you and the luckiest may be love it somewhere the
rest on rats it will and if it was true I can just continue with my process my past function and I don't have to worry about it anymore it's a bit clunky right now but in solidly 0.6 it's very clean I think it's something that I'd really love to use it which of that bus main thing - functions will become easier with us so this issue on github you can follow it tracks the progress of the implementation in solid it is 0.6 I hopefully you will be able to enjoy if you need more info or the this morning for my godmother you can visit our as me and that's my shop thank you [Applause]