Skip to content

Instantly share code, notes, and snippets.

@MichalZalecki
Created July 3, 2018 11:04
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 MichalZalecki/b6d55c0f7103a7b5a53de20019d148d8 to your computer and use it in GitHub Desktop.
Save MichalZalecki/b6d55c0f7103a7b5a53de20019d148d8 to your computer and use it in GitHub Desktop.
$ ./node_modules/.bin/truffle migrate --network ganache
$ ./node_modules/.bin/truffle console --network ganache
truffle(ganache)> SimpleToken.deployed().then(instance => token = instance)
truffle(ganache)> token.name()
'Tooploox'
truffle(ganache)> token.balanceOf(web3.eth.accounts[0]).then(n => n.toString())
'21000000000000000000000000'
truffle(ganache)> token.transfer(web3.eth.accounts[1], 100 * 10 ** 18)
{ tx: '0xe3133864da05500277f881fb5bb8b29f98ffd26ad1ffcc70544e3023e8d7fc90', ... }
truffle(ganache)> token.balanceOf(web3.eth.accounts[0]).then(n => n.toString())
'20999900000000000000000000'
truffle(ganache)> token.balanceOf(web3.eth.accounts[1]).then(n => n.toString())
'100000000000000000000'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment