2020-01-19 23:07:05 +00:00
|
|
|
pragma solidity ^0.6.0;
|
2018-05-03 21:00:38 -04:00
|
|
|
|
2015-05-24 09:07:19 -04:00
|
|
|
contract SimpleStorage {
|
2015-06-20 08:36:40 -04:00
|
|
|
uint public storedData;
|
2015-06-14 21:38:00 -04:00
|
|
|
|
2020-01-31 14:54:40 -05:00
|
|
|
event Set(address caller, uint _value);
|
|
|
|
|
2018-05-03 21:00:38 -04:00
|
|
|
constructor(uint initialValue) public {
|
2015-06-20 08:36:40 -04:00
|
|
|
storedData = initialValue;
|
2015-06-14 21:38:00 -04:00
|
|
|
}
|
|
|
|
|
2017-10-21 15:01:09 -04:00
|
|
|
function set(uint x) public {
|
2016-08-17 20:29:41 -04:00
|
|
|
storedData = x;
|
2020-01-31 14:54:40 -05:00
|
|
|
emit Set(msg.sender, x);
|
2015-05-24 09:07:19 -04:00
|
|
|
}
|
2016-08-17 20:29:41 -04:00
|
|
|
|
2017-10-21 15:01:09 -04:00
|
|
|
function get() public view returns (uint retVal) {
|
2015-05-24 09:07:19 -04:00
|
|
|
return storedData;
|
|
|
|
}
|
2019-03-05 16:45:18 -06:00
|
|
|
}
|