Skip to content

Commit

Permalink
Rename Suicide to SelfDestruct
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouzo committed Oct 25, 2023
1 parent 0f50aea commit 80dbd28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity >=0.7.0 <0.9.0;

contract SuicideContract {
contract SelfDestructContract {
address public owner;

constructor() {
Expand Down
20 changes: 11 additions & 9 deletions test/functional/feature_evm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,7 @@ def delete_account_from_trie(self):
) # Touch addressB and trigger deletion as empty account
self.nodes[0].generate(1)

# Deploy Suicide contract to trigger deletion via Suicide opcode
# Deploy SelfDestruct contract to trigger deletion via SELFDESTRUCT opcode
self.nodes[0].transferdomain(
[
{
Expand All @@ -1408,8 +1408,10 @@ def delete_account_from_trie(self):
)
self.nodes[0].generate(1)

self.contract = EVMContract.from_file("Suicide.sol", "SuicideContract")
abi, bytecode, _ = self.contract.compile()
self.contract = EVMContract.from_file(
"SelfDestruct.sol", "SelfDestructContract"
)
abi, bytecode, deployedBytecode = self.contract.compile()
compiled = self.nodes[0].w3.eth.contract(abi=abi, bytecode=bytecode)

tx = compiled.constructor().build_transaction(
Expand Down Expand Up @@ -1438,8 +1440,8 @@ def delete_account_from_trie(self):

codeBefore = self.nodes[0].eth_getCode(self.contract_address)
assert_equal(
codeBefore,
"0x608060405234801561000f575f80fd5b5060043610610034575f3560e01c80638da5cb5b14610038578063bcea363d14610056575b5f80fd5b610040610072565b60405161004d919061017a565b60405180910390f35b610070600480360381019061006b91906101d2565b610095565b005b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610122576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101199061027d565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16ff5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6101648261013b565b9050919050565b6101748161015a565b82525050565b5f60208201905061018d5f83018461016b565b92915050565b5f80fd5b5f6101a18261013b565b9050919050565b6101b181610197565b81146101bb575f80fd5b50565b5f813590506101cc816101a8565b92915050565b5f602082840312156101e7576101e6610193565b5b5f6101f4848285016101be565b91505092915050565b5f82825260208201905092915050565b7f4f6e6c7920746865206f776e65722063616e2063616c6c20746869732066756e5f8201527f6374696f6e000000000000000000000000000000000000000000000000000000602082015250565b5f6102676025836101fd565b91506102728261020d565b604082019050919050565b5f6020820190508181035f8301526102948161025b565b905091905056fea26469706673582212205b57b3041b7e5425acf700e1f8f9234843547f79875ac6a6f66417bc1329c3ce64736f6c63430008140033",
codeBefore[2:],
deployedBytecode,
)
storageBefore = self.nodes[0].eth_getStorageAt(self.contract_address, "0x0")
assert_equal(
Expand All @@ -1463,16 +1465,16 @@ def delete_account_from_trie(self):
hash = self.nodes[0].w3.eth.send_raw_transaction(signed.rawTransaction)
self.nodes[0].generate(1)

codeAfterSuicide = self.nodes[0].eth_getCode(self.contract_address)
codeAfterSelfDestruct = self.nodes[0].eth_getCode(self.contract_address)
assert_equal(
codeAfterSuicide,
codeAfterSelfDestruct,
"0x",
)
storageAfterSuicide = self.nodes[0].eth_getStorageAt(
storageAfterSelfDestruct = self.nodes[0].eth_getStorageAt(
self.contract_address, "0x0"
)
assert_equal(
storageAfterSuicide,
storageAfterSelfDestruct,
"0x0000000000000000000000000000000000000000000000000000000000000000",
)

Expand Down

0 comments on commit 80dbd28

Please sign in to comment.