Truffle test – ReferenceError: accounts is not defined

When you run command ‘truffle test’ and get error:“ReferenceError: accounts is not defined” To fix this, use below code line:contract(“Contract”, async (accounts) => {} and put test code between brackets e.g.:

Truffle test – network error

truffle(ganache)> truffle testError: You must specify a network_id in your ‘ganache’ configuration in order to use this network. Go to config file: truffle-config.js -> uncomment ‘development’ section in ‘networks’. Change port if you have a different one in Ganache, e.g. modfiy from 8545 to 7545. Save file -> back to console -> run command: ‘truffleContinue reading “Truffle test – network error”

Create new ERC20 token – smart contract

Sample smart contract to create your own token: The same code, but with a hard-coded name, symbol and initial supply: Sources: