I made a contract, compiled it, and when I enter truffle migrate --reset, this comes out. what to do?)
Hi @Andrei,
It looks like you are not providing the parameter the constructor of your smart contract is expecting.
See the Truffle documentation on how to provide the constructor paramenters:
// Deploy a single contract without constructor arguments deployer.deploy(A); // Deploy a single contract with constructor arguments deployer.deploy(A, arg1, arg2, ...);
If you can share your smart contract and migrations script 2_deploy_mytoken.js
I am happy to take a look.
const MyToken = artifacts.require("MyToken");
module.exports = function(deployer) {
deployer.deploy(MyToken);
};
Hi,
the constractor expects an initialSupply from type uint265. So that’s the missing variable that is causing the “undefined” error Got 0 expected 1. Because you did not pass this argument it will be interpreted as “undefined”
Assume you have 1000 wei as initialSupply try this:
const MyToken = artifacts.require(“MyToken”);
module.exports = function(deployer) {
deployer.deploy(MyToken, 1000);
};
thanks, it turned out
please tell me which test do I need to write in my contract?)
Hi @Andrei,
The following article is a great resource:
Also look at the OpenZeppelin Contracts tests: https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/test/token/ERC20
thanks, I’ll try now …