Hey Team,
I setup a Polygon test account and used the faucet to get ETH - only sends 0.1 ETH.
Tried to deploy a contract to Mumbai using the Moralis RPC endpoint in truffle and the deploy failed with:
Starting migrations…
Network name: ‘matic’
Network id: 80001
Block gas limit: 20000000 (0x1312d00)
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
Error: *** Deployment Failed ***
"Migrations" could not deploy due to insufficient funds
* Account: 0x5bE9bca32BfD527B40d82c6a2B2A9c7246027BFc
* Balance: 100000000000000000 wei
* Message: insufficient funds for gas * price + value
* Try:
+ Using an adequately funded account
+ If you are using a local Geth node, verify that your node is synced.
The account and balance match the test account I created.
So on a whim I used Remix to deploy on to Ropsten. Deployment succeeded, cost 0.0044 ETH.
Total gas used for all contracts deployed: 4,400,262 (using gas station on mainnet this looks like a current cost of 0.0440026 ETH).
I have not used truffle to deploy to any network other than GANACHE. In the past if I deployed to Ropsten or Mainnet I used Remix.
Since the amount in my Mumbai account is greater than what deployment to mainnet would cost, I assume something is wrong with my truffle deployment setup.
Here is the entry in the truffle.config file:
matic: {
provider: () => new HDWalletProvider(secretKey, `https://speedy-nodes-nyc.moralis.io/a919256c3780769ae58d0149/polygon/mumbai`),
network_id: 80001,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true
},
What other information can I provide that would help? Any thoughts?
Thank you,
David