Created
February 15, 2018 02:11
-
-
Save sogoiii/f03773742a0cd2a9d8fdf4f4fdaa1903 to your computer and use it in GitHub Desktop.
Truffle contract interaction example
This file contains hidden or 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
import contract from 'truffle-contract' | |
const contractArtifact = require('./build/contracts/TutorialToken.json') | |
const web3 = new Web3() | |
const providerUrl = 'http://localhost:8545' | |
const provider = new Web3.providers.HttpProvider(providerUrl) | |
web3.setProvider(provider) | |
const TutorialToken = contract(contractArtifact) | |
TutorialToken.sendCoin(0x013, 10, {from: account_one}) | |
.then(console.log) | |
.catch(consle.error) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment