fix(community-tax): launch-guard cooldown is pair-wide and max_wallet bricks provide (H-3, H-4) #608
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#608
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_1787468843H-3 / H-4. Template #592 T592-11. Launch-guard editors / SKU init #605. Identity #604 is unrelated. PoCs:poc_cooldown_bricks_pair,poc_max_wallet_bricks_provide.H-5 (
trading_enabled=falselocks pair→EOA) is documented T592-11 / 11611 A9/E8 — out of scope; do not “fix” pause-both-sides here.Columbus-5 token 11611 is factory-listed. This is a token migrate.
Current codebase
community-tax-token/src/tax.rsapply_launch_guards/record_trade_blocks:check_cooldownruns for bothfromandto, thenLAST_TRADE_BLOCKis written for both.LAST_TRADE_BLOCKis documented as “last taxed swap block per wallet” (state.rs).toon every sell andfromon every buy. After the first trade, the pair’s timestamp blocks every other wallet untilcooldown_blockselapse. Not per-wallet anti-snipe — a global pair halt.max_wallet:max_wallet(so exits are not bricked by the cap).TransferFrom→ Honest, so the bypass does not apply. After sells growpair_balance > max_wallet, everyProvideLiquidity(TransferFromto the pair) revertsMaxWallet.launch_guards_block_both_sides_and_sell_bypasses_max_walletcovers sell bypass only — not cooldown, not provide.Why this is needed
LaunchGuards is a paid SKU marketed as max wallet / cooldown / trading on-off. As implemented, cooldown DoSes the pair after one trade, and max wallet DoSes new LP after organic sells. That is not usable as anti-snipe; it is a liveness hole (and a honeypot lever if a manager sets a tight cap + cooldown).
Constraints / guardrails
max_walletbypass (exits).trading_enabledexit behavior in this ticket (H-5 is accepted residual).max_walletmust not apply whentois a listed pair or other protocol-exempt address (provide / router / AutoLP / self).max_walletstill applies to ordinary wallets on Buy / Transfer (non-exempt).cooldown_blocks == 0remains “off.”Relevant files
smartcontracts/contracts/community-tax-token/src/tax.rssmartcontracts/contracts/community-tax-token/src/state.rs(LAST_TRADE_BLOCKcomment)smartcontracts/contracts/community-tax-token/src/multitest.rssmartcontracts/contracts/community-token-launcher/tests/audit_poc.rsskills/AGENTS_COMMUNITY_TAX_CW20.md(T592-11)cw20-codeid-audits/codeids/11611/REPORT.md(D11 / A11 — update after fix)Recommended direction
check_cooldown/record_trade_blocksonly for addresses that are not listed pairs and not protocol-exempt. Typically: the trader wallet on Sell (from) and the recipient wallet on Buy (to) when that recipient is a user.max_walletwhentois a listed pair or protocol-exempt (same set as inbound 1:1). Keep the check for user wallets.Acceptance criteria
cooldown_blocks > 0.cooldown_blockselapse.max_walletafter sells; a laterTransferFromprovide succeeds.max_walleton Buy / Transfer.max_wallet(T592-11).poc_cooldown_bricks_pairandpoc_max_wallet_bricks_providefail or are inverted.max_walletskips protocol / listed pair asto.Test plan — all paths
from): must not use the pair’s timestamp to block B.TransferFromafter pair balance >max_wallet— ok.max_wallet— MaxWallet.to(router / AutoLP / self) — no max_wallet brick.Test plan — attack / abuse
Verification
cargo test -p cl8y-community-token-launcher --test audit_poc— H-3 / H-4 inverted.cargo test -p cl8y-community-tax-token— extend launch-guard multitest beyond sell bypass.marked as related to #592
marked as related to #605
mentioned in commit
bcd58a3bffmentioned in merge request !1123
mentioned in merge request !1122
mentioned in issue #605
mentioned in commit
33e4153f87mentioned in commit
709a2694d5mentioned in commit
e437cdfcc3mentioned in commit
c5d00f67bementioned in issue #611
marked as related to #611
Merge !1123 — H-3 / H-4 and H608-1–H608-8 passed after integrating !1122 (
make verify-issue-6086/6).Merge problems found and fixed on this branch before merge:
launch_guards_cooldown_zero_allows_same_block_tradeshitTrading is not enabledbecause #605 instantiate defaultstrading_enabled=false.audit_pocfailed to compile (initial_exemptmissing) then failed M-1 (max_*headroom without VariableRates) and H-1 (AutoLP now binds).Still ops, not a code defect: columbus-5 11611 bytes remain pre-#608 until store + token migrate. LocalTerra two-wallet + provide-after-cap smoke is on #611.
mentioned in issue #609