在使用 `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

相关文章:

  • 2022-12-23
  • 2021-05-24
  • 2021-09-10
  • 2021-04-15
  • 2022-12-23
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-23
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2022-01-03
相关资源
相似解决方案