Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const hash = { /* ... passed from the server-side .... */ };
- if (!window.web3) return alert('you don\'t have metamask installed');
- // call web3 code from the client-side like so
- const abi = [ /* ... */ ]
- const contract = web3.eth.contract(abi).at('0x12323.....');
- contract.claimReward(
- 1000, 1, 123, // pass the parameters
- hash.data, // the hash of all the parameters
- hash.hash.v, hash.hash.r, hash.hash.s, // the signed hash
- (error, results) => console.log(error, results)
- )
Add Comment
Please, Sign In to add comment