2017-10-22 09:38:54 -04:00
|
|
|
pragma solidity ^0.4.17;
|
2017-07-16 14:11:37 -04:00
|
|
|
|
|
|
|
import "ownable.sol";
|
|
|
|
|
|
|
|
contract SimpleStorage is Ownable {
|
2017-02-09 19:38:02 -05:00
|
|
|
uint public storedData;
|
|
|
|
|
2017-10-21 15:01:09 -04:00
|
|
|
function() public payable { }
|
2017-04-02 14:12:12 -04:00
|
|
|
|
2018-09-14 14:35:12 -04:00
|
|
|
constructor(uint initialValue) public {
|
2017-02-09 19:38:02 -05:00
|
|
|
storedData = initialValue;
|
|
|
|
}
|
|
|
|
|
2017-10-21 15:01:09 -04:00
|
|
|
function set(uint x) public {
|
2017-02-09 19:38:02 -05:00
|
|
|
storedData = x;
|
2018-01-13 11:38:10 -05:00
|
|
|
for(uint i = 0; i < 1000; i++) {
|
|
|
|
storedData += i;
|
|
|
|
}
|
2017-02-09 19:38:02 -05:00
|
|
|
}
|
|
|
|
|
2018-09-14 14:35:12 -04:00
|
|
|
function set2(uint x) public onlyOwner {
|
2017-07-15 11:35:29 -04:00
|
|
|
storedData = x;
|
|
|
|
}
|
|
|
|
|
2017-10-21 15:01:09 -04:00
|
|
|
function get() public view returns (uint retVal) {
|
2017-02-09 19:38:02 -05:00
|
|
|
return storedData;
|
|
|
|
}
|
|
|
|
|
2017-10-21 15:01:09 -04:00
|
|
|
function getS() public pure returns (string d) {
|
2017-02-27 20:32:26 -05:00
|
|
|
return "hello";
|
|
|
|
}
|
|
|
|
|
2017-02-09 19:38:02 -05:00
|
|
|
}
|