SEC-B02: wallet blacklist test coverage for hybrid swap, claim, and update (#393) #923
No reviewers
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!923
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-393-wallet-blacklist-test-coverage"
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?
Summary
Closes the SEC-B02 gap in wallet blacklist integration tests (#393). The pair contract already gates
ClaimExpiredLimitOrder,UpdateLimitOrderPrice, and hybridSwapviagate_trading_blacklist; this MR adds regression assertions and documents invariant B1.Changes:
wallet_blacklist_blocks_swap_lp_limits_and_unban_restoresto assert blacklist rejection on hybrid swap,UpdateLimitOrderPrice, andClaimExpiredLimitOrder(with a parked expired order fixture).docs/security-model.mdand add matrix row B1 indocs/contracts-security-audit.md.Acceptance checklist
cd smartcontracts && cargo test wallet_blacklist_blocks_swap_lp_limits_and_unban_restoresClaimExpiredLimitOrderfrom a blacklisted wallet is tested and returns a blacklist errorUpdateLimitOrderPricefrom a blacklisted wallet is tested and returns a blacklist errorcargo test blacklist_testsVerification for third parties
Confirm
wallet_blacklist_blocks_swap_lp_limits_and_unban_restoresincludes assertions for:Cw20HookMsg::Swapwithhybrid: Some(...)ExecuteMsg::UpdateLimitOrderPriceExecuteMsg::ClaimExpiredLimitOrderon a parked expired orderDocs:
docs/security-model.md(SEC-B02 paragraph) anddocs/contracts-security-audit.mdrow B1.Related: #393
Security review — MR !923
Commit reviewed:
64a9161040ee25b687c5dcd0f46d0004b3de7239Scope:
smartcontracts/tests/src/blacklist_tests.rs(SEC-B02 regression assertions for hybrid swap,UpdateLimitOrderPrice,ClaimExpiredLimitOrder); doc cross-links indocs/security-model.mdanddocs/contracts-security-audit.md(matrix row B1). No pair/router/factory contract or frontend runtime changes in this diff.Method: Traced attacker-controlled inputs on the added test paths against existing
gate_trading_blacklist/blacklist_guard::assert_trade_not_blacklisted_depssinks incontract.rs(hybridCw20HookMsg::Swapviaexecute_receive, directClaimExpiredLimitOrder/UpdateLimitOrderPriceexecute arms). Confirmed blacklist is enforced oninfo.senderbefore handler dispatch; hybrid swap shares the same receive-path gate as pool-only swap. Rancargo test wallet_blacklist_blocks_swap_lp_limits_and_unban_restoreslocally — PASS.Outcome: FINDINGS: 0 medium+
Security review: no medium+ findings on this diff. Changes add integration-test coverage and documentation for controls already present on-chain; they do not alter auth boundaries, validation, or user-facing execution logic.
Inline threads: none (no findings to anchor).
added 7 commits
main2cc83935- Merge branch 'main' into issue-393-wallet-blacklist-test-coverageCompare with previous version
Resolved merge conflict with
mainindocs/security-model.md.Resolution: Kept both documentation paragraphs — SEC-B02 (wallet blacklist hybrid swap / claim / update coverage from this MR) and SEC-B04 (pair blacklist control-pair test from main).
Sanity checks:
cargo test wallet_blacklist_blocks_swap_lp_limits_and_unban_restores— PASScargo test blacklist_tests— 8/8 PASSSecurity review — MR !923
Commit reviewed:
2cc83935b8fe6c6025e1d7acbb25ce7c82e48bc8Scope:
smartcontracts/tests/src/blacklist_tests.rs(SEC-B02 regression assertions for hybridCw20HookMsg::Swap,UpdateLimitOrderPrice,ClaimExpiredLimitOrderwith expired-order fixture); doc cross-links indocs/security-model.mdanddocs/contracts-security-audit.md(matrix row B1). No pair/router/factory contract, indexer, or frontend runtime changes in this diff.Method: Re-read prior security-review thread on this MR. Traced attacker-controlled inputs on the added test paths against existing sinks:
gate_trading_blacklist→blacklist_guard::assert_trade_not_blacklisted_depsincontract.rs. Confirmed hybrid swap shares theexecute_receivegate (checkscw20_msg.senderand optionaltraderbefore dispatch); directClaimExpiredLimitOrder/UpdateLimitOrderPricearms gateinfo.senderbefore handler logic. Blacklist enforcement is factory-governance-only (non_governance_cannot_blacklist_walletalready covered). Rancargo test wallet_blacklist_blocks_swap_lp_limits_and_unban_restoreslocally — PASS.Outcome: FINDINGS: 0 medium+
Security review: no medium+ findings on this diff. Changes add integration-test coverage and documentation for on-chain controls already present; they do not alter auth boundaries, validation, execution logic, or off-chain attack surface.
Inline threads: none (no findings to anchor).
mentioned in commit
2725fdb323