:~工作区/myproject$松露迁移--重置
一切都是最新的,没有什么要编译的。
运行迁移: 1_initial_migration.js取代迁移..。迁移: 0xA501AfD7d6432718daF4458Cfae8590d88de818E将成功迁移到网络。保存文物..。运行迁移: 2_deploy_simplestorage.js部署SimpleStorage..。遇到错误,抛出。网络状态未知。手动检查成功的事务。错误:“未定义”的参数数无效。得到2,预期1!(/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-contract/~/web3-core-helpers/src/errors.js:32:1) at Object._createTxObject (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-contract/src/index.js:699:1) at Contract.deploy (/usr/local/lib/node_modules/truffle/build/webpack:/~/(/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/lib/execute.js:214:1) at constructor.detectNetwork.then.network (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/lib/contract/constructorMethods.js:56:1) at at process._tickCallback ( Function.deploy /process/next)_tick.js:189:7)信托v5.0.12 (核心: 5.0.12)节点v8.16.0
发布于 2019-06-03 12:38:46
您没有粘贴用于部署的脚本,但是从错误中看,您似乎要向simple_storage契约构造函数传递两个参数,而它只需要一个参数(初始化存储值的值)。
下面是我环境中的一份副本:
// Pass 42 to the contract as the first constructor parameter
deployer.deploy(simple_storage, 42, {privateFor: ["ROAZBWtSacxXQrOe3FGAqJDyJjFePR5ce4TSIzmJ0Bc="]})如果要传递正确的参数数,请尝试删除“build”目录的内容并重新部署。
https://ethereum.stackexchange.com/questions/71401
复制相似问题