Guest User

Untitled

a guest
Dec 7th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. function killContract() constant returns (bool) {
  2. require(msg.sender == owner);
  3. selfdestruct(owner);
  4. return true;
  5. }
  6.  
  7. MyContract.at('0x...')
  8. .then(instance => {
  9. c = instance;
  10. return c.getOwner()
  11. })
  12. .then(owner => {
  13. console.log(`Owner: ${owner}`);
  14. return c.killContract()
  15. })
  16. .then(killed => {
  17. console.log(`If killed return true: ${killed}`);
  18. })
  19. .catch(error => {
  20. console.log(`${error}`);
  21. })
Add Comment
Please, Sign In to add comment