简体   繁体   中英

INFURA: sender account not recognized

I am trying to deploy my contract but it returns this error

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.

So if you are using address that isn't the first address from this mnemonic you should ether specify the address

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

or unlock multiple addresses by putting number to the forth parameter

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM