gpt4 book ai didi

ethereum - 愤怒 : sender account not recognized

转载 作者:行者123 更新时间:2023-12-04 12:37:28 25 4
gpt4 key购买 nike

我正在尝试部署我的契约(Contract),但它返回此错误

truffle migrate --network ropsten --reset


1_initial_migration.js
======================

Deploying 'Migrations'
----------------------
Error: Error: Error: *** Deployment Failed ***

"Migrations" -- sender account not recognized.

truffle_config.js
ropsten: {
provider: function() {
return new HDWalletProvider(mnemonic, "https://ropsten.infura.io/v3/<PROJECTID>")
},
network_id: "*",
gas: 4000000,
from: "0x4e2f89...."
}

最佳答案

By default, the HDWalletProvider will use the address of the first address that's generated from the mnemonic. If you pass in a specific index, it'll use that address instead.



因此,如果您使用的地址不是此助记符中的第一个地址,您应该指定地址
HDWalletProvider(mnemonic, "ropsten.infura.io/v3/<PROJECTID>", indexOfYourAddress)

或通过将数字放入第四个参数来解锁多个地址
HDWalletProvider(mnemonic, "ropsten.infura.io/v3/<PROJECTID>",0, numberOfAddresses)

关于ethereum - 愤怒 : sender account not recognized,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59887082/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com