Last active
October 24, 2021 23:10
-
-
Save ConsenSys-Academy/6d93a805ce0e90d8a793a4eb6e69b4c5 to your computer and use it in GitHub Desktop.
A Solidity SimpleStorage contract
This file contains hidden or 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
[ | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"internalType": "uint256", | |
"name": "x", | |
"type": "uint256" | |
} | |
], | |
"name": "set", | |
"outputs": [], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": false, | |
"internalType": "uint256", | |
"name": "newValue", | |
"type": "uint256" | |
}, | |
{ | |
"indexed": false, | |
"internalType": "address", | |
"name": "updatedBy", | |
"type": "address" | |
} | |
], | |
"name": "storageUpdate", | |
"type": "event" | |
}, | |
{ | |
"constant": true, | |
"inputs": [], | |
"name": "get", | |
"outputs": [ | |
{ | |
"internalType": "uint256", | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
} | |
] |
This file contains hidden or 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.4.0 <0.7.0; | |
// Rinkeby address: 0x49Bb098E781eD5C50D85E82d85cbA1a6F03FD3e6 | |
contract SimpleStorage { | |
uint storedData; | |
event storageUpdate(uint newValue, address updatedBy); | |
function set(uint x) public { | |
storedData = x; | |
emit storageUpdate(x, msg.sender); | |
} | |
function get() public view returns (uint) { | |
return storedData; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment