2020-10-26 13:51:03 +00:00
|
|
|
pragma solidity >=0.6.0;
|
2019-05-27 13:51:49 +00:00
|
|
|
|
|
|
|
// solc --allow-paths ., --abi --bin --overwrite --optimize -o core/state/contracts/build core/state/contracts/selfdestruct.sol
|
|
|
|
// ./build/bin/abigen -abi core/state/contracts/build/Selfdestruct.abi -bin core/state/contracts/build/Selfdestruct.bin -pkg contracts -type selfdestruct -out core/state/contracts/gen_selfdestruct.go
|
|
|
|
contract Selfdestruct {
|
|
|
|
|
|
|
|
uint256 x;
|
|
|
|
uint256 y;
|
|
|
|
uint256 z;
|
|
|
|
|
|
|
|
constructor() public {
|
|
|
|
// Fill some storage positions
|
2019-10-21 12:00:42 +00:00
|
|
|
x = 1 << 32; // Large number to make sure encoding has multiple bytes
|
2019-05-27 13:51:49 +00:00
|
|
|
y = 2;
|
|
|
|
z = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
function change() external {
|
|
|
|
x += 1;
|
|
|
|
y += 1;
|
|
|
|
z += 1;
|
|
|
|
}
|
|
|
|
|
2020-10-26 13:51:03 +00:00
|
|
|
receive() external payable {
|
|
|
|
}
|
|
|
|
|
2019-05-27 13:51:49 +00:00
|
|
|
|
|
|
|
/* Self-destructs */
|
|
|
|
function destruct() public {
|
|
|
|
selfdestruct(address(this));
|
|
|
|
}
|
|
|
|
}
|