feat: mainnet wrap env + Swap wrap UX (cLUNC/cUSTC, 1% fee) #507
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#507
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
Enable mainnet native wrap/unwrap on the live DEX by wiring Coolify/
VITE_*wrap env to published Phase 3 addresses and ensuring Swap (and pool auto-wrap paths) show correct cLUNC / cUSTC UX — including on-chain 1% (fee_bps=100) fee display, pause/rate-limit safety CTAs, and token metadata/logos.Parent track: #502 (Phase 4).
Upstream: ustr-cmm#5 closed; router
SetWrapMapperalready live (see #502 note).Published mainnet addresses (Phase 3 + router wiring)
terra16j5u6ey7a84g40sr3gd94nzg5w5fm45046k9s2347qhfpwm5fr6sem3lr2terra1xuuuhpmyd5t29ry7mydg7ra2q2phrwhx7j28nx7x9sjw6zznkumsz0nmd2(code 11565)terra1437qslye72t7qmmahn4t5chz50r8a62g45phwkquwpyu2l62u6ksqssgdgterra1nap4dxh9tv35v0ynd9m4k6zt6c0dq6weszc4j5m564kjls56hu7qcr56chterra1e7s0h9ftxakwca5gxspyt4haeuaqxds6swr08ul3tsepq7el924sprrsrwApproved wrap fee:
fee_bps=100(1%). Product symbols: cLUNC / cUSTC (notLUNC-C/USTC-C).Current codebase
deploy-dex-local.shPhase 1b/4c, routerSetWrapMapper, frontend wrap/swap/poolfrontend-dapp/src/services/terraclassic/wrapMapper.ts— wrap/unwrap, pause, rate-limitVITE_WRAP_MAPPER_ADDRESS,VITE_TREASURY_ADDRESS,VITE_LUNC_C_TOKEN_ADDRESS,VITE_USTC_C_TOKEN_ADDRESS→constants.tsNATIVE_WRAPPED_PAIRSfrontend.env.exampleomit wrap envs (SL5 CW20-only)wrap_mapperset post-SL5 (#502) — dApp env still missingsimulateNativeSwapdoes not apply mapperfee_bps; LocalTerra mapper historically 50 bpsLUNC_C/USTC_C; product requires cLUNC / cUSTC displayAGENTS_FRONTEND_SWAP_SAFETY_CTA.md)Why this is needed
Router↔wrap-mapper is connected on columbus-5, but production Coolify has no wrap
VITE_*, so Swap cannot offer LUNC/USTC wrap paths. Soft launch explicitly excluded wrap (SL5); this is the post–soft-launch enablement. Users need treasury-backed wrap to trade natives via CW20 markets, with fee/pause/rate-limit honesty matching chain state. Without this, Phase 3 contracts stay invisible atdex.cl8y.com.Constraints / guardrails
wrap_mapperis set (done) — do not invent a second wrap path.VITE_TREASURY_ADDRESSmust be ustr-cmm CMM treasuryterra16j5u6…, not factory fee treasury / governance multisigterra1zlmv2….VITE_LUNC_C_*for compatibility.Config.fee_bps(expect 100); do not claim fee-free 1:1 if fee applies.AssetInfopairs).AGENTS_NATIVE_WRAP_TAX.md); unwrapminimum_receivepost-fee (AGENTS_ROUTER_MINIMUM_RECEIVE.md).Relevant files
Frontend
frontend-dapp/src/utils/constants.ts(NATIVE_WRAPPED_PAIRS, wrap token envs)frontend-dapp/src/services/terraclassic/wrapMapper.ts,router.tsfrontend-dapp/src/pages/SwapPage.tsx,PoolPage.tsxfrontend-dapp/src/utils/tokenRegistry.ts,tokenLogoAllowlist.tstokenlist/(cLUNC / cUSTC logos + list rows)Deploy / docs
docker/frontendexamplesscripts/lib/mainnet-soft-launch-defaults.sh(do not silently add economic wraps to SL defaults)docs/runbooks/mainnet-soft-launch.md(SL5 post-enablement note)NATIVE_TOKEN_WRAPPING.mddeployments/mainnet-soft-launch/addresses.env,deploy-trace.mddocs/qa-templates/wrap-unwrap-test-pass.mdSkills
skills/AGENTS_FRONTEND_SWAP_SAFETY_CTA.mdskills/AGENTS_NATIVE_WRAP_TAX.mdskills/AGENTS_ROUTER_MINIMUM_RECEIVE.mdskills/AGENTS_FRONTEND_COPY_COGNITIVE_LOAD.mdRecommended direction
VITE_WRAP_MAPPER_ADDRESS,VITE_TREASURY_ADDRESS,VITE_LUNC_C_TOKEN_ADDRESS,VITE_USTC_C_TOKEN_ADDRESSto the table above; rebuild frontend.fee_bps; show 1% (or live bps) on direct wrap/unwrap; fix simulate/receive preview so users are not shown false 1:1 when fee applies.logo_urlfor cLUNC/cUSTC after allowlist review.Acceptance criteria
VITE_*pointing at columbus-5 addresses above.make lint-frontend/make test-frontendgreen for changed code.Test plan (happy / functional paths)
NATIVE_WRAPPED_PAIRSpopulated only when both sides set; fee_bps formatting (100 → 1%).wrap-swap.spec.ts/wrap-pool.spec.tsstill pass.docs/qa-templates/wrap-unwrap-test-pass.md— wrap small LUNC→cLUNC, unwrap back; same for USTC/cUSTC; confirm fee skim matchesfee_bps.Test plan (attack / hack / abuse vectors)
terra16j5u6…minimum_receiveignore on unwrap_outputfee_bps=100NATIVE_WRAPPED_PAIRSonly; chain mapping authoritativeVerification criteria
fee_bps=100; routerconfig.wrap_mappermatches env.Related
/ust1UI; secondary AMM pair / waivermarked as related to #502
mentioned in issue #502
mentioned in commit
3681e8b548mentioned in merge request !1044
Implementation MR: !1044 (
feat/507-mainnet-wrap-ux)In-repo ACs done: fee_bps-aware wrap sim/execute + UI notes, cLUNC/cUSTC display, pool auto-wrap fee nets, SL5 docs + Coolify template (
wrap-enablement.env.example), skills playbookAGENTS_MAINNET_WRAP_ENABLEMENT.md.Still ops: set Coolify wrap
VITE_*, rebuild, mainnet wrap/unwrap smoke txs, record hashes.mentioned in commit
a2f5747810Merge sanity check (MR !1044 → main)
Verdict: In-repo work for #507 is mergeable. Tip
a2f5747addresses the earlier fail-open review findings (config/pause/rate-limit/treasury gates).Remaining problems / open items (not merge blockers for code)
VITE_*fromdeployments/mainnet-soft-launch/wrap-enablement.env.example, rebuild, mainnet wrap/unwrap smoke + tx hashes, LCDfee_bps=100confirmation,VITE_TREASURY_ADDRESS= CMM treasury.SwapPageisFetched-only fail-closed). Prefer also blocking onisLoadingfor wrap-active routes.cargo-audit-indexeron pre-existing RustSec warnings (event-listener,scc, yankedspin) — unrelated to this frontend/docs MR.mainpipelines are similarly red on audit jobs.Targeted local checks green: wrapMapper/router/tokenRegistry/pool fee suites,
make test-mainnet-soft-launch-defaults,make lint-frontend.mentioned in commit
8fa03d6f06mentioned in commit
12be42cecdmentioned in commit
7d43b49356MR !1044 merged to
main(8fa03d6). Issue auto-closed viaCloses #507.Keep ops checklist open in #502 / Coolify follow-up: four wrap
VITE_*, rebuild, mainnet wrap/unwrap smoke txs +fee_bps=100confirmation. In-repo code is onmain; production enablement is still required.mentioned in commit
2557c3346amentioned in commit
ea275efc51mentioned in commit
ba2e84624cmentioned in issue #503
mentioned in merge request !1048
mentioned in issue #531
mentioned in issue #533
mentioned in issue #587
marked as related to #587
mentioned in issue #599
mentioned in issue #630