test: named tax-on Layer B suite (keep generic B-lt tax-off) #623
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#623
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 / siblings
Sister of generic CW20 intake #589 / O601-1. Tax classification already exists as ephemeral
#601smoke (scripts/qa/localterra-community-tax-smoke.sh) and crate multitest (make verify-issue-592). This issue is a named second harness for tax-on DEX paths so we never loosen Layer B-lt’s 1:1 detectors.Related: LocalTerra seed + funding issue (optional target pair); swarm / Playwright issues consume the same market but are not this harness.
Current codebase
Layer B-lt (
cw20-codeid-audits/scripts/layer-b-lt.sh) is the generic “honest CW20 on this DEX” script used for 8266, 10184 analogue, 11611, 11619, etc.:layer-a-lcd.sh). Community-tax instantiate retries a specialInstantiateMsgwithbuy_bps: 0,sell_bps: 0(or SKU-stripped 11619+) so 1:1 rows stay meaningful.CreatePairvs EMBER, provide, P2 reserve delta, round-tripSendswap (B7), limit escrow 1:1 (L1),SendFromswap.user_debit == Send amountandpair_credit == amount.RegisterListedPair. 11611/11619 REPORTs say so explicitly: inbound 1:1 holds; tax classification is crate +#601smoke.#601smoke already does tax-on for pair-direct: register, TaxPreview, sell extra-debit, buy outbound split, launcher SKU, settings invoice, MintControl. It does not cover official-router ≥2hoptrader, hybrid, zap, or AutoLPSkimToLpvs a live pair (those were O601-7 residuals). AutoLP isnullin that script.Mixing tax-on math into B-lt would either false-fail honest CW20s or punch a hole FoT mutants can walk through (C589-5).
Why this is needed
We need both questions answered on every community-tax pin (local artifact and LCD 11611/11619):
RegisterListedPair, trader extra-debit / outbound split / official-routertrader/ AutoLP skim floor hold.#601is close to (2) but is issue-specific, skips AutoLP, and is easy to “just extend B-lt” under time pressure. A named script +make verify-…target makes the split durable.Constraints / guardrails
debit == amount + taxor special-caseif community-taxinsidelayer-b-lt.sh.RegisterListedPairin generic B-lt.11611/11612/11621/8654from this evidence.amount.Swap.trader; official router honors authenticatedtraderonly whenfrom == config.router; missing trader fail-closes (T592-13).SkimToLpnever from tokenTransfer/Send(T592-10). Floor 100/200 bps (M610-3).cw20-codeid-audits/codeids/.Relevant files
cw20-codeid-audits/scripts/layer-b-lt.shcw20-codeid-audits/scripts/layer-a-lcd.shcw20-codeid-audits/scripts/lib-layer-lt.shcw20-codeid-audits/harness/README.mdcw20-codeid-audits/codeids/11611/REPORT.mdcw20-codeid-audits/codeids/11619/REPORT.mdscripts/qa/localterra-community-tax-smoke.shscripts/qa/verify-issue-601.shsmartcontracts/tests/src/cw20_codeid_harness.rsskills/AGENTS_CW20_CODE_ID_AUDIT.mdskills/AGENTS_COMMUNITY_TAX_CW20.mdskills/AGENTS_COMMUNITY_TAX_ROUTER.mdskills/AGENTS_COMMUNITY_TAX_AUTOLP.mdRecommended direction
cw20-codeid-audits/scripts/layer-b-tax-on.sh(name bikeshed OK:layer-b-tax-on,community-tax-layer-b.sh).#601smoke intoscripts/lib/orcw20-codeid-audits/scripts/lib-tax-on.shso smoke and the new suite do not diverge.VITE_TOKEN_COMMUNITY_TAX_ADDRESS+ pair + launcher + AutoLP), or#601(nonzero bps, AutoLP on).layer-b-tax-on.json):RegisterListedPair(if not already).amount + floor(amount * sell_bps / 10000).amount, sink tax.trader; pair→router 1:1; spoofed pair-directtraderdoes not move a third wallet.traderfail-closes.SkimToLprespects floor; fake pair rejected.make verify-issue-XXX(or extendverify-issue-601with an explicit tax-on step that is not B-lt). Docs:harness/README.md, 11611/11619 REPORT “tax-on suite” row,AGENTS_CW20_CODE_ID_AUDIT.mddo not merge into B-lt.#601smoke as the ops narrative or thin wrapper around the same lib.Acceptance criteria
layer-b-lt.shunchanged in 1:1 semantics; community-tax A-lcd/B-lt still pass with tax off.LAYER_B_TAX_ON=1or always-on in its verify target).trader, spoof-trader negative, limit 1:1, AutoLP floor.#601verify still green; no docs tell ops to whitelist from tax-on evidence.Test plan (all paths)
CODE_ID=11619 LAYER_B_LT=1 make verify-issue-589— still 1:1, no register.trader; hop pair→router 1:1.#601): 50 UST1 via launcher.LAYER_B_TAX_ON=1without chain — print fail/skip like C589-7, never stub PASS.Test plan (attack / hack / abuse)
debit >= amountRegisterListedPairadded tolayer-b-lt.shtraderon pair-direct to tax a victimfromextra-debitedtraderon option-2 wasmRegisterListedPairrejects (T592-9 / D8)SkimToLpfrom a mocked token hookTransfer/Sendexecuted: trueJSON without txsrgguardsVerification
Close when the named script is the documented tax-on gate and B-lt remains the honest-CW20 gate.
marked as related to #620
marked as related to #589
marked as related to #601
marked as related to #592
marked as related to #607
marked as related to #610
mentioned in issue #620
marked as related to #621
marked as related to #622
mentioned in issue #624
mentioned in merge request !1133
mentioned in commit
23453a21d8mentioned in merge request !1134
mentioned in merge request !1135
mentioned in commit
77df08f4c2mentioned in commit
36fce44c6amentioned in commit
5f683cfe9fmentioned in issue #621
mentioned in issue #622
Merge note (!1134)
Merged to
mainas !1134 (36fce44c) after resolving conflicts with !1133/#621. Did not wait for CI;gitleaksfailed withci_quota_exceeded.Sanity on this tip
make verify-issue-623docs + B-lt untouched + FoT mutant red + token/AutoLP crates: PASS. Live seed-pin path FAILed:LCD
get_configon that QTAX token isbuy_bps=500/sell_bps=500. Manager + treasury aretest1. The suite’s sell usesfund_trader(test2 when treasury is test1) so extra-debit holds; the buy still Sends EMBER fromTEST_ADDRESS(test1). Manager-exempt buy is 1:1 (#609), so the outbound-split assert cannot pass on the #620 seed path.Remaining (do not reopen this ticket)
LAYER_B_TAX_ON=1 make verify-issue-623on a clean seed and keep the ephemeral path greenCODE_ID=11619 LAYER_B_LT=1 make verify-issue-589andmake verify-issue-601(B-lt file untouched)Tracked on the new post-merge issue for !1133–!1135.
mentioned in issue #625
marked as related to #625