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.:
Category Archives: Solidity
Error: Number can only safely store up to 53 bits
I got this error: ‘Error: Number can only safely store up to 53 bits’ when using toNumber function: Quick fix using BigInt:
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:https://docs.openzeppelin.com/contracts/4.x/erc20https://solidity-by-example.org/app/erc20/https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/token/ERC20/ERC20.sol