[Bug]: Fix Permit token decimal amounts #27243
Labels
regression-develop
Regression bug that was found on development branch, but not yet present in production
release-12.6.0
Issue or pull request that will be included in release 12.6.0
Sev2-normal
Normal severity; minor loss of service or inconvenience.
team-confirmations
Push issues to confirmations team
type-bug
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: