You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GASPRICE being an Ethereum opcode (3a), it is important to supply the correct gasPrice parameter, else you will estimate the wrong amount of gas.
An example of a token that conditions on GASPRICE is TrueUSD, which spends an additional ~21k gas if the GASPRICE is sufficiently high. Supplying insufficient gas will cause the transaction to revert. Even when the amount supplied is sufficient, there is danger that transactions that estimateGas with a different gasPrice than they pay could fail deterministically.
You might also consider padding the estimated gasLimit by 50%, which is what MetaMask does, except for regular eth transfers to accounts that aren't contracts. MetaMask checks if the recipient is a contract using eth_getCode.
The text was updated successfully, but these errors were encountered:
GASPRICE
being an Ethereum opcode (3a
), it is important to supply the correct gasPrice parameter, else you will estimate the wrong amount of gas.An example of a token that conditions on
GASPRICE
is TrueUSD, which spends an additional ~21k gas if the GASPRICE is sufficiently high. Supplying insufficient gas will cause the transaction to revert. Even when the amount supplied is sufficient, there is danger that transactions that estimateGas with a different gasPrice than they pay could fail deterministically.You might also consider padding the estimated gasLimit by 50%, which is what MetaMask does, except for regular eth transfers to accounts that aren't contracts. MetaMask checks if the recipient is a contract using eth_getCode.
The text was updated successfully, but these errors were encountered: