2022-06-03 13:28:02 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0
|
|
|
|
pragma solidity ^0.8.0;
|
|
|
|
|
|
|
|
contract Test {
|
2023-06-21 23:25:27 +00:00
|
|
|
event logPut (address, uint256);
|
2022-06-03 13:28:02 +00:00
|
|
|
|
2023-06-21 23:25:27 +00:00
|
|
|
address payable owner;
|
|
|
|
mapping(address => uint256) public data;
|
2022-06-03 13:28:02 +00:00
|
|
|
|
2023-06-21 23:25:27 +00:00
|
|
|
modifier onlyOwner {
|
|
|
|
require(msg.sender == owner, "Only owner can call this function.");
|
|
|
|
_;
|
|
|
|
}
|
2022-06-03 13:28:02 +00:00
|
|
|
|
2023-06-21 23:25:27 +00:00
|
|
|
constructor() {
|
|
|
|
owner = payable(msg.sender);
|
|
|
|
}
|
2022-06-03 13:28:02 +00:00
|
|
|
|
2023-06-21 23:25:27 +00:00
|
|
|
function Put(uint256 value) public {
|
|
|
|
emit logPut(msg.sender, value);
|
2022-06-03 13:28:02 +00:00
|
|
|
|
2023-06-21 23:25:27 +00:00
|
|
|
data[msg.sender] = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
function close() public onlyOwner {
|
|
|
|
owner.transfer(address(this).balance);
|
|
|
|
}
|
2022-06-03 13:28:02 +00:00
|
|
|
}
|