truffle.js
:
var HDWalletProvider = require("truffle-hdwallet-provider");
var mnemonic = "";
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
},
rinkeby: {
provider: function() {
return new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/v3/");
},
network_id: 4,
gasPrice: "450000000",
},
live: {
networkCheckTimeout: 100000,
provider: function() {
return new HDWalletProvider(mnemonic, "https://mainnet.infura.io/v3/");
},
network_id: 1,
gasPrice: "450000000",
},
},
compilers: {
solc: {
version: "0.8.4",
},
},
};
Successfully deploying to Rinkeby:
> transaction hash:
> Blocks: 1 Seconds: 17
> contract address:
> block number: 8751194
> block timestamp: 1623504143
> account:
> balance: 18.7469330662
> gas used: 1476936 (0x168948)
> gas price: 0.45 gwei
> value sent: 0 ETH
> total cost: 0.0006646212 ETH
> Saving artifacts
-------------------------------------
> Total cost: 0.0006646212 ETH
Summary
=======
> Total deployments: 1
> Final cost: 0.0006646212 ETH
Error while deploying to mainnet:
Error: *** Deployment Failed ***
"ContractName" could not deploy due to insufficient funds
* Account:
* Balance: 991972954849359 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.
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at Migration._deploy (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:74:1)
at Migration._load (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:61:1)
at Migration.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:212:1)
at Object.runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
at Object.runFrom (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:87:1)
at runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:263:1)
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:226:1)
at Command.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:136:1)
Truffle v5.2.4 (core: 5.2.4)
Node v14.15.0
My balance is clearly more than that required by the transaction. Why is this happening?