ethers-rs/ethers-contract/tests/solidity-contracts/NotSoSimpleStorage.sol

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
753 B
Solidity
Raw Normal View History

2020-06-01 23:15:33 +00:00
pragma solidity >=0.4.24;
contract NotSoSimpleStorage {
2020-06-01 23:15:33 +00:00
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
address public lastSender;
2020-06-01 23:15:33 +00:00
string _value;
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 getValues() view public returns (string memory, address) {
return (_value, lastSender);
2020-06-01 23:15:33 +00:00
}
function setValue(string memory value) public {
emit ValueChanged(msg.sender, lastSender, _value, value);
_value = value;
lastSender = msg.sender;
}
2020-06-01 23:15:33 +00:00
}