feat(#508): UST1 secondary AMM Path A tooling and Path B waiver #1046
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!1046
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/508-ust1-secondary-amm"
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
scripts/add-ust1-secondary-pair.sh, LocalTerra fixture, defaults lib) without folding UST1 into soft-launch gemstone catalogs (U6).skills/AGENTS_UST1_SECONDARY_AMM.md, and an interim Path B product waiver because columbus-5 UST1total_supplyis 0 / deployer has no seed inventory.make verify-issue-508covers docs, DRY_RUN preflight, unit tests, and optional LocalTerra seed.Test plan
make verify-issue-508(twice)VERIFY508_LOCAL=1 make verify-issue-508(LocalTerra stand-in pair seeded,total_share > 0)DRY_RUN=1 ./scripts/add-ust1-secondary-pair.sh(mainnet LCD preflight; reports inventory block)./scripts/add-ust1-secondary-pair.sh+ smoke swap; setVERIFY508_MAINNET=1Closes #508 via Path B interim waiver + Path A readiness (live mainnet seed remains ops follow-up when inventory exists).
RECOMMEND: FIX
Thorough review of !1046 (
feat/508-ust1-secondary-amm→main, closes #508 via Path B + Path A tooling). Scope is ops/docs/frontend copy helpers — no smart-contract, indexer, or DB schema changes.Verdict
Path B acceptance for #508/#502 is substantively met (waiver in-repo + comments on both issues), and Path A scripts are mostly well-shaped. Merge should wait on a short FIX pass: incorrect Trade/Swap deep-link helpers (tests lock in the wrong shape), mainnet ops footguns that can recreate the empty-market failure mode the waiver exists to prevent, and a missing on-chain symbol assertion before live create/seed.
Not BLOCK: no critical/high vulns, no prompt injection, no privilege escalation, no DB leak surface introduced.
Linked issue AC (#508 / parent #502)
deployments/ust1-secondary-pair/PRODUCT_WAIVER.md+ GitLab comments on #508 and #502 (2026-08-08) with rationale, deferred scope, revisit triggerdeploy-trace.md/ust1mint/redeemcopyImpliesAmmIsMintRedeemtests;/ust1CTA wiring correctly deferred to #506U1–U7: U2–U7 covered by scripts/docs/verify. U1 partial — Create Pair only;
UST1_SECONDARY_MARKET_BLURBunused until #506.Local check:
make verify-issue-508→ 9 PASS / 0 FAIL (mainnet DRY_RUN: code 10184, balances 0, no pair — inventory block expected).Security audit
Attack surface triage (this MR)
cl8ydeploy+ address hard-check (add-ust1-secondary-pair.sh);create_pairremains permissionless on-chain (pre-existing)jq --arg, quoted"$@", keyring via stdin; passphrase not written toaddresses.env/ust1primaryFindings (severity-ranked)
token_infonon-empty +code_id==10184but never asserts on-chainsymbolmatches expected leg. Env override to another whitelisted 10184 CW20 still labels pairUST1/vFDUSDin logs/trace.scripts/add-ust1-secondary-pair.sh~126–136UST1_SEC_SKIP_LP=1can create an unseeded factory pair on columbus-5 — the exact empty/misleading market Path B was written to avoid. Documented “discouraged” but still allowed live.scripts/add-ust1-secondary-pair.shL7–8, L163–170, L216+set_discount_registryfailure swallowed (|| true) — post-governance deployer may silently leave pair without fee-discount registry.scripts/add-ust1-secondary-pair.sh~211ust1SecondaryMarket.tsvsust1-secondary-pair-defaults.shtest-frontendred on pipeline 2743658160 — failures are unrelated files (SwapPage,useTerraBroadcastMutation,formatAmount,lcdConnectivity,PriceChart,LcdQueryGate,WalletIndexerHistoryPanel). MR-added tests passed in that job. Still blocks green merge gate.Gap analysis
Must-fix before merge (FIX)
ust1SecondaryTradePathbuilds/trade?from=&to=&market=secondary, but app routes are/tradeand/trade/:pairAddr(App.tsx,tradePairRoute.ts).market=secondaryhas no consumer. Swap helper/?from=&to=is also unused by SwapPage. Unit tests currently lock in the wrong shape. Align to/trade/${pairAddr}(viaVITE_UST1_SECONDARY_PAIR_ADDRESS/ indexer id) or mark helpers unfinished and stop asserting fake query params until #506 wires CTAs.UST1_SEC_SKIP_LP=1on mainnet (require explicit override likeUST1_SEC_ALLOW_UNSEEDED=1+ loud abort), matching issue guardrail / U4 / Path B rationale.UST1/vFDUSD/cUSTC) before create/seed.Should-fix / follow-ups (non-blocking for Path B intent, preferred same MR)
set_discount_registryas hard error or document that governance multisig must run it after handoff (do not|| truesilently).VITE_UST1_SECONDARY_PAIR_ADDRESSwhen appending Vite hints.make verify-issue-508to a lightweight CI job (docs/qa) so U1–U7 / U6 regression does not rely on local-only runs./ust1(#506) — do not leave dead “ready” helpers that #506 will copy incorrectly.Features users might expect (deferred / out of scope — OK if documented)
/ust1secondary-market CTAVERIFY508_LOCAL=1ust1-secondary-pair-defaults.sh; TS/bash anchor duplication acceptable with sync noteTesting matrix vs issue attack table
uusd/ulunalegsVERIFY508_LOCAL=1(not default CI)Packages / readability / best practices
set -euo pipefail, shared defaults, idempotent LocalTerra fixture (fd91ae6) — solid.Required FIX checklist
/trade/:pairAddr(and real Swap deep-link behavior)SKIP_LP)add-ust1-secondary-pair.shpreflightset_discount_registryfailure handlingmake verify-issue-508; note CItest-frontendunrelated failures separately if still red onmainAfter the above, Path B close of #508 looks merge-ready; Path A live seed remains ops follow-up when
total_supply(UST1) > 0and wallet inventory exists (VERIFY508_MAINNET=1+ smoke).added 1 commit
a1e97c29- fix(#508): harden Path A guards and Trade deep-link helpersCompare with previous version
mentioned in issue #508
added 8 commits
main7d43b493- merge(main): integrate #506/#507 into #508 branchCompare with previous version
mentioned in commit
2bc31e4522