[FAQ] Truffle Deployer 合约传参问题: Invalid number of parameters for "undefined". Got 0 expected 1!

通过llama.cpp与羊驼聊天的网页界面- 详解 Serge 的启动使用

 

在使用 `truffle migrate` 时,如果合约的构造函数需要传参,而部署脚本里没有传的时候,就会报这个错。

 

未传参时:

const Migrations = artifacts.require("Migrations");

module.exports = function(deployer) {
  deployer.deploy(Migrations);
};

 

第二个位置开始代表第一个参数,以此类推:

const Migrations = artifacts.require("Migrations");

module.exports = function(deployer) {
  deployer.deploy(Migrations, 'xx');
};

 

其它:基础矿池

Refer:Truffle还流行吗

Link:https://www.cnblogs.com/farwish/p/12574669.html

posted on 2020-03-26 15:19  ercom  阅读(2128)  评论(0编辑  收藏  举报