ipld-eth-statedb/internal/testdata/Test.sol
Roy Crihfield 761d60acdf Geth 1.13 (Deneb/Cancun) update (#5)
The Geth `core/state` and `trie` packages underwent a big refactor between `v1.11.6` and `1.13.14`.
This code, which was adapted from those, needed corresponding updates. To do this I applied the diff patches from Geth directly where possible and in some places had to clone new parts of the Geth code and adapt them.

In order to make this process as straightforward as possible in the future, I've attempted to minimize the number of changes vs. Geth and added some documentation in the `trie_by_cid` package.

Reviewed-on: #5
2024-05-29 10:00:12 +00:00

29 lines
590 B
Solidity

// 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);
}
}