- test self destructing contracts
Last active
May 5, 2017 15:07
-
-
Save silasdavis/7f35cb31a255c18d2fc70eed1fa38211 to your computer and use it in GitHub Desktop.
selfdestruct issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobs: | |
- name: deployMortal | |
job: | |
deploy: | |
contract: mortal.sol | |
- name: callMortal | |
job: | |
call: | |
destination: $deployMortal | |
function: destroy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.0.0; | |
import "./owned.sol"; | |
contract mortal is owned { | |
function destroy() onlyOwner { | |
selfdestruct(owner); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.0.0; | |
contract owned { | |
address owner; | |
modifier onlyOwner() { | |
if (msg.sender == owner) { | |
_; | |
} | |
} | |
function owned() { | |
owner = msg.sender; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment