fix(frontend): scale unlisted Swap CW20s from token_info decimals #1295
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic!1295
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue/1255"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Home Swap (
/) and Trade market quoted and executed unlisted factory CW20s atgetDecimals ?? 6. Create Token / other factory assets with on-chain 18 decimals were off by10^12(typed1sent10^6; Max showed1e12for a 1-token wallet).This PR resolves amount scale fail-closed from registry → valid LCD
token_info.decimals(wins over a stale indexer 6) → indexer pair-leg /GET /tokenswhile LCD is in flight or transport-failed. Hostile LCD (255,1e9,"18e0", …) stays unresolved with no indexer fallback. LCD decimals are only fetched for pickergetAllTokensids (QS-4). Cache key iscl8y-dex-token-info-v2.getDecimalsstill defaults unknown to 6 for leftover chrome (Q1257-4).Closes #1255.
Also:
.githooks/pre-pushnow scans only unpublished commits on a new branch (git rev-list <oid> --not --remotes=<remote>). The previous range was the whole ancestry, so a first push walked published history, hit an old body-policy violation already onmain, and hunggit rev-list.Invariants
Documented Q1255-1–Q1255-8 in
docs/frontend.md§ Swap amount scaling,docs/testing.md,docs/contracts-security-audit.md, andskills/AGENTS_FRONTEND_SWAP_AMOUNT_SCALE.md. Cross-links: QS-3/QS-4 inAGENTS_FRONTEND_SWAP_TOKENLIST_SYMBOLS.md, Q1257-4 inAGENTS_FRONTEND_SWAP_USTR_USDT_SCALE.md.Test plan
make verify-issue-1255(passed twice: 5/5, 71 Vitest)nullnot 6; 18 vs 6 unlisted; listed registry unchanged; hostile → null1on mocked 18-dec unlisted factory token → sim/execute10^18; Max human1for raw10^18getDecimals(...) ?? 6as the execute scaletokenlist.jsonand has 18 on-chain decimals —/Swap1must not quote as a 6-dec micro-unit. Listed UST1/cUSTC and CL8Y/USTR stay correct.drain skip: no occupying job for rebase/fix-pr/CI-wait; remaining continue
cl8y-agent-control: queued
implementjobc660a902-c794-48f8-9df5-0b9330f1ac71(not executed; no Hetzner VM).Implement job validation (gate-impl)
PR reuse: No open
issue/1295/Fixes #1295PR — this delivery is already merged tomain(merge4577edc8, closes #1255).Acceptance criteria (#1255): Covered on
mainviaresolveSwapAssetDecimals/useAssetDecimals, token-info cache v2, Swap + Trade market fail-closed execute scale, hybridswapDisclosurepay decimals, hostile LCD handling (Q1255-1–Q1255-8).Automated validation:
make verify-issue-1255— 5/5 steps, 71 Vitest (resolver, hook, SwapPage RTL 18-dec vs 6-dec, cache, disclosure).Gaps:
make has-localterrafailed).Worktree:
c660a902-c794-48f8-9df5-0b9330f1ac71checked out atorigin/main(28207c0e); no additional commits pushed (implementation already on protected main).Implement re-check (job 164a2e8e)
No related open PR. Open pulls are renovate digest bumps only (#1312, #1313). Head
issue/1255is already merged here. No new branch or sibling PR.Re-ran
make verify-issue-1255onorigin/main(0d6eaeee): 5/5 steps, 71 Vitest.Covered (Q1255-1–Q1255-8): Swap and Trade market execute scale via
resolveSwapAssetDecimals/useAssetDecimals. Unknown CW20 isnull. Precedence is registry, then valid LCDtoken_info(beats a stale indexer 6), then indexer while LCD is in flight or transport-failed. Hostile LCD stays unresolved. LCD decimals only for pickergetAllTokensids. Cache keycl8y-dex-token-info-v2. Max/balance use the same scale.getDecimalsstill defaults unknown chrome to 6.Gap: Manual LocalTerra 18-dec unlisted factory pair on
/was not run.make has-localterrareports the chain is not running, and this job does not deploy. That leftover stays the manual item already noted on this PR.No runtime incident, so log reads were not used.
Implement re-check (gate-impl)
No related open PR. Open pulls are renovate digest bumps only (#1312, #1313). Head
issue/1255is already merged in this pull. No new branch, commit, or sibling PR.Re-ran
make verify-issue-1255onorigin/main(0d6eaeee): 5/5 steps, 71 Vitest.Covered (Q1255-1–Q1255-8): Swap
/and Trade market execute scale viaresolveSwapAssetDecimals/useAssetDecimals. Unknown CW20 isnull. Precedence is registry, then valid LCDtoken_info(beats a stale indexer 6), then indexer while LCD is in flight or transport-failed. Hostile LCD stays unresolved. LCD decimals only for pickergetAllTokensids. Cache keycl8y-dex-token-info-v2. Max/balance use the same scale.getDecimalsstill defaults unknown chrome to 6.Gap: Manual LocalTerra 18-dec unlisted factory pair on
/was not run.make has-localterrareports the chain is not running, and this job does not deploy. That leftover stays the unchecked manual item on this PR.No runtime incident, so log reads were not used.