I encountered this "Gas estimation failed" error popup when I deployed a contract using remix on an evm chain with fixed base fee (3gwei) and minimum gastip (1gwei) settings.
Press F12 to see the error details:
"50000000 gas failed: transaction price too low: address 0xcBBECa26e89011E32BA25610520B20741b809007, gastipcap 0, gasfeecap 4000000000"
After digging into the remix code, I found that gasfeecap is set to a magic ratio of basefee (4/3), and the comment says that this is to avoid metamask issues https://github.com/MetaMask/metamask-extension/issues/11824. The comments under this issue indicate that this issue has been resolved in 2021. I think estimateGas should use the gastipcap and gasfeecap of the transaction itself, or use nil.
I encountered this "Gas estimation failed" error popup when I deployed a contract using remix on an evm chain with fixed base fee (3gwei) and minimum gastip (1gwei) settings.
Press F12 to see the error details:
"50000000 gas failed: transaction price too low: address 0xcBBECa26e89011E32BA25610520B20741b809007, gastipcap 0, gasfeecap 4000000000"
After digging into the remix code, I found that gasfeecap is set to a magic ratio of basefee (4/3), and the comment says that this is to avoid metamask issues https://github.com/MetaMask/metamask-extension/issues/11824. The comments under this issue indicate that this issue has been resolved in 2021. I think estimateGas should use the gastipcap and gasfeecap of the transaction itself, or use nil.
See https://github.com/ethereum/remix-project/blob/86034e4011892eb38264a26880020e271954a05f/libs/remix-lib/src/execution/txRunnerWeb3.ts#L130C18-L130C31