Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@etekis

etekis/test.js Secret

Last active August 28, 2018 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etekis/1a2251963b458a18cb6e63a1a28eaa28 to your computer and use it in GitHub Desktop.
Save etekis/1a2251963b458a18cb6e63a1a28eaa28 to your computer and use it in GitHub Desktop.
// Get the contract instance using your contract's abi and address:
const contractInstance = web3.eth.contract(abi).at(contractAddress);
// Get user’s web3 address
var sender = web3.eth.accounts[0];
// Call a function of the contract:
contractInstance.someFunction({
from: sender, value: someValue, gas: limit
}, (err, res) => { /** do something with results **/ });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment