4
votes
MetaMask incorrectly estimates 100,000 gas for ERC20 transfer. Why?
Since you are interested in knowing why does Metamask estimate wrong the gas limit, I'll share with you some information that is good to know.
Metamask makes use of the function eth_estimateGas to ...
3
votes
MetaMask incorrectly estimates 100,000 gas for ERC20 transfer. Why?
As a disclaimer Rob and I work together so I have an unfair advantage here but thought it would be helpful to give a very detailed breakdown of what is going on...
TLDR;
Likely an unhandled error in ...
2
votes
ethers.js - estimating gas limit
(The OP has commented on the question that they're looking for a way to estimate the gas price, not the gas limit, this answer is based on that clarification.)
Method 1
Ethers has a built-in function ...
2
votes
Accepted
Why the BSC block gas limit change and what's the logic behind it?
I've been reviewing the source code for the bnb node (erigon version). I've discovered that it follows the same mechanism as Ethereum or Polygon in which in each block, the producer could vary the gas ...
1
vote
Avoiding loops in Solidity for a simple situation
Looping through all users is not just very gas inefficient, it may become impossible once your contract has a lot of users and the looping consumes more gas than the block gas limit.
I would recommend ...
1
vote
gas estimation error because of reverted
You need to add the necessary gas at the time you create the transaction. It appears that you know in advance how much gas will be needed: 266_087. So you put this value when creating the transaction. ...
1
vote
MetaMask - failed transaction, maximum gas rate suggested is to low
The gas value is set in the UI code, not inside the contract. Usually, you would call estimateGas first and then add ~20% on top of that to ensure there is enough gas allocated for the transaction.
1
vote
Is it possible to get consumed and remained gas from within a smart contract?
You can check this previous post to get an idea about how to procced:
Is gasleft() the best way to manage big loops in solidity?
1
vote
How to fix "Transaction was not mined within 50 blocks, please make sure you transaction was properly sent." error?
I see you're facing the
Transaction was not mined within 50 blocks
error while working with Ethereum transactions.
First, try to increase the gas limit. Certain transactions may require more gas ...
1
vote
Accepted
The simplest way to return a list of items + gas limits on long lists when using pragma experimental ABIEncoderV2?
Most RPC Provider will enforce a gasLimit for eth_call as DOS Protection. For instance, Alchemy has a limit of 550 mio. and Infura has a limit of 300 mio.
You can create a view function that ...
1
vote
Error: cannot estimate gas
This error pops when something is wrong while calling the contract functions.
Few things you should check.
You should be passing the arguments correctly, as I see there are so many parameters in the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
gas-limit × 403gas × 199
solidity × 93
gas-price × 69
gas-estimate × 60
out-of-gas × 55
transactions × 41
go-ethereum × 38
remix × 35
web3js × 27
contract-deployment × 23
private-blockchain × 21
contract-development × 19
metamask × 16
blocks × 15
truffle × 12
mining × 12
ganache × 12
contract-design × 11
ether × 10
ethers.js × 10
openethereum × 10
contract-invocation × 9
evm × 9
ropsten × 9