2020-06-01 23:15:33 +00:00
|
|
|
pragma solidity >=0.4.24;
|
|
|
|
|
|
|
|
contract SimpleStorage {
|
|
|
|
|
2020-06-02 21:10:46 +00:00
|
|
|
event ValueChanged(address indexed author, address indexed oldAuthor, string oldValue, string newValue);
|
2020-06-01 23:15:33 +00:00
|
|
|
|
2020-06-02 10:36:02 +00:00
|
|
|
address public lastSender;
|
2020-06-01 23:15:33 +00:00
|
|
|
string _value;
|
2020-07-03 14:37:38 +00:00
|
|
|
string _otherValue;
|
2020-06-01 23:15:33 +00:00
|
|
|
|
|
|
|
constructor(string memory value) public {
|
2020-06-02 21:10:46 +00:00
|
|
|
emit ValueChanged(msg.sender, address(0), _value, value);
|
2020-06-01 23:15:33 +00:00
|
|
|
_value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getValue() view public returns (string memory) {
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
function setValue(string memory value) public {
|
2020-06-02 21:10:46 +00:00
|
|
|
emit ValueChanged(msg.sender, lastSender, _value, value);
|
2020-06-01 23:15:33 +00:00
|
|
|
_value = value;
|
2020-06-02 10:36:02 +00:00
|
|
|
lastSender = msg.sender;
|
2020-06-01 23:15:33 +00:00
|
|
|
}
|
2020-07-03 14:37:38 +00:00
|
|
|
|
|
|
|
function setValues(string memory value, string memory value2) public {
|
|
|
|
_value = value;
|
|
|
|
_otherValue = value2;
|
|
|
|
lastSender = msg.sender;
|
|
|
|
}
|
2021-10-22 11:25:46 +00:00
|
|
|
|
|
|
|
function _hashPuzzle() public view returns (uint256) {
|
|
|
|
return 100;
|
|
|
|
}
|
2020-06-01 23:15:33 +00:00
|
|
|
}
|