Created
February 15, 2017 00:38
-
-
Save DavidBurela/01cf3cc2b14bbf1aedf98ac2c7047690 to your computer and use it in GitHub Desktop.
truffle console demo
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
// get accounts | |
web3.eth.accounts | |
// get reference to deployed contract | |
var metaCoin; | |
MetaCoin.deployed().then(function(deployed) {metaCoin = deployed;}); | |
// get balance of account 0 | |
metaCoin.getBalance.call(web3.eth.accounts[0]) | |
// send coins | |
var account0 = web3.eth.accounts[0]; | |
var account1 = web3.eth.accounts[1]; | |
metaCoin.sendCoin(account1, 1000, {from: account0}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment