erigon-pulse/cmd/tester/contracts/revive2.sol
Alex Sharov f9f54f012d
Tester phase 2 (#390)
* Add revive and phoenix

* store enode address to file, then read it from tester

* store enode address to file, then read it from tester

* rebase master

* fix miss-type

* dbg p2p-sub-protocol, add self-destruct test case

* re-create blockFetcher

* exit syncer loop and start new one

* rebase to master

* use core.GenerateChain

* root miss-match

* introduce reduceComplexity flag

* fix transfer to 0 account

* cleanup

* test-case for intermediate cache

* clean

* clean

* clean

* fix handler panic

Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
Co-authored-by: alex.sharov <alex.sharov@lazada.com>
2020-03-15 16:10:07 +00:00

39 lines
1.1 KiB
Solidity

pragma solidity ^0.6.0;
// solc --allow-paths ., --abi --bin --overwrite --optimize -o core/state/contracts/build core/state/contracts/revive2.sol
// abigen -abi core/state/contracts/build/Revive2.abi -bin core/state/contracts/build/Revive2.bin -pkg contracts -type revive2 -out core/state/contracts/gen_revive2.go
// abigen -abi core/state/contracts/build/Phoenix.abi -bin core/state/contracts/build/Phoenix.bin -pkg contracts -type phoenix -out core/state/contracts/gen_phoenix.go
contract Revive2 {
constructor() public {
}
event DeployEvent (Phoenix d);
/* Deploys self-destructing contract with given salt and emits DeployEvent with the address of the created contract */
function deploy(bytes32 salt) public {
Phoenix d;
d = new Phoenix{salt: salt}();
emit DeployEvent(d);
}
}
contract Phoenix {
uint256 location;
mapping(uint256=>uint256) data;
constructor() public {
}
function store() public {
data[location] = 1;
location++;
}
receive() external payable {
}
function die() public {
selfdestruct(address(0));
}
}