November 2018
Intermediate to advanced
528 pages
13h 21m
English
Now that we've deployed our contracts, let's check that the deployment initialized them as expected. To do this we'll call our deployed contracts directly, and to do this we'll use truffle console, which we can run with the following command:
truffle console --network rinkeby
At the prompt, we can then get a reference to our deployed token contract:
truffle(rinkeby)> PacktToken.deployed().then(function(instance) { tokenInstance = instance; })undefinedAnd, from here, we can check our public state variables:
truffle(rinkeby)> tokenInstance.name()'Packt ERC20 Token'truffle(rinkeby)> tokenInstance.symbol()'PET'truffle(rinkeby)> tokenInstance.totalSupply().then(function(supply) { tokenSupply = supply; })undefinedtruffle(rinkeby)> ...Read now
Unlock full access