KritikaJoshi22 / Eth_Avax_Intermediate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error Handling

Assert, require and revert are the basic functionality of the Solidity programming language shown in this "Error" program. This program demonstrates and explains how the various error control methods in Solidity work.

Description

Assert, Require, and Revert are three essential Solidity functions that demonstrate the language's assertion, require, and revert capabilities. As a foundation for understanding how Solidity's error control mechanisms work, it explains how they work.

Getting Started

Executing program

To run this program, you can use Remix, an online Solidity IDE. To get started, go to the Remix website at https://remix.ethereum.org/.

Once you are on the Remix website, create a new file by clicking on the "+" icon in the left-hand sidebar. Save the file with a .sol extension (e.g., error.sol). Copy and paste the code from error.sol into the editor.

To compile the code, click on the "Solidity Compiler" tab in the left-hand sidebar. Make sure the "Compiler" option is set to "0.8.21" (or another compatible version), and then click on the "Compile error.sol" button.

Once the code is compiled, you can deploy the contract by clicking on the "Deploy & Run Transactions" tab in the left-hand sidebar. Select the "error" contract from the dropdown menu, and then click on the "Deploy" button.

Once the contract is deployed, you can interact with it by calling the contribute, addMember and changeOwner functions. Click on the "error" contract in the left-hand sidebar, and then click on the functions within. Finally, click on the "transact" button to execute the function.

Authors

Kritika Joshi

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About


Languages

Language:Solidity 100.0%