Functions and Errors - ETH + AVAX
In this following contract, we will be implementing revert(), assert() and require() statement.
The revert statement is typically used in conjunction with conditions or require statements to enforce specific conditions that must hold true during the execution of a contract
The require statement is primarily used for input validation and to ensure that certain conditions are met before allowing the execution of a function or transaction to proceed
The assert statement, on the other hand, is used to check for internal errors or contract invariant violations. It is meant to validate conditions that should always be true, regardless of user inputs or external factors
- use this code to run it in remixIDE environment.
- compile the contract.
- deploy the contract and it will run properly.
A R Ashutosh Uid 21BCS4839