Last active
September 30, 2017 00:06
-
-
Save lucca65/2d4cef4dd560b286ff9d9b8badfcfd29 to your computer and use it in GitHub Desktop.
web3_example.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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