Conversation
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Closes #2012.
v12.9.0 adds Arc and Stable Chain offers through 6-decimal ERC-20 mirrors. Both SDK entrypoints still seed every default offer currency as 18 decimals, so
1.5becomes1500000000000000000base units instead of1500000. Because the address is already cached, the SDK never asks the payment-token endpoint for the correct precision.The regression reproduces on current
mainfor both chains and both ethers and viem.Solution
Add the default offer currency precision to the chain helpers and use it when the ethers and viem constructors initialize their caches. Existing wrapped-native defaults remain at 18 decimals; native listing and non-default ERC-20 resolution are unchanged.
Regression coverage checks:
1.5offers to1500000nValidation:
npm test(57 files, 1,264 tests)npm run check-typesnpm run buildnpm run format:checknpm run lint(passes with the existing unrelatedFunctionwarning)