Created
May 5, 2023 08:52
-
-
Save TehilaFavourite/b6911cc07f5245066034c445ffdc8dd7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.0; | |
contract Function { | |
uint public myNumber; | |
// this is a view function because it reads data (myNumber) from the blockchain | |
function getNumber() public view returns (uint) { | |
return myNumber; | |
} | |
// This is a pure function because it does not read anything from the blockchain | |
function addNumbers(uint a, uint b) public pure returns (uint) { | |
return a + b; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment