feat(community-tax): one-click free migrate onto 11619 for listed templates + Terraport/GDEX LP gate #626
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#626
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?
Parent / related
Design record #603 (S1–S5; this ticket is the implementation follow-up). Template #592 / store+list #601. Create Token #593. Catalog #594. F6 pin #582. Router hops #607 (improved option 2). ALPHA wrap vs drop #558 — this ticket does not replace POL wrap.
Product notes on #603 (2026-08-23 / 2026-08-24): already-whitelisted templates migrate for free on a one-button page; custom paths may be needed for 8266 and 8654; in-place migrate must not break Terraport / GDEX LP.
Current codebase
There is no
/token/migrateroute.App.tsxhas/token/create,/tokens,/token/:addr/manageonly. Create Token copy says wasm upgrades are CMM-only — you cannot migrate this contract. Manage (C593-8) requires LCDcode_id == VITE_COMMUNITY_TAX_CODE_IDand must not show tax SKUs on 10184 / 8266 / 6036.cl8y-community-tax-token::migrateisMigrateMsg {}+cw2::ensure_from_older_version(…, "crates.io:cl8y-community-tax-token", version). Same-crate bumps only. Foreign cw2 (6036 / 10184 / 8266 / 8654) reverts. NoGetMigrateOrigin.GetLauncherOriginisCONFIG.launcher(set at launcher instantiate). Catalog attest (I594-3) needs LCDcode_id+ CMM admin + launcher-tx +GetLauncherOrigin== env launcher — a rogue or adopted instance without those stays unlisted.Live columbus-5 (2026-08-24):
hop_trader, #604–#609). REPORT GO.[6036, 8266, 10184, 11611, 11619]terra126pr5…code 11622;token_code_id11619crates.io:terraport-token/0.0.0, marketing +balance_at, notax_map)cw20_taxed+tax_map(terra1x6e64…zysuxz). Wasm/tax adminterra1ljqgc0…. Do not whitelist.Factory F6: after a successful adopt to 11619, every CL8Y pair still pinned to the old
code_idfail-closes until governanceRefreshPairAssetCodeIds. Terraport / GDEX pairs are not F6-pinned; they keep the same CW20 address.Paid Create Token SKUs are 50 UST1 invoices (C593-4). Product for this page: free (no invoice). Gas is still LUNC.
Why this is needed
Communities on listed honest templates want to keep the same CW20 address and holder set while moving onto the tax template (Create Token / catalog / extra-debit). Today the only safe product path is a new 11619 instantiate (S1) or a wrap (S2 / #558). That splits tickers and Terraport vs CL8Y venues.
Product: load the token, one button, no 50 UST1. 8266 (Terraport V2) and 8654 (ALPHA) may need custom importer branches. Shipping that button without a written Terraport / GDEX LP impact would let an admin migrate ALPHA (or a widely pooled 8266) and change tax under existing external AMM reserves.
#603 is design-only and must stay the decision record. This ticket ships the page + allowlisted importer after per-source go, with LP impact as a close gate (not a sibling investigation).
Constraints / guardrails
trader. Do not ship Honest-hop copy for new 11619 instances.tax_map/ inbound FoT). Listing 11619 is enough for adopted addresses.terra16j5u6…). Source admin becomes manager only.UpdateAdminin the same migrate tx (or immediately after, same ops bundle). Manager cannot migrate.launcher_tx. Either writeCONFIG.launcherto the official launcher and addGetMigrateOrigin(or equivalent), or keep adopted tokens unlisted until that rule is written.ensure_from_older_versionfor same-crate upgrades. Foreign importer is a new migrate branch with an explicit allowlist.total_supplyand everyBALANCESentry match pre-migrate (or a documented dust rule).tax_map— after adopt,{"tax_map":{}}must fail. Execute paths must not read 8654 tax keys.?payee=(C593-10). Ignore?manager=/?treasury=.IsCodeIdWhitelistedon the sourcecode_id(or a hard allowlist that matches factory: 6036 / 8266 / 10184). Refuse unknown / unlisted / LocalTerra-only ids on columbus-5. 11611 / 11619 are already the tax crate — do not offer “adopt” (same-crate bump is CMM ops).RegisterListedPaira Terraport or GDEX pair. Extra-debit / outbound apply only to CL8Y factory-listed pairs.max_buy+max_sell+max_transfer ≤ 2500. MintControl stays off unless the source already has a minter — then revoke by default (do not silently enable mint).MsgMigrateContractis out of this ticket’s test plan. LocalTerra + multitest only.Relevant files
smartcontracts/contracts/community-tax-token/src/contract.rsmigrate(same-crate only);GetLauncherOriginsmartcontracts/contracts/community-tax-token/src/msg.rsMigrateMsg {}smartcontracts/contracts/community-tax-token/src/state.rsCONFIG/FEATURES/ exemptionssmartcontracts/contracts/community-tax-token/src/tax.rshop_tradersmartcontracts/contracts/factory/src/contract.rsRefreshPairAssetCodeIds/ whitelistfrontend-dapp/src/App.tsx/token/migratefrontend-dapp/src/pages/CreateTokenPage.tsxfrontend-dapp/src/pages/ManageTokenPage.tsxfrontend-dapp/src/components/common/navItems.tsindexer/src/indexer/community_tokens.rsdocs/runbooks/cw20-code-id-ops.mddocs/terraport.mdterra1n75fg…cw20-codeid-audits/codeids/11619/REPORT.mdcw20-codeid-audits/codeids/8266/REPORT.mdcw20-codeid-audits/codeids/8654/README.mdskills/AGENTS_COMMUNITY_TAX_CW20.mdskills/AGENTS_FRONTEND_CREATE_TOKEN.mdskills/AGENTS_CW20_CODE_ID_PIN.mdRecommended direction
One issue, two workstreams (do not split). Page and LP gate ship together; 8654 button stays disabled until S4 is go.
{cw20-base, cw20-mintable}(confirm LCD names), LCD probe notax_map, keepBALANCES/TOKEN_INFO/ allowances, writeCONFIG/FEATURES(defaults: no paid SKUs unless source already has a minter — then revoke), set cw2 to tax crate,UpdateAdmin→ CMM.crates.io:terraport-token. Notax_map. Storage-layout proof vs cw20-base; leftovermarketing_info/balance_atkeys must be unread (or explicitly dropped). Enable the button only after the Terraport/GDEX LP table says 1:1 stay-1:1.tax_map, map 1%/4.5% → sell/buy bps only if combined ≤ 2500, prove every balance 1:1, and publish the ALPHA Terraport/GDEX LP impact. Default remains not supported (S1 new ticker or S2 wrap on #558).Page (retail):
/token/migrate(label Migrate Token, never Create Token / Mint). Same env gate as Create Token (C593-1).ContractInfo.code_id, cw2,token_info,tax_mapprobe, wasm admin, factoryIsCodeIdWhitelisted.tax_map/ already-11619 → no button, short reason./token/:addr/manage(now 11619). Do not auto-inject into Swap (C593-11).Terraport / GDEX LP (required write-up in this ticket, then UI copy):
In-place migrate keeps the CW20 address. External DEX pairs are not CL8Y factory pairs and are not F6-pinned.
RegisterListedPair. Other DEX transfers stay 1:1.tax_map)tax_map. Inbound 1:1 everywhere.Fill this table with LCD-named ALPHA (and at least one 8266) Terraport / GDEX pair addresses, reserve snapshots, and a LocalTerra analogue — not prose only.
Ops bundle after a successful adopt (docs + optional script, not the retail button): whitelist already has 11619 →
SetPairPausedon affected CL8Y pairs →RefreshPairAssetCodeIds(single, not a batch that includes an unlisted other-asset) → smoke extra-debit sell → unpause.Acceptance criteria
/token/migrateexists (env-gated). User pastes a listed-honest token, connects the wasm admin, one click, no 50 UST1. Success leaves the same address on 11619 with CMM admin.tax_map/ decimals outside 6–18 / combined caps > 2500 → revert, balances untouched.docs/contracts-terraclassic.md§ migrate-adopt) with LCD pair examples for ALPHA and at least one 8266. UI confirm repeats the one-line consequence.launcher_tx).make verify-issue-<this>exists (docs + crate + Vitest; LocalTerra paths when chain is up).Test plan (all paths)
No columbus-5 ALPHA migrate.
?payee=/?manager=.migratestill rejects foreign cw2 (8654 / 10184 / 8266 fixtures) until the importer lands; after land, only allowlisted sources pass.MigrateMsg {}for honest upgrades unchanged. Retail page does not offer this.token_info.total_supply+ samplebalanceunchanged;get_configpresent;tax_mapquery errors; inbound Transfer to a CL8Y pair 1:1;ContractInfo.admin == CMM.tax_map/ unknown cw2 / unlisted code_id / mint-cap mismatch / decimals > 18 / connected wallet ≠ wasm admin → no execute / revert; balances untouched.traderwork.Send/ invoice events on the happy path./token/:addr/manageaccepts 11619 and shows tax SKUs; source admin is manager, not wasm admin.Attack / abuse test plan
tax_maptotal_supplyor any balance changes → fail.UpdateAdmintax_mapvs 11619CONFIG; 8266 marketing vsFEATURES. Deserialize garbage / default-zero tax → fail closed.minter: null→ adopt must not set MintControl / minter. 10184 with minter → revoke or explicit map (default revoke)./token/migrate?Verification criteria
AddWhitelistedCodeId 8654.Do not close #603 until its design table is filled or it points here as the decision+impl record.
marked as related to #603
marked as related to #558
marked as related to #592
marked as related to #593
marked as related to #594
marked as related to #601
marked as related to #582
marked as related to #607
mentioned in issue #603
mentioned in commit
9cc595b7e5mentioned in merge request !1136
Implemented in !1136 (
issue/626-community-tax-migrate).Go / no-go (before each button):
crates.io:cw20-base/crates.io:cw20-mintable, notax_mapcrates.io:terraport-token; leftovermarketing_info/balance_atunread; LP table 1:1 stay-1:1Shipped
MigrateMsg { adopt }allowlist +GetMigrateOrigin. Same-crate{}unchanged./token/migrate(env-gated). Tx bundle: migrate +UpdateAdmin→ CMM. No invoice.launcher_txor allowlisted migrate cw2). Never fakelauncher_tx.terra12u7kh…9e7p6, ALPHA/USTCterra1jg2vu…wph, Open/LUNCterra1uxr6m…nypyc. No GDEX factory pin in-repo.make verify-issue-626.Verified locally:
make verify-issue-626(8/8 including retest),make verify-issue-592,make verify-issue-593,make verify-issue-594.Not in this ticket: columbus-5 ALPHA
MsgMigrateContract; S4tax_mapwipe; pair/router wasm; hybrid opt-out;RegisterListedPairof Terraport/GDEX; live LocalTerra P7 F6 / P11 manage smoke (documented + crate/Vitest coverage).#603 stays the design record. #558 stays open for wrap vs drop.
mentioned in issue #558
mentioned in commit
5aef7194c6S4 is now go for the ALPHA instance (follow-up on !1136).
Why it was blocked at first: #626 constraint 14 treated 8654 as inbound FoT (
tax_map/tax_info) until a wipe existed. Listing 8654 is still forbidden (H-01). The product path is: wipe leftovers → land on 11619 (already listed).What the button does now
terra1x6e64…zysuxz(factory whitelist not required — 8654 is not listed).tax_info/tax_map/whale_info(raw + cw-storage-plus). Live 8654 may report cw2crates.io:cw20-base.MsgMigrateContract+MsgUpdateAdmin→ CMM. Same address. Terraport forward becomes 1:1; historical 4.5% skim is not unwound.AddWhitelistedCodeId 8654.make verify-issue-626first pass + retest: 8/8.mentioned in commit
5d94a3e089mentioned in issue #627
marked as related to #627
mentioned in commit
bfc2d29510!1136 merge (no automerge, no CI wait)
Merged !1136 onto
mainasbfc2d295. Source SHA5d94a3e0. Fast-forward:origin/mainwas already the MR base (eb852f4d). No git conflicts. GitLab CI on the MR head failed withci_quota_exceededon every job (same class as !1132–!1135) — not treated as a code defect; did not wait.Acceptance vs landed tip
/token/migrate, free, wasm-admin one-click, CMMUpdateAdminMigrateTokenPage+migrateAdoptCommunityToken)adopt.rs+ multitest)terraport-token; leftover keys unread)AddWhitelistedCodeId 8654launcher_txGetMigrateOrigin+ CMM + launcher origin)make verify-issue-626Problems / leftovers (not merge-blocking)
MigrateMsg {}only. Retail migrate toVITE_COMMUNITY_TAX_CODE_ID=11619will revert until a new community-tax-token store is listed and Coolify/indexer pins move. Listing 11619 covers adopted addresses; do not list 8654.crates.io:cw20-base. Sibling #627 notes 6036 may reportterraswap-token— that would revert on-chain even if the page shows go. Confirm LCD cw2 before the first 6036 adopt.probeHasTaxMaptreats any LCD error as false. Contract still wipes leftovers after migrate; frontend wipe-bps / confirm copy can be wrong on a flake.make verify-issue-601/582were not re-run on this merge.Post-merge ops will be a new leftover issue (same pattern as #624 / #625). Do not reopen this ticket unless a merged invariant is wrong.
mentioned in issue #628
marked as related to #628
Post-merge leftovers tracked on #628 (store new adopt wasm, Coolify/indexer pin, LocalTerra P3/P7/P11, 6036 cw2 confirm). Do not reopen this issue unless a merged M626 invariant is wrong.
mentioned in issue #633
mentioned in issue #634
mentioned in merge request !1137
mentioned in commit
315d5c910cmarked as related to #670
mentioned in issue #670
mentioned in issue #690