Search code examples
ethereumsoliditytruffle

Truffle: Sender doesn't have enough funds to send tx


I'm trying to migrate/test my smart contract on ropsten network using this config:

  networks: {
    ropsten: {
     provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/${infuraKey}`),
     network_id: 3,       // Ropsten's id
     gas: 3000000,
    }
  },

running truffle migrate --network ropsten

but I keep getting this error:

Error:  *** Deployment Failed ***

"Migrations" could not deploy due to insufficient funds
   * Account:  **address**
   * Balance:  0 wei
   * Message:  sender doesn't have enough funds to send tx. The upfront cost is: 6000000000000000 and the sender's account only has: 0

How do I show truffle I have sufficient funds?


Solution

  • Your Ropsten account needs to have ETH in order to interact with the network.