fix(community-tax): tax official-router hops (improved option 2, #607) #1127

Merged
PlasticDigits merged 1 commit from feat/607-router-tax-option-2 into main 2026-08-24 02:41:59 +00:00
PlasticDigits commented 2026-08-24 00:28:58 +00:00 (Migrated from gitlab.com)

Summary

  • Reverses the #607 option 1 disclose-only close. Official-router Send+Swap is Sell: extra-debit authenticated Cw20HookMsg::Swap.trader (honored only when from == config.router). Pair-direct ignores a spoofed trader. Missing / protocol-exempt trader fail-closes (RouterTraderRequired).
  • Buy-leg specified: pair→router stays 1:1; official router→user is outbound split. Pair/router swap math unchanged (H-01). Hybrid (#596) stays on.
  • dApp Max extra-debits on router-hop sells too. Copy: Buy/sell tax applies on every listed-pair swap. / Sell tax extra / Buy tax applies.

Test plan

  • make verify-issue-607 first pass + retest (docs, frontend Vitest, token multitest, inverted PoC)
  • cargo test -p cl8y-community-tax-token --lib (65 tests)
  • Swap pair-direct 11611 sell: Sell tax extra + Max leaves room for extra-debit
  • Swap multi-hop / hybrid: same extra-debit Max (not full CW20) + Sell tax extra
  • Trade market pair-direct vs router-ops hints match
  • Create/Manage: Buy/sell tax applies on every listed-pair swap.
  • Live 11611 store + CMM migrate (ops follow-up; pin still Honest hops until then)

Closes #607 (choice + implement). #603 importers may promise bps on official Swap only after this wasm.

## Summary - Reverses the #607 option 1 disclose-only close. Official-router `Send+Swap` is **Sell**: extra-debit authenticated `Cw20HookMsg::Swap.trader` (honored only when `from == config.router`). Pair-direct ignores a spoofed `trader`. Missing / protocol-exempt trader fail-closes (`RouterTraderRequired`). - Buy-leg specified: pair→router stays 1:1; official router→user is outbound split. Pair/router swap math unchanged (H-01). Hybrid (#596) stays on. - dApp Max extra-debits on router-hop sells too. Copy: `Buy/sell tax applies on every listed-pair swap.` / `Sell tax extra` / `Buy tax applies`. ## Test plan - [x] `make verify-issue-607` first pass + retest (docs, frontend Vitest, token multitest, inverted PoC) - [x] `cargo test -p cl8y-community-tax-token --lib` (65 tests) - [ ] Swap pair-direct 11611 sell: `Sell tax extra` + Max leaves room for extra-debit - [ ] Swap multi-hop / hybrid: same extra-debit Max (not full CW20) + `Sell tax extra` - [ ] Trade market pair-direct vs router-ops hints match - [ ] Create/Manage: `Buy/sell tax applies on every listed-pair swap.` - [ ] Live 11611 store + CMM migrate (ops follow-up; pin still Honest hops until then) Closes #607 (choice + implement). #603 importers may promise bps on official Swap only after this wasm.
PlasticDigits commented 2026-08-24 00:29:14 +00:00 (Migrated from gitlab.com)

mentioned in issue #607

mentioned in issue #607
PlasticDigits commented 2026-08-24 02:42:00 +00:00 (Migrated from gitlab.com)

mentioned in commit cb174fbba1

mentioned in commit cb174fbba1f60d6b6bf40522dcdbe9a14b2763a7
PlasticDigits (Migrated from gitlab.com) merged commit cb174fbba1 into main 2026-08-24 02:42:00 +00:00
PlasticDigits commented 2026-08-24 03:01:16 +00:00 (Migrated from gitlab.com)

mentioned in issue #616

mentioned in issue #616
PlasticDigits commented 2026-08-24 03:01:55 +00:00 (Migrated from gitlab.com)

mentioned in issue #610

mentioned in issue #610
PlasticDigits commented 2026-08-24 03:01:56 +00:00 (Migrated from gitlab.com)

mentioned in issue #615

mentioned in issue #615
PlasticDigits commented 2026-08-24 03:01:57 +00:00 (Migrated from gitlab.com)

mentioned in issue #611

mentioned in issue #611
PlasticDigits commented 2026-08-24 03:01:58 +00:00 (Migrated from gitlab.com)

mentioned in issue #612

mentioned in issue #612
PlasticDigits commented 2026-08-24 11:45:21 +00:00 (Migrated from gitlab.com)

mentioned in issue #603

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