Skip to content

Instantly share code, notes, and snippets.

@lucca65
Last active September 30, 2017 00:06
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 lucca65/2d4cef4dd560b286ff9d9b8badfcfd29 to your computer and use it in GitHub Desktop.
Save lucca65/2d4cef4dd560b286ff9d9b8badfcfd29 to your computer and use it in GitHub Desktop.
web3_example.js
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"))
const abi = JSON.parse('. . .')
const address = '0x593b851932dAFdf8573Ed7891518b1Ba5B0d5838'
const contract = web3.eth.contract(abi).at(address)
contract.setMessage("I'm picke Rick motherfucker!", {
value: web3.toWei('10', 'finney'),
from: '0x004fC1D0F9C8d126418ab466b03A4B0E55422B64'
}, (error, result) => {
if (error) {
console.error(error)
return
}
// Yay everything worked
showModal('success', result)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment