I am developing a smart contract in truffle. I'm having some trouble understanding how GAS works in Ethereum. I used the following parameters in my Rinkeby test net:
gas limit: 4600000 gas price: 10000000000 (10Gwei)
This means that the Gas limit is set at: 4600000 * 10000000000 ~ 0.046 ETH ~ 17 $
On the other side, I have 0.0303 ETH (~11$) on the mainnet and according to this site https://ethgasstation.info/ I put 100Gwei as gas price and then I set 30000 as gas limit (because 100Gwei * 30000 is about 10$).
I've got this error during deploy in dry run:
My question is: what values I need to use to deploy and use a contract? Who decides these values? Gas price seems to change very fast. Do I need to constantly update these values? Do I need to have more money in my wallet to deploy a contract ? How can I estimate all costs?