fix: /pool Manage provide uses token name (symbol) and defaults auto-wrap on #661
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#661
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
On
/pool→ Manage → Advanced, two-sided Provide Liquidity still labels the amount fields Asset A / Asset B (CSSuppercasepaints them as ASSET A AMOUNT / ASSET B AMOUNT). Those fields must show the pair-leg name (symbol) instead. On wrap-equivalent legs (cLUNC / cUSTC), Use native … (auto-wrap) is unchecked (useState(false)). Auto-wrap must default on when a native equivalent exists.Bundle labels + auto-wrap default in one issue. Same component, same tests, same wrap execute path. Do not split “rename the label” vs “flip the checkbox default.”
Related: #547 (Manage expand + Advanced), #533 (retail one-sided — out of scope), #630 (LUNC/USTC/cLUNC/cUSTC tickers), #489 (short labels), #480 (counterpart auto-fill), #147 (CW20 vs wrap gas), #512 / #516 (wrap fee net), #201 (wrap-pool E2E).
Current codebase
/poolretail add/withdraw is one-sided (OneSidedAddCard/OneSidedWithdrawCard). Two-sided provide/withdraw lives under table Manage →PoolAdvancedManage→<details data-testid="pool-card-advanced">(Provide Liquidity / Withdraw Liquidity). LCDgetPool/getPairFeeConfigrun only on expand (P547-9 / A8).PoolAdvancedManage.tsxhard-codes visibleAsset A Amount/Asset B Amountplus anormal-caseparenthetical({displayA.displayLabel}). Inputs usearia-label="Asset A amount"/"Asset B amount"..label-glassisuppercase tracking-wide, so the user sees ASSET A AMOUNT (cLUNC).useTokenDisplayInfo(pair.asset_infos[0|1])(displayLabel+symbol). Registry product tickers beat indexer/on-chain text (N630-1–N630-4).tokenRegistry.tsalso hasname(Terra Luna Classic,Wrapped Luna Classic, …) butuseTokenDisplayInfodoes not exposename—displayLabel === symbol.useNativeA/useNativeBinitialize tofalse. Checkbox Use native {LUNC|USTC} (auto-wrap) renders only whengetNativeEquivalent(tokenId)is set (cLUNC →uluna, cUSTC →uusd). Checked → balance query switches to native denom; execute is wrap_deposit + allowances +provide_liquidity(executeTerraContractMulti). Unchecked → CW20 balances + three sequential txs (gas gate #147).displayA.displayLabel/ native ticker when unwrap is on.receiveWrappeddefaultstrue(keep wrapped). That is not the provide auto-wrap checkbox.provideRawAdd*). Max/50%forceSync. Empty pool: no auto-fill.wrapProvideBlockedwhen mapper address set and config missing or treasury ≠ env. Pause / code-id freeze / blacklist still disable CTAs.PoolPage.test.tsxusesgetByLabelText('Asset A amount')/'Asset B amount'throughout.e2e/pool.spec.tsande2e/pool-lp-howto-531.spec.tsmatch/Asset A|Amount/i.e2e/wrap-pool.spec.tsE7 clicks auto-wrap to enable; E8 fills amounts without clicking (assumes wrap off). Those invert if the default flips.docs/frontend.md§ pool still says “editing Asset A or B”.docs/design-system.mdglossary: “Use native LUNC (auto-wrap)”.skills/AGENTS_FRONTEND_POOL_PROVIDE_WITHDRAW_PREVIEW.mdsame Asset A/B wording.Why this is needed
asset_infos[0]).#489forbidstoken0/ generic slot names. The pair header already showsTokenDisplaysymbols; the amount fields must match.useTokenDisplayInfo+ registryname/symbolexist. The UI ignores them and prints Asset A/B.Constraints / guardrails
OneSidedAddCard/OneSidedWithdrawCard). No wrap checkbox there (Z533-1 / Z533-2).uluna/uusdis LUNC / USTC; wrap CW20s stay cLUNC / cUSTC (N630-1–N630-2). Execute / React Query ids stayuluna/uusd/ CW20 address (N630-3). Registry wins over indexer spoof (N630-4). Unknown natives fail closed as raw denom (N630-5).NAME (SYMBOL)without redundancy or essays. Prefer{registry-or-indexer name} ({product symbol})when name is distinct and short (≤ ~5 words, #489). Collapse to{symbol}when name is missing, equals the symbol, or is a long/HTML/spoofed indexer string. NevercLUNC (cLUNC). Neveruluna/uusdas the visible name..label-glassisuppercase. A rawcLUNCin that class becomes CLUNC. Keep tickers in anormal-case(or non-label-glass) node. Mixed-case product tickers must survive CSS.getNativeEquivalentis non-null. Non-wrap pairs (UST1/USTR, CL8Y/UST1, gems) must not show the checkbox and must not take the wrap execute path.localStoragefor wrap preference. Uncheck is session-only until remount.receiveWrapped. Report is provide auto-wrap. Withdraw stays default receive wrapped unless a later issue says otherwise. Do not unwrap the rest of the wallet (Z533-8).0/ Exceeds wallet. Uncheck → CW20 balance +#147gas gate. If mapper config is missing or treasury mismatches,wrapProvideBlockedmust not trap the user — uncheck must restore the CW20 CTA (subject to other gates)./poolpaint (A8). Labels use data already on the expanded Manage instance (useTokenDisplayInfo/ registry). Do not add per-row LCD for names.name/symbolare text only. NodangerouslySetInnerHTML. Registry allowlist still wins for known natives/wraps.Relevant files
frontend-dapp/src/components/pool/PoolAdvancedManage.tsxuseNativeA/useNativeBdefaults, aria-labels, wrap executefrontend-dapp/src/hooks/useTokenDisplayInfo.tsdisplayLabel/symbol; extend only ifnameis neededfrontend-dapp/src/utils/tokenRegistry.tsname+registryProductSymbolfrontend-dapp/src/utils/tokenDisplay.tsgetTokenDisplaySymbolfrontend-dapp/src/types/index.tsgetNativeEquivalent/WRAPPED_NATIVE_PAIRSfrontend-dapp/src/pages/PoolPage.test.tsxAsset A amountfrontend-dapp/e2e/pool.spec.ts/Asset A|Amount/ifrontend-dapp/e2e/pool-lp-howto-531.spec.tsfrontend-dapp/e2e/wrap-pool.spec.tsfrontend-dapp/e2e/helpers/wrap-e2e.tsrequirePoolCardWithNativeWrapdocs/frontend.mddocs/design-system.mdskills/AGENTS_FRONTEND_POOL_PROVIDE_WITHDRAW_PREVIEW.mdscripts/qa/verify-issue-NNN.sh+Makefilemake verify-issue-NNNRecommended direction
tokenDisplay/useTokenDisplayInfo, not inline JSX):formatPoolAssetFieldLabel({ name, symbol })→Name (SYMBOL)orSYMBOL. Registry name/symbol first; indexer name only if it passes a short allowlist (no HTML, nouluna/uusdas name).aria-label: use that helper on the selectedAssetInfo(balanceInfoA/balanceInfoB, which already flip with wrap). Example: wrap on →Terra Luna Classic (LUNC)/ ariaLUNC amount; wrap off →Wrapped Luna Classic (cLUNC)/ ariacLUNC amount. Drop everyAsset A/Asset Bstring from UI, aria, and tests.useState(() => !!getNativeEquivalent(assetInfoLabel(pair.asset_infos[0])))(same for B). Do notuseEffectto flip after first paint (avoids balance flash / counterpart recalc)./LUNC amount/ion wrap-capable fixtures). Wrap-capable fixture: assert checkbox checked and native balance query key. Uncheck → CW20 key.wrap-poolE7: assert checked, do not click (click would turn wrap off). E8: uncheck before CW20 provide.make verify-issue-NNN(Vitest + grep noAsset A amountinPoolAdvancedManage+ wrap-default unit). Playwright smoke optional; tx E7/E8 when LocalTerra wrap pairs exist.Do not default both wrap checkboxes on for a pair with only one wrap leg. Do not send native coins into the pair contract.
Acceptance criteria
{Name} ({SYMBOL})or{SYMBOL}for each leg. NoAsset A/Asset B/ASSET A/ASSET Bin the provide form (including uppercase CSS).aria-labelon the two amount inputs uses the selected product ticker (LUNC amount,cLUNC amount,UST1 amount, …), notAsset A amount.uluna/uusdas the visible label.UST1 (UST1)).#147gas gate; label shows CW20 name/symbol.receiveWrappeddefault unchanged.make verify-issue-NNNland with the implementation.PoolPage.test.tsx/ e2e selectors updated.Test plan (all paths)
Labels
UST1/USTRorName (UST1)— not Asset A/Bulunaon wrap CW20ulunaUST1only.label-glasscLUNC/LUNC, notCLUNCforced by CSSAuto-wrap default
tokenBalancequery key usesuluna/uusd; Max usesprovide_liquidity_native_sidereserve#147gas gate can appear; wrap multi-msg not builtWrap config unavailable/misconfigured); uncheck re-enables CW20 path if other gates passE2E / LocalTerra
PLAYWRIGHT_SKIP_CHAIN=1/poolManage provideAsset A/Asset Btext; wrap pair checkbox checkedwrap-poolE7wrap-poolE8Test plan (attack, hack, abuse)
name/symbol=<img onerror=…>/javascript:LUNCorulunauluna/uusdonly; never sends native into the pair; pair still receives CW20 net-of-feenativeWrapDepositCount === 2; Max gas reserve covers both deposits; still one multi-msg/pooltable paint still does notgetPoolper rowaria-labelis our product ticker, not raw indexer HTML?wrap=1forcing wrap on non-wrap pairgetNativeEquivalentUse native LUNC (auto-wrap)Verification criteria
Ship is done when all of the following hold:
make verify-issue-NNN(new) is green: Vitest PoolPage / token label helper / wrap-default init; static grep thatPoolAdvancedManage.tsxhas noAsset A/Asset B/Asset A amountstrings.make test-frontendscoped files above stay green. Existing#480counterpart tests still pass with wrap default on (or fixtures explicitly uncheck).e2e/pool.spec.tsandpool-lp-howto-531.spec.tsno longer requireAsset A.wrap-poolE7/E8 match the new default (E7 no click-to-enable; E8 unchecks)./poolManage on a cLUNC pair: first paint shows LUNC (orTerra Luna Classic (LUNC)), wrap checked; uncheck shows cLUNC; UST1/USTR pair never shows wrap chrome and never says Asset A/B.docs/frontend.mdpool provide (drop “Asset A or B”; document wrap default on),docs/design-system.mdif glossary needs “defaults on”,skills/AGENTS_FRONTEND_POOL_PROVIDE_WITHDRAW_PREVIEW.mdsame.AGENTS.mdverify one-liner if that is house style.#533/#547/#630invariants unchanged.Out of scope: one-sided zap UI, withdraw auto-unwrap default, pair/router wasm, wrap-mapper fee bps,
/pooltable columns (#655), persisting wrap preference.mentioned in commit
6f74c2ce97mentioned in merge request !1161
mentioned in commit
fe0ff4bf63mentioned in commit
7c5e693383Merged to
mainvia !1161, then stacked under !1175 (#660 four-tab Manage). Provide still uses name/symbol labels and wrap default on; there is nopool-card-advanceddisclosure anymore.Leftover:
/poolManage → Provide Liquidity: no Asset A/B; wrap checkboxes default on for cLUNC/cUSTC.make verify-issue-661(and #660).mentioned in issue #660
mentioned in issue #673