ipld-eth-statedb/internal/testdata/Test.sol

29 lines
590 B
Solidity
Raw Permalink Normal View History

// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
contract Test {
event logPut (address, uint256);
address payable owner;
mapping(address => uint256) public data;
modifier onlyOwner {
require(msg.sender == owner, "Only owner can call this function.");
_;
}
constructor() {
owner = payable(msg.sender);
}
function Put(uint256 value) public {
emit logPut(msg.sender, value);
data[msg.sender] = value;
}
function close() public onlyOwner {
owner.transfer(address(this).balance);
}
}