I'm getting the error:
"Migrations" could not deploy due to insufficient funds. Sender doesn't have enough funds to send tx. The upfront cost is: 45000000000000000 and the sender's account only has: 0
as I'm migrating into Rinkeby test network. I have enough ether in Account #2 from faucet that I'm trying to use, but Truffle is persistently trying to use Account #1 that has 0 balance in it. At which point does Truffle try to connect to MetaMask? Is it Node or Truffle that's not working properly? And how do I change the account that Truffle recognizes so that I can connect to Account #2, instead of Account #1?
So far, I've tried:
- Uninstalling and re-installing Truffle
- Logging out and re-logging into MetaMask and toggling between the accounts
- Changing the gas/gasPrice to a higher value or commenting them out
- Changing the node version
I'm using "@truffle/hdwallet-provider": "^1.0.35"
rinkeby: {
provider: () =>
new HDWalletProvider(
mnemonic,
`https://rinkeby.infura.io/v3/${infuraKey}`
),
network_id: 4, // rinkeby's id
gas: 4500000, // rinkeby has a lower block limit than mainnet
gasPrice: 10000000000,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: false,
},