Skip to content

Instantly share code, notes, and snippets.

@TehilaFavourite
Created May 5, 2023 08:52
Show Gist options
  • Save TehilaFavourite/b6911cc07f5245066034c445ffdc8dd7 to your computer and use it in GitHub Desktop.
Save TehilaFavourite/b6911cc07f5245066034c445ffdc8dd7 to your computer and use it in GitHub Desktop.
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