2018-10-12 22:22:17 +00:00
|
|
|
pragma solidity ^0.4.25;
|
2017-07-16 18:11:37 +00:00
|
|
|
|
2018-10-12 22:22:17 +00:00
|
|
|
contract SimpleStorage {
|
2017-02-10 00:38:02 +00:00
|
|
|
uint public storedData;
|
2018-10-29 14:44:55 +00:00
|
|
|
address public registar;
|
2018-10-12 22:22:17 +00:00
|
|
|
address owner;
|
2018-10-29 14:44:55 +00:00
|
|
|
event EventOnSet2(bool passed, string message);
|
2017-04-02 18:12:12 +00:00
|
|
|
|
2018-09-14 18:20:41 +00:00
|
|
|
constructor(uint initialValue) public {
|
2017-02-10 00:38:02 +00:00
|
|
|
storedData = initialValue;
|
2018-10-12 22:22:17 +00:00
|
|
|
owner = msg.sender;
|
2017-02-10 00:38:02 +00:00
|
|
|
}
|
|
|
|
|
2017-10-21 19:01:09 +00:00
|
|
|
function set(uint x) public {
|
2017-02-10 00:38:02 +00:00
|
|
|
storedData = x;
|
2018-10-29 14:44:55 +00:00
|
|
|
//require(msg.sender == owner);
|
2018-10-27 19:31:13 +00:00
|
|
|
//require(msg.sender == 0x0);
|
2018-10-29 14:44:55 +00:00
|
|
|
//storedData = x + 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
function set2(uint x) public {
|
|
|
|
storedData = x;
|
|
|
|
emit EventOnSet2(true, "hi");
|
2017-07-15 15:35:29 +00:00
|
|
|
}
|
|
|
|
|
2017-10-21 19:01:09 +00:00
|
|
|
function get() public view returns (uint retVal) {
|
2017-02-10 00:38:02 +00:00
|
|
|
return storedData;
|
|
|
|
}
|
|
|
|
|
2018-10-29 14:44:55 +00:00
|
|
|
function getS() public pure returns (string d) {
|
|
|
|
return "hello";
|
|
|
|
}
|
|
|
|
|
|
|
|
function setRegistar(address x) public {
|
|
|
|
registar = x;
|
|
|
|
}
|
|
|
|
|
2017-02-10 00:38:02 +00:00
|
|
|
}
|