Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function killContract() constant returns (bool) {
- require(msg.sender == owner);
- selfdestruct(owner);
- return true;
- }
- MyContract.at('0x...')
- .then(instance => {
- c = instance;
- return c.getOwner()
- })
- .then(owner => {
- console.log(`Owner: ${owner}`);
- return c.killContract()
- })
- .then(killed => {
- console.log(`If killed return true: ${killed}`);
- })
- .catch(error => {
- console.log(`${error}`);
- })
Add Comment
Please, Sign In to add comment