[INFURA:无法识别发件人帐户

问题描述 投票:1回答:1

我正在尝试部署我的合同,但它返回此错误

松露迁移-网络ropsten-重置

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...."
    }
ethereum truffle geth
1个回答
0
投票

默认情况下,HDWalletProvider将使用第一个从助记符生成的地址。如果您通过特定索引,它将改用该地址。

因此,如果您使用的地址不是该助记符中的第一个地址,则应指定该地址

HDWalletProvider(mnemonic, "ropsten.infura.io/v3/<PROJECTID>", indexOfYourAddress)

或通过将数字放在第四个参数中来解锁多个地址

HDWalletProvider(mnemonic, "ropsten.infura.io/v3/<PROJECTID>",0, numberOfAddresses)
© www.soinside.com 2019 - 2024. All rights reserved.