Focus mode
Code from video: https://solidity-by-example.org/error/
You can access the video content in Turkish prepared by İTÜ Blockchain here: https://www.youtube.com/playlist?list=PLby2HXktGwN4Cof_6a8YwlMrboX8-hs73
Errors in Solidity provide a convenient and gas-efficient way to explain to the user why an operation failed. They can be defined inside and outside of contracts (including interfaces and libraries). An error will undo all changes made to the state during a transaction.
You can throw an error by calling require, revert or assert.
Using the above three error types help us save gas.
Resources:
You can find detailed further information from Solidityl Official documentation (in English):
https://docs.soliditylang.org/en/v0.8.15/structure-of-a-contract.html#errors
https://docs.soliditylang.org/en/v0.8.15/contracts.html#errors-and-the-revert-statement
Programs to Accelerate Your Progress in a Software Career
Join our 4-8 month intensive Patika+ bootcamps, start with the fundamentals and gain comprehensive knowledge to kickstart your software career!
You need to enroll in the course to be able to comment!