-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[Bug]: Fix Permit token decimal amounts #27243
Comments
As discussed in the DSU, we can adopt the 18 decimals as the fallback and add metrics to capture when we fail to fetch decimals. event: properties: |
thank you @bschorchit! I created a separate ticket for this one: #27333 |
Describe the bug
If no contract was found within the Permit DataTree component, we should use the verifiedContract tokenDecimals. Passing the verifiedContract's tokenDecimals, when no decimals are found for this contract, will apply the default 18 token decimals. This is missing. Notice in the screenshot that Spending Cap displays "< 0.000001", while Message > Value displays "3,000". Value should also display "< 0.000001".
Details of applying default 18 token decimals to Redesigned Permit
When we adopted
fetchErc20Decimals
for Permit Simulation, we enforced a default of 18 token decimals to be used when no token decimals were found in the details.fetchErc20Decimals
is the same method used inui/pages/confirmations/components/simulation-details/useBalanceChanges.test.ts
which is why we adopted it.Previously, clicking on test-dapp > Permit would display 3,000. Now, it displays 0 < 0.000001.
@dbrans:
Expected behavior
No response
Screenshots/Recordings
Notice that Simulation > Spending Cap value does not match Message > Value
Steps to reproduce
Error messages or log output
No response
Detection stage
On the development branch
Version
12.2.2
Build type
None
Browser
Chrome
Operating system
MacOS
Hardware wallet
No response
Additional context
No response
Severity
No response
The text was updated successfully, but these errors were encountered: