Error migrating multiple contracts

Hello, I’m new to solidity and to this forum. I forked a yield farming defi project (goose - https://github.com/goosedefi/ ).

The project compiles and the token.sol contract migrates without error but when it gets to Timelock and MasterChef migration, I get errors:
“Timelock” – Invalid number of parameters for “undefined”. Got 0 expected 2!. - error…
“MasterChef” – Invalid number of parameters for “undefined”. Got 0 expected 5!. - error…

I’m not sure what variables were expected and how to pass those…

This is excerpt of my 2_deploy-contracts.js file:

const Timelock = artifacts.require("Timelock");
const Token = artifacts.require("Token");
const MasterChef = artifacts.require("MasterChef");

module.exports = async function(deployer) {


await deployer.deploy(Token);

deployer.deploy(MasterChef);
deployer.deploy(Timelock);

}

Truffle, solc 0.6.4

:computer: Environment

:memo:Details

:1234: Code to reproduce

1 Like

Just like followings:

await deployer.deploy(Token, "TokenName", "xx");
token = await Token.deployed();
2 Likes

Hi @bscdev,

Welcome to the community :wave:

You need to provide the appropriate number of parameters to the constructor when deploying, as per the example @Skyge gave.

See the Truffle documentation for more details: https://www.trufflesuite.com/docs/truffle/getting-started/running-migrations#deployer-deploy-contract-args-options-

1 Like