Guest User

Untitled

a guest
Nov 18th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. const hash = { /* ... passed from the server-side .... */ };
  2.  
  3. if (!window.web3) return alert('you don\'t have metamask installed');
  4.  
  5. // call web3 code from the client-side like so
  6. const abi = [ /* ... */ ]
  7. const contract = web3.eth.contract(abi).at('0x12323.....');
  8.  
  9. contract.claimReward(
  10. 1000, 1, 123, // pass the parameters
  11. hash.data, // the hash of all the parameters
  12. hash.hash.v, hash.hash.r, hash.hash.s, // the signed hash
  13. (error, results) => console.log(error, results)
  14. )
Add Comment
Please, Sign In to add comment