feat: add DEX-safe community tax CW20, launcher, and AutoLP (#592) #1119

Merged
PlasticDigits merged 1 commit from issue-592-community-tax-cw20 into main 2026-08-23 03:53:27 +00:00
PlasticDigits commented 2026-08-23 03:50:22 +00:00 (Migrated from gitlab.com)

Summary

  • Adds in-repo Option A community tax template: cl8y-community-tax-token, cl8y-community-token-launcher, cl8y-community-tax-autolp.
  • Inbound credits to pair / router / escrow stay 1:1. Sell tax is extra-debit on Send + Swap. Buy tax is an outbound split on pair→user Transfer/Send. Pair/router swap math is unchanged.
  • SKU unlock and settings batch invoices are exactly 50 UST1 (50000000) to CMM. Token and launcher accept UST1 Send only (#595 pays any token off-chain).
  • Launcher Instantiate { admin: cmm_governance }. Invariants T592-1–T592-12 in docs/contracts-security-audit.md and skills/AGENTS_COMMUNITY_TAX_CW20.md. #589 REPORT stub is NO-GO until LCD store; factory whitelist is a later ops step.

Closes #592.

Issue acceptance (this MR)

  • New CW20 + launcher; free profile; paid SKUs at 50 UST1 to CMM
  • Settings batch 50 UST1 flat; unpaid / no-op / non-manager / unactivated SKU fail without taking fee
  • Manager-only config; non-manager → Unauthorized
  • Launcher stamps CMM admin on instantiate (multi-test)
  • Inbound to pair 1:1 (plain Transfer / TransferFrom); classic FoT still the existing adversarial test (pair wasm unchanged)
  • Buy outbound + sell extra-debit match TaxPreview
  • MintControl instantiate-only; RevokeMint irreversible (settings invoice)
  • AutoLP is never invoked from token Transfer/Send/AfterSwap
  • No reflection / rebase / pause / blacklist manager APIs
  • #589 REPORT template filled as NO-GO; whitelist stays ops
  • Pair/router swap math unchanged
  • Docs + playbook + make verify-issue-592

Not in this MR

  • Factory AddWhitelistedCodeId / columbus-5 or LocalTerra store / Layer A-lcd + Layer B-lt on pinned wasm (#589 GO)
  • LCD ContractInfo.admin probe on a live chain (multi-test covers instantiate admin)
  • Full DEX integration: hybrid swap, router multi-hop, live pair provide/withdraw/limit fill, F6 migrate-off-template
  • AutoLP skim against a live router/pair (threshold no-op + manager-only UpdateConfig only)
  • Launcher does not instantiate AutoLP and bind it in the same create tx
  • Untaxed withdraw / limit refund — pair→EOA Transfer uses buy tax (T592-7); would need pair wasm or AfterSwap
  • dApp #593, indexer #594, Option C SetPairHooks for token managers, book MM #597

Test plan

  • make verify-issue-592 — crates + docs, passed twice (27 crate tests)
  • cargo clippy / cargo fmt on the new crates (pre-commit)
  • make test-contracts (full workspace; optional CI)
  • LocalTerra: launcher create → CreatePair → buy/sell; extra-debit max button
  • After store: fill #589 REPORT and run Layer A/B before whitelist
  • #593 / #594 consume launcher events (community_token, sku, manager, code_id)
## Summary - Adds in-repo Option A community tax template: `cl8y-community-tax-token`, `cl8y-community-token-launcher`, `cl8y-community-tax-autolp`. - Inbound credits to pair / router / escrow stay **1:1**. Sell tax is extra-debit on `Send` + `Swap`. Buy tax is an outbound split on pair→user `Transfer`/`Send`. Pair/router swap math is unchanged. - SKU unlock and settings batch invoices are exactly **50 UST1** (`50000000`) to CMM. Token and launcher accept UST1 `Send` only (#595 pays any token off-chain). - Launcher `Instantiate { admin: cmm_governance }`. Invariants **T592-1–T592-12** in `docs/contracts-security-audit.md` and `skills/AGENTS_COMMUNITY_TAX_CW20.md`. `#589` REPORT stub is **NO-GO** until LCD store; factory whitelist is a later ops step. Closes #592. ## Issue acceptance (this MR) - [x] New CW20 + launcher; free profile; paid SKUs at 50 UST1 to CMM - [x] Settings batch 50 UST1 flat; unpaid / no-op / non-manager / unactivated SKU fail without taking fee - [x] Manager-only config; non-manager → `Unauthorized` - [x] Launcher stamps CMM admin on instantiate (multi-test) - [x] Inbound to pair 1:1 (plain Transfer / TransferFrom); classic FoT still the existing adversarial test (pair wasm unchanged) - [x] Buy outbound + sell extra-debit match `TaxPreview` - [x] MintControl instantiate-only; `RevokeMint` irreversible (settings invoice) - [x] AutoLP is never invoked from token `Transfer`/`Send`/`AfterSwap` - [x] No reflection / rebase / pause / blacklist manager APIs - [x] `#589` REPORT template filled as **NO-GO**; whitelist stays ops - [x] Pair/router swap math unchanged - [x] Docs + playbook + `make verify-issue-592` ## Not in this MR - Factory `AddWhitelistedCodeId` / columbus-5 or LocalTerra store / Layer A-lcd + Layer B-lt on pinned wasm (`#589` GO) - LCD `ContractInfo.admin` probe on a live chain (multi-test covers instantiate admin) - Full DEX integration: hybrid swap, router multi-hop, live pair provide/withdraw/limit fill, F6 migrate-off-template - AutoLP skim against a live router/pair (threshold no-op + manager-only `UpdateConfig` only) - Launcher does **not** instantiate AutoLP and bind it in the same create tx - Untaxed withdraw / limit refund — pair→EOA `Transfer` uses **buy tax** (**T592-7**); would need pair wasm or AfterSwap - dApp **#593**, indexer **#594**, Option C `SetPairHooks` for token managers, book MM **#597** ## Test plan - [x] `make verify-issue-592` — crates + docs, passed twice (27 crate tests) - [x] `cargo clippy` / `cargo fmt` on the new crates (pre-commit) - [ ] `make test-contracts` (full workspace; optional CI) - [ ] LocalTerra: launcher create → `CreatePair` → buy/sell; extra-debit max button - [ ] After store: fill `#589` REPORT and run Layer A/B before whitelist - [ ] `#593` / `#594` consume launcher events (`community_token`, `sku`, `manager`, `code_id`)
PlasticDigits commented 2026-08-23 03:53:27 +00:00 (Migrated from gitlab.com)

mentioned in commit ffe04d143e

mentioned in commit ffe04d143e688f19232f6895afa4bf4d67759e32
PlasticDigits (Migrated from gitlab.com) merged commit ffe04d143e into main 2026-08-23 03:53:27 +00:00
PlasticDigits commented 2026-08-23 03:53:50 +00:00 (Migrated from gitlab.com)

mentioned in issue #601

mentioned in issue #601
PlasticDigits commented 2026-08-23 03:54:00 +00:00 (Migrated from gitlab.com)

mentioned in issue #592

mentioned in issue #592
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!1119
No description provided.