Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add selfdestruct test cases #431

Closed
chfast opened this issue Mar 16, 2018 · 5 comments
Closed

Add selfdestruct test cases #431

chfast opened this issue Mar 16, 2018 · 5 comments
Labels

Comments

@chfast
Copy link
Member

chfast commented Mar 16, 2018

Add these 3 test cases. They are HF independent, except for pricing. Use optimized runtime code from solidity.

pragma solidity ^0.4.21;

contract DoubleSelfdestructTest {

    address constant B1 = 0x1;
    address constant B2 = 0x2;

    function remoteSelfdestruct() external {
        selfdestruct(B2);
    }

    function() external payable {
        this.remoteSelfdestruct();
        selfdestruct(B1);
    }
}

contract DoubleSelfdestructTest2 {

    address constant B = 0x3;

    function remoteSelfdestruct() external {
        selfdestruct(this);
    }

    function() external payable {
        this.remoteSelfdestruct();
        selfdestruct(B);
    }
}

contract DoubleSelfdestructTest3 {

    function remoteSelfdestruct() external {
        selfdestruct(this);
    }

    function() external payable {
        this.remoteSelfdestruct();
        selfdestruct(this);
    }
}
@axic axic changed the title Add test cases Add selfdestruct test cases Mar 23, 2018
@pirapira pirapira self-assigned this Apr 4, 2018
@pirapira
Copy link
Member

DoubleSelfdestructTest seems to behave differently in {Frontier, Homestead} from in {EIP 150, etc}.

@pirapira
Copy link
Member

Solidity assumes the output is used after EIP150, so its output does not work for Homestead and Frontier.

pirapira added a commit to pirapira/tests that referenced this issue Apr 10, 2018
@pirapira
Copy link
Member

DoubleSelfdestructTest2 behaves differently in EIP150 only, in testeth. Investigating.

@pirapira
Copy link
Member

That was just because Solidity's output doesn't work before EIP150, adn EIP158 changed the behavior of zero-transfer.

pirapira added a commit to pirapira/tests that referenced this issue Apr 19, 2018
This is the second case of ethereum#431
.

The filler file contains a more detailed comment.
pirapira added a commit to pirapira/tests that referenced this issue Apr 20, 2018
This is the second case of ethereum#431
.

The filler file contains a more detailed comment.
@pirapira pirapira removed their assignment Nov 26, 2018
@qbzzt
Copy link
Collaborator

qbzzt commented Nov 27, 2020

Added in PR #764

winsvega added a commit that referenced this issue Nov 29, 2020
The Solidity self destruct tests, as requested in #431
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants