fix: ExemptionDirectory skips buy, sell, and transfer tax (#609) #1124

Merged
PlasticDigits merged 3 commits from issue/609-exemption-full-tax-skip into main 2026-08-23 12:40:23 +00:00
PlasticDigits commented 2026-08-23 12:03:34 +00:00 (Migrated from gitlab.com)

Summary

  • Manager-directory wallets (MANAGER_EXEMPT) now skip buy, sell, and transfer tax (audit M-5 / #609). Either side exempt is enough. TaxPreview and execute are Honest (0 bps); the pair is still credited/debited amount (no inbound FoT).
  • Launch guards stay on: classify_trade keeps the economic Buy/Sell kind for trading_enabled, cooldown, and max_wallet (sell-to-pair still bypasses max wallet).
  • Retail hint / Manage helper say skip buy, sell, and transfer tax. Swap/Trade extra-debit Max uses IsProtocolExempt.manager so an exempt connected wallet is not extra-capped (effectiveExtraDebitSellBps; unknown exempt stays fail-closed).
  • Invariants E609-1–E609-7 in skills/AGENTS_COMMUNITY_TAX_EXEMPT.md; T592-7 / T592-9 updated. make verify-issue-609 (crates + Vitest + docs, run twice).

Closes #609.

Acceptance (issue #609)

  • Exempt wallet Send+Swap to a listed pair pays no sell extra-debit; pair still credited amount.
  • Pair Transfer to an exempt wallet pays no buy split; user credited amount.
  • Exempt ↔ non-exempt Transfer pays no transfer tax (either side exempt).
  • Non-exempt wallets still pay buy/sell/transfer as configured (restore after remove_exempt).
  • Launch guards still apply to exempt wallets (trading off / cooldown / max_wallet).
  • Hint / docs say skip buy, sell, and transfer tax.
  • Multitest covers all three kinds + guards.

Test plan

  • make verify-issue-609 first pass + retest (35 token tests, SKU hint + Max Vitest, docs greps).
  • LocalTerra: Manage Token add exemption, pair swap both directions, balances match amount (needs deployed post-#609 wasm).
  • Columbus-5 11611 CMM migrate after store (live instances still run pre-#609 wasm).

Not in this MR

  • Mainnet/LocalTerra wasm store + CMM migrate of 11611.
  • Live pair-swap QA on Manage Token.
  • Pair/router FoT math (still forbidden).
  • Indexer catalog change (existing #594 rule restated: do not treat an event as on-chain exempt).

Closes #609

## Summary - Manager-directory wallets (`MANAGER_EXEMPT`) now skip **buy, sell, and transfer** tax (audit M-5 / #609). Either side exempt is enough. `TaxPreview` and execute are Honest (0 bps); the pair is still credited/debited `amount` (no inbound FoT). - Launch guards stay on: `classify_trade` keeps the economic Buy/Sell kind for `trading_enabled`, cooldown, and `max_wallet` (sell-to-pair still bypasses max wallet). - Retail hint / Manage helper say skip buy, sell, and transfer tax. Swap/Trade extra-debit Max uses `IsProtocolExempt.manager` so an exempt connected wallet is not extra-capped (`effectiveExtraDebitSellBps`; unknown exempt stays fail-closed). - Invariants **E609-1–E609-7** in [`skills/AGENTS_COMMUNITY_TAX_EXEMPT.md`](skills/AGENTS_COMMUNITY_TAX_EXEMPT.md); T592-7 / T592-9 updated. `make verify-issue-609` (crates + Vitest + docs, run twice). Closes #609. ## Acceptance (issue #609) - [x] Exempt wallet `Send+Swap` to a listed pair pays **no** sell extra-debit; pair still credited `amount`. - [x] Pair `Transfer` to an exempt wallet pays **no** buy split; user credited `amount`. - [x] Exempt ↔ non-exempt Transfer pays **no** transfer tax (either side exempt). - [x] Non-exempt wallets still pay buy/sell/transfer as configured (restore after `remove_exempt`). - [x] Launch guards still apply to exempt wallets (trading off / cooldown / max_wallet). - [x] Hint / docs say skip **buy, sell, and transfer** tax. - [x] Multitest covers all three kinds + guards. ## Test plan - [x] `make verify-issue-609` first pass + retest (35 token tests, SKU hint + Max Vitest, docs greps). - [ ] LocalTerra: Manage Token add exemption, pair swap both directions, balances match `amount` (needs deployed post-#609 wasm). - [ ] Columbus-5 **11611** CMM migrate after store (live instances still run pre-#609 wasm). ## Not in this MR - Mainnet/LocalTerra wasm store + CMM migrate of 11611. - Live pair-swap QA on Manage Token. - Pair/router FoT math (still forbidden). - Indexer catalog change (existing #594 rule restated: do not treat an event as on-chain exempt). Closes #609
PlasticDigits commented 2026-08-23 12:03:56 +00:00 (Migrated from gitlab.com)

marked this merge request as ready

marked this merge request as **ready**
PlasticDigits commented 2026-08-23 12:40:22 +00:00 (Migrated from gitlab.com)

added 10 commits

  • 391af48f...e437cdfc - 8 commits from branch main
  • c5d00f67 - Merge origin/main into issue/609-exemption-full-tax-skip
  • fe2a71a5 - fix: list pair before seed transfer so TransferTax tests stay Honest

Compare with previous version

added 10 commits <ul><li>391af48f...e437cdfc - 8 commits from branch <code>main</code></li><li>c5d00f67 - Merge origin/main into issue/609-exemption-full-tax-skip</li><li>fe2a71a5 - fix: list pair before seed transfer so TransferTax tests stay Honest</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/406/diffs?diff_id=1978187797&start_sha=391af48f5378041473a35510ff1bb757bfefe825)
PlasticDigits commented 2026-08-23 12:40:24 +00:00 (Migrated from gitlab.com)

mentioned in commit 084123b5c4

mentioned in commit 084123b5c46ba03dcba4c6a79363f9310a4cb042
PlasticDigits (Migrated from gitlab.com) merged commit 084123b5c4 into main 2026-08-23 12:40:24 +00:00
PlasticDigits commented 2026-08-23 12:41:00 +00:00 (Migrated from gitlab.com)

mentioned in issue #611

mentioned in issue #611
PlasticDigits commented 2026-08-23 12:41:12 +00:00 (Migrated from gitlab.com)

mentioned in issue #605

mentioned in issue #605
PlasticDigits commented 2026-08-23 12:41:14 +00:00 (Migrated from gitlab.com)

mentioned in issue #609

mentioned in issue #609
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!1124
No description provided.