daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     })
RAW Paste Data
Top