Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. await contract.methods.set(5).send({ from: accounts[0] });
  2.  
  3. contract.methods.set(51).send({ from: accounts[0] }).then((error, tranasctionHash)=>{alert(tranasctionHash);});
  4.  
  5. contract.methods.set(51).send({ from: accounts[0] }, (error, tranasctionHash)=>{alert(tranasctionHash);});
  6.  
  7. const response = await contract.methods.get().call();
  8.  
  9. this.setState({ storageValue:response});
  10.  
  11. this.setState({ storageValue:this.state.web3.utils.hexToNumber(this.state.web3.utils.toHex(response))});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement