ops(wrap-mapper): mainnet migrate + SetFees 200/51 and DEX #516 Coolify rollout #13
Labels
No labels
bug
docs
documentation
duplicate
enhancement
frontend
good first issue
help wanted
invalid
missing-implementation
priority
medium
product
QA
question
testing
UX
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/ustr-cmm#13
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
Finish the bundled #9 / DEX #516 mainnet rollout: store+migrate wrap-mapper to cw2
0.3.0, gov-setfee_wrap_bps=200/fee_unwrap_bps=51, run tiny live wrap/unwrap probes, then ship cl8y-dex-terraclassic#516 + Coolify frontend redeploy so unwrap user all-in is ≈2% (no InstantWithdraw gross-up).Upstream code is done. #9 closed after MR !31 (
origin/master1939449). This issue tracks human ops + consumer release only.Companion: cl8y-dex-terraclassic#516 (open, no MR as of 2026-08-15). Disclosure from DEX #512 stays.
Related: wrap-mapper
terra1xuuuhpmyd5t29ry7mydg7ra2q2phrwhx7j28nx7x9sjw6zznkumsz0nmd2, skillskills/wrap-mapper-asymmetric-fees, runbook docs/DEPLOYMENT.md § asymmetric fees.Current codebase / live state (verified 2026-08-15)
On-chain (columbus-5)
11565(pre-#9)0.3.0Config{ fee_bps: 200 }{ fee_wrap_bps: 200, fee_unwrap_bps: 51 }— nofee_bpsterra1xsecn4snv94ezcez0z3vq8an9j4h4kxxcydp8lfalseConfigmigrate is breaking. Live DEX still types/readsfee_bpsonly (frontend-dapp/src/services/terraclassic/wrapMapper.ts). Migrating before a #516 Coolify deploy will fail-close Wrap/Swap quotes.Repos
PlasticDigits2/ustr-cmmorigin/masterPlasticDigits/cl8y-dex-terraclassicWhy this is needed
SetFees/probes were explicitly out of that MR.fee_bps.Constraints / guardrails
store/migrate/SetFees). Provide exact msgs only; humancl8y2_adminsigns.fee_bps=200→ 200/200. Never leave unwrap at 200 after advertising the fix —SetFees200/51 immediately after.ConfigResponse).terra1xsecn…); not DEX factory multisig.fee_bps(different contract).--gas auto --gas-prices 28.325uluna(store adj 1.5, migrate/execute adj 1.4). Fixed--fees 100000000ulunais insufficient for wasm store.Relevant files
ustr-cmm (ops / already on
origin/master)contracts/contracts/wrap-mapper/0.3.0asymmetric fees + migratedocs/DEPLOYMENT.mdset_feesJSONdocs/CONTRACTS.mdskills/wrap-mapper-asymmetric-fees/SKILL.mdcontracts/scripts/treasury-migrate-wrap-20260808-090524.json11565)cl8y-dex-terraclassic (#516 — not started)
frontend-dapp/src/services/terraclassic/wrapMapper.tsqueryWrapMapperConfigstillfee_bpsfrontend-dapp/src/services/terraclassic/router.tsfrontend-dapp/src/pages/WrapPage.tsx,SwapPage.tsxfrontend-dapp/src/utils/poolProvideCounterpart.tsskills/AGENTS_WRAP_UNWRAP_BURN_TAX.mddocs/qa-templates/wrap-unwrap-test-pass.mdscripts/check-ust1-wrap-ops-health.sh,deployments/mainnet-ust1-wrap/REGISTRY.mdfee_bps=200Recommended direction
Order matters (breaking ABI):
fee_wrap_bps/fee_unwrap_bpsand fails closed on legacy-only JSON.origin/master.terra1xuuuh…nmd2with{}.Config {}: expectfee_wrap_bps=200,fee_unwrap_bps=51.uluna/cLUNC anduusd/cUSTC); record tx hashes; confirm treasury native ≥ CW20 supply.Retune rule (already documented; do not invent a new one)
burn_tax_rate=0.015→ 51. Prefer ≤ 2% all-in when rounding. If tax ≥ ~2%, escalate — cannot hit 2% all-in without subsidy/gross-up.Acceptance criteria
fee_bps.11565; cw20.3.0.Config {}on columbus-5:fee_wrap_bps=200,fee_unwrap_bps=51(nofee_bps).uluna≥ cLUNC supply anduusd≥ cUSTC supply.docs/DEPLOYMENT.md/docs/CONTRACTS.md/ README code ID + fee table updated from “pending #9” to the new code ID + 200/51.Test plan (all paths)
Pre-broadcast (read-only / CI)
cd contracts && cargo test --package wrap-mapper --libgreen on the wasm that will be stored.Mainnet ops (human)
SetFees: config is 200/200 (legacy map). Do not stop here.SetFees: config 200/51.DEX / Coolify
wrap_input/unwrap_output/ both.Test plan (attack / hack / abuse)
SetFees*— non-gov rejected (already unit-tested; confirm live admin is stillterra1xsecn…).SetFeesin the same window; do not announce until 51 is live.fee_bpsundefined → 0.fee_unwrap=51<< tax does not erodenative ≥ supply(surplus ≈ +unwrap fee). Confirm after live probes.Verification criteria
fee_wrap_bps=200,fee_unwrap_bps=51on columbus-511565; documenteduluna/uusd≥ cLUNC/cUSTC supply after probesDone when live fees are 200/51, probes recorded, Coolify matches chain, and DEX #516 is closed.
marked as related to #9
mentioned in issue #9
mentioned in issue PlasticDigits/cl8y-dex-terraclassic#516
mentioned in issue PlasticDigits/cl8y-dex-terraclassic#521
mentioned in merge request PlasticDigits/cl8y-dex-terraclassic!358
mentioned in issue PlasticDigits/cl8y-dex-terraclassic#523
mentioned in merge request PlasticDigits/cl8y-dex-terraclassic!360
On-chain (#13 store / migrate / SetFees) — verified 2026-08-15
Both operator txs code 0. Live wrap-mapper
terra1xuuuh…nmd2:11574(was11565)0.2.1→0.3.0(from_legacy_fee_bps=true, migrate mapped 200/200)Configfee_wrap_bps=200,fee_unwrap_bps=51(nofee_bps)false/terra1xsecn…)299587949B305800…DA40{}299588098F05225E…D107SetFees200/5129958810740CB152…BDF3Docs updated in-repo (DEPLOYMENT / CONTRACTS / README / skill / artifact JSON). Still open on this issue: tiny wrap/unwrap probes, Coolify #516 rebuild, DEX router
fee_bpsupgrade if unwrap_output is still live.Related-issue sweep (2026-08-15) — not closing
Re-queried columbus-5 wrap-mapper
terra1xuuuh…nmd2: code11574,Config { fee_wrap_bps: 200, fee_unwrap_bps: 51 }(nofee_bps). Store / migrate /SetFeestxs in the previous note.This issue’s AC
11565; cw20.3.011574Config200/51, nofee_bpsorigin/masteryet)Related
fee_bps, so liveunwrap_outputcan revert until router 1.1.0 is on-chainKeep open until probes + Coolify (+ router migrate on #523) are done. Do not announce ≈2% unwrap until those land.
mentioned in commit
e7a26f2ba2Status refresh — DEX companions + Coolify (2026-08-15)
Operator: DEX frontend has been redeployed. Re-queried chain:
11574,{ fee_wrap_bps: 200, fee_unwrap_bps: 51 }, not paused11576(was11507; #523 store+migrate done)DEX issues connected to this one
unwrap_outputstill called out there.Still open on this issue (ustr-cmm)
uluna/cLUNC,uusd/cUSTC); record hashesuluna≥ cLUNC supply anduusd≥ cUSTC supply/wrap+ Swap wrap_input/unwrap_output quote smoke vs LCD (DEX, now that Coolify is up)Docs for
11574/ 200/51 are onorigin/master. No further ustr-cmm contract work. Do not close until probes are recorded.LUNC probes recorded (2026-08-15) — USTC still open
Wallet
terra1hu4zggf3f8yw6jw3rxrjxn2drwad675gq5k2lv(cl8ydeploy). Both txs code 0. Localbalafter each broadcast raced inclusion (--broadcast-mode sync); on-chain events are the source of truth. Wallet now holds 0 cLUNC / 0 cUSTC.Wrap
uluna10 000 → cLUNC 9 800C5DDA278…93B729959037wrap_deposit10000 → mappernotify_depositfee=200fee_wrap_bps=200→ cLUNCmint9800Pass (wrap receive/A = 0.98).
Unwrap cLUNC 9 800 (the mint, not 10 000)
58FEE7CE…852629959038unwrapfee=49fee_unwrap_bps=51→ burn 9800 →InstantWithdraw9751 → user received 9605 ulunaMath:
9800 × 51 / 10_000 = 49→ withdraw9751; taxfloor(9751 × 0.015) = 146;9751 − 146 = 9605. All-in9605/9800 ≈ 0.9801(in [0.979, 0.981]). Not the old 200 bps path (10 000 → 9 653).AC example unwrap 10 000 → ~9 800 was not this size; 9 800-in is still a valid 51 bps proof. Optional follow-up: unwrap 10 000 for the exact 9 799–9 800 number.
Solvency (after these txs)
uluna73695651617957220551050316uusd41103185380797208967371886Still open
uusd/ cUSTC (same sizes, record hashes)/wrapquote smoke vs LCD (Coolify already redeployed)Do not close until cUSTC probes are on-chain.
cUSTC is fine, closing