-
Notifications
You must be signed in to change notification settings - Fork 161
Open
Labels
Description
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.
Reactions are currently unavailable