我正在尝试为一些智能合约编写一个迁移,编译器中出现了这个错误。
Error: Deployment Failed
"MasterChefV2" -- Invalid number of parameters for "undefined". Got 2 expected 5!.下面是我的迁移js:
const Masterchef = artifacts.require('MasterChefV2.sol');
const EGG = artifacts.require('EggToken.sol');
const Timelock = artifacts.require('Timelock.sol');
module.exports = function (deployer) {
deployer.deploy(Masterchef, EGG, Timelock);
};这是MasterChefV2构造函数
constructor(
EggToken _egg,
address _devaddr,
address _feeAddress,
uint256 _eggPerBlock,
uint256 _startBlock
) public {
egg = _egg;
`enter code here` devaddr = _devaddr;
feeAddress = _feeAddress;
eggPerBlock = _eggPerBlock;
startBlock = _startBlock;
}发布于 2021-03-29 18:13:07
这很简单,因为在部署过程中,您只提供了2个参数。显然需要5个。
迁移文件仅找到以下两个参数:
您需要手动添加其他3个:
https://stackoverflow.com/questions/66512117
复制相似问题