Skip to content

Instantly share code, notes, and snippets.

@amazingandyyy
Last active July 11, 2018 21:31
Show Gist options
  • Save amazingandyyy/fa78071b46ba1f01b38694303132d2e7 to your computer and use it in GitHub Desktop.
Save amazingandyyy/fa78071b46ba1f01b38694303132d2e7 to your computer and use it in GitHub Desktop.
const accounts = await web3.eth.getAccounts();
const instance = new web3.eth.Contract(ABI,address)
instance.methods.functionName(params).send({
from: accounts[0],
gas: '1000000'
});
@amazingandyyy
Copy link
Author

const accounts = await web3.eth.getAccounts();
const instance = new web3.eth.Contract(ABI,address)
// cal the set 
instance.methods.set("Hello").send({
     from: accounts[0],
     gas: '1000000'
});

// call the get
const message = instance.methods.get().call();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment