-
Notifications
You must be signed in to change notification settings - Fork 926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impossible to set correct gas price for gas tokens with low decimals #79
Comments
Hi, @rmeissner |
Will not be fixed: #197 |
I had a weird brainfart and struggled to understand the example calculations, so I'll leave some details for a future reference:
My biggest problem was understanding where The example calculation is in the largest denomination, so to get to the smallest, we need to multiply it by |
if you send tokenGasPrice multiplied by a factor say 1e18 and update handlePayment to divide by this fixed number then it solves the problem. |
Description
When paying with an erc20 you would take the exchange rate of token to eth and calculate a fair gas price based on that. For the correct token gas price it is also necessary to take into consideration that eth has 18 and some tokens have less. This can cause problems because the gas price can potentially be between 0 and 1 (which is impossible with uint).
Example calculation
Used gas token will be LOVE (
0xb3a4bc89d8517e0e2c9b66703d09d3029ffa1e6d
)0.5
Steps to reproduce
safe-relay.dev.gnosisdev.com
to estimate a transaction that uses0xb3a4bc89d8517e0e2c9b66703d09d3029ffa1e6d
(Love) as a gasTokengasPrice
will be 1 even tho it should be lower (which is not possible with uint)The text was updated successfully, but these errors were encountered: