This project contains a simple Solidity smart contract that performs basic arithmetic operations such as addition and subtraction.
It is designed to demonstrate the use of functions and basic logic in Solidity.
- Language: Solidity
- Version: ^0.8.19
- License: MIT
- Type: Smart Contract
- Platform: Ethereum-compatible networks
function addition(uint a, uint b) public pure returns (uint)Returns the sum of two unsigned integers.
function subtraction(uint a, uint b) public pure returns (uint)Returns the difference between two unsigned integers.
-
Open Remix IDE: https://remix.ethereum.org
-
Create a new Solidity file (e.g.,
calculator.sol) -
Paste the contract code
-
Compile using Solidity compiler (^0.8.19)
-
Deploy using:
- JavaScript VM (for testing), or
- MetaMask (for real networks)
.
βββ calculator.sol
βββ README.mdThis project is intended for learning and understanding:
- Basic Solidity syntax
- Function creation
- Arithmetic operations in smart contract
- Pure Functions