fix(community-tax): launcher EnableFeature path, SKU dedupe, and QA smoke (C-1, H-2, L-1) #606
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#606
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
Audit
INTERNAL_KIMIK3_1787468843C-1 / H-2 / L-1. Template #592 · Create Token #593 · invoices #595 · SKU init #605. PoCs:poc_launcher_enable_feature_always_unauthorized,poc_launcher_duplicate_sku_double_charge.Columbus-5: token 11611, launcher 11614 (
terra126pr5…ahzwze). Token/launcher code fixes need a CMM / DEX 2-of-3 migrate. A dApp-only Enable Feature payee change does not.Current codebase
C593-4 says Enable Feature is
50 UST1to the env launcher. The dApp follows that:frontend-dapp/src/utils/communityTaxInvoice.tsbuildEnableFeatureInvoicesetspayee: launcherand hook{ enable_feature: { token, sku } }.community-token-launcher/src/contract.rsenable_featureforwards that UST1 withCw20ExecuteMsg::Sendto the token. The token seescw20.sender = launcher.community-tax-token/src/invoice.rsexecute_receiverequirespayer == config.manager. Launcher ≠ manager →Unauthorized. Feature stays off. UST1 is not taken (atomic revert).Direct-to-token
Send(manager ascw20.sender) still works. That is what QA uses:scripts/qa/localterra-community-tax-smoke.shSKU unlock sends UST1 to the token, not the launcher.make verify-issue-601can stay green while the official UI path is dead.H-2: launcher
create_tokensetspaid_skus = args.features.len()and charges50 UST1 × len.Features::from_skusis idempotent (duplicatetransfer_taxis a no-op). A crafted hook[transfer_tax, transfer_tax]pays 100 UST1 for one flag. The create UI uses unique checkboxes and does not send duplicates.Launcher unit tests cover create only (3 tests). No launcher
enable_featurehappy path.Why this is needed
Retail Manage Token Enable Feature is the only post-create SKU store. It cannot succeed today. Operators who copy the smoke script can unlock; retail cannot. That looks like a rug even though it is a revert.
Duplicate SKUs overcharge CMM on a crafted create hook. Same invoice surface; fix in the same launcher pass.
QA must exercise the official path or C-1 will regress silently.
Constraints / guardrails
payer == managerfor arbitrary addresses.EnableFeatureinto a settings batch.Relevant files
smartcontracts/contracts/community-tax-token/src/invoice.rssmartcontracts/contracts/community-token-launcher/src/contract.rssmartcontracts/contracts/community-token-launcher/tests/audit_poc.rsfrontend-dapp/src/utils/communityTaxInvoice.ts(+.test.ts)frontend-dapp/src/pages/ManageTokenPage.tsxscripts/qa/localterra-community-tax-smoke.shskills/AGENTS_FRONTEND_CREATE_TOKEN.md(C593-4)skills/AGENTS_COMMUNITY_TAX_CW20.md(T592-4)Recommended direction
Pick one Enable Feature path (do not ship both as “supported”):
Send). Launcherenable_featurecan stay unused or be gated off in the UI.payer == origin.launcheras manager-authorized forEnableFeatureonly; keeppayer == managerfor direct pays and forUpdateSettings.Plus: unique-set / reject duplicate SKUs on create; smoke + a launcher-path unit test must use the same path as the dApp.
Acceptance criteria
Featuresstill idempotent.verify-issue-601if it calls smoke) uses the dApp Enable Feature path, not a hidden direct-to-token shortcut that would hide C-1.poc_launcher_enable_feature_always_unauthorizedfails or is inverted.poc_launcher_duplicate_sku_double_chargefails or is inverted.Test plan — all paths
transfer_tax→ feature on, 50 UST1 at CMM.[transfer_tax, transfer_tax]→ reject or 50 UST1 once.Test plan — attack / abuse
enable_featurefor someone else’s token → Unauthorized; no SKU; no UST1 taken from victim.EnableFeaturewhile not manager → Unauthorized.origin.launcherfor that token, not an arbitrary contract.Verification
cargo test -p cl8y-community-token-launcher --test audit_poc— C-1 / H-2 cases inverted.cargo test -p cl8y-community-tax-token— existing invoice tests still pass.communityTaxInvoicetests: payee matches the chosen path.make verify-issue-593and smoke /make verify-issue-601after smoke change.marked as related to #592
marked as related to #593
marked as related to #595
marked as related to #605
mentioned in merge request !1122
mentioned in issue #605
mentioned in issue #611
mentioned in merge request !1125
Sanity check of !1125 after resolving conflicts with
main(!1126 + #609).Acceptance (code / automated): met.
make verify-issue-6068/8 after the merge-from-main. Official Manage path stays manager → launcher → token; non-manager blocked; duplicate SKUs reject; invertedpoc_launcher_*; C593-4 / T592-4 / T606 match. Smoke script now Sends to the launcher (sku_unlock_via_launcher).Not verified here (still open after merge):
make verify-issue-601on a freshly redeployed stack.Conflicts resolved in !1125:
AGENTS.md,Makefile,docs/testing.md, T592/C593 skills, tokenmultitest.rs(kept #606 Enable Feature tests; reused #609register_listed_pair). Also dropped a duplicatecommunityTaxHintconst that !1126 landed on Swap (tsc -bTS2451).Do not reopen this issue for the migrate/smoke remainder — track that on the post-merge ops ticket.
mentioned in commit
666e985db3mentioned in commit
cfaf976980mentioned in issue #612
marked as related to #612
Post-merge remainder (migrate 11611/11614, LocalTerra Enable Feature smoke, Swap/Trade disclose): #612. !1125 is on main. Do not reopen this issue for ops.
mentioned in issue #670
marked as related to #670