Security: SwapPage and PoolPage do not query pair pause -- no frontend disabled-state for swap or LP actions under pair pause [SEC-B05] #395
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#395
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?
Checklist Item
SEC-B05: Verify pair pause blocks swap, hybrid swap, limit place/cancel/claim/update, and LP actions according to intended policy. Verify: contract tests and frontend disabled-state tests match the documented policy.
Summary
The pair pause contract tests and the TradePage frontend test confirm that pair pause is enforced on-chain and that the Trade page shows a banner with disabled limit actions. However, SwapPage and PoolPage do not call
getPairPausedat all. When a pair is paused, neither the swap submit CTA on SwapPage nor the provide/withdraw CTAs on PoolPage are proactively disabled in the frontend. Users submitting through those pages would receive an on-chain rejection with no prior UI indication.What Was Checked
frontend-dapp/src/pages/TradePage.test.tsxlines 656-668 -- pair pause banner confirmed, limit Place CTAs disabled -- PASSES for trade pathfrontend-dapp/src/pages/TradePage.tsxline 259 -- callsgetPairPaused-- CONFIRMEDfrontend-dapp/src/components/trade/TradeOrderTicket.tsxline 256 -- callsgetPairPaused-- CONFIRMEDfrontend-dapp/src/pages/LimitOrdersPage.tsxline 140 -- callsgetPairPaused-- CONFIRMEDfrontend-dapp/src/pages/SwapPage.tsxlines 364-385 -- only queries wrap-mapper pause (isWrapPaused), no call togetPairPausedfrontend-dapp/src/pages/PoolPage.tsx-- no call togetPairPausedfoundgetPairPausedacross all non-test frontend source files: only found in TradeOrderTicket, TradePage, LimitOrdersPagefrontend-dapp/src/pages/SwapPage.test.tsx-- no test for pair pause disabled swap CTAExpected (per checklist)
Frontend disabled-state tests must match the documented policy for pair pause. The policy (contracts-security-audit.md invariant L6) states pair pause blocks swaps and LP actions. The frontend should proactively disable the swap submit CTA on SwapPage and the provide/withdraw CTAs on PoolPage when the selected pair is paused, and tests should assert this.
Actual
getPairPausedis not called in SwapPage or PoolPage. No frontend disabled-state test exists for pair pause on SwapPage or PoolPage. The contract-level enforcement exists, but users on those pages receive no proactive UI indication before submitting a transaction that will be rejected on-chain.Evidence
frontend-dapp/src/pages/SwapPage.tsxline 364-385: only wrap-mapper pause queried (isWrapPaused); nogetPairPausedcallfrontend-dapp/src/pages/PoolPage.tsx: nogetPairPausedimport or callfrontend-dapp/src/pages/SwapPage.test.tsx: no test for pair pause state on swap submit buttonfrontend-dapp/src/pages/TradePage.test.tsxlines 656-668: pair pause correctly tested on trade/limit pathgetPairPausedin non-test frontend source: only 3 files (TradeOrderTicket, TradePage, LimitOrdersPage)Suggested Fix
Add
getPairPausedqueries to SwapPage and PoolPage for the currently selected pair, and disable the swap submit and LP provide/withdraw CTAs respectively when the pair is paused, consistent with how TradePage handles it. Add unit tests asserting:getPairPausedreturns{ paused: true }for the selected pair, the swap submit button is disabledgetPairPausedreturns{ paused: true }for the selected pair, the provide and withdraw CTAs are disabledVerification Checklist
getPairPausedfor the selected pairgetPairPausedfor the selected pairLabels
security,pre-launchCc: @PlasticDigits
Paused state should be tracked by indexer.
mentioned in issue #381
mentioned in merge request !925
mentioned in commit
d487a0cd94Verification — GitLab #395 / SEC-B05 (PASS)
Verified on
main(clean working tree). No code or docs changes required; closing issue.Checklist results
SwapPage.tsxusesusePairPaused(LCDgetPairPausedviais_pausedquery) for single- and multi-hop route pairsbuttonDisabledwhenisPairPaused; labelPair is paused;data-testid="swap-pair-paused-banner"PoolPage.tsxusesusePairPaused({ pairAddress: pair.contract_addr })disabled+Pair is pausedlabel whenisPairPaused; bannerpool-pair-paused-bannerSwapPage.test.tsx→pair pause disabled swap CTA (SEC-B05 / GitLab #395)PoolPage.test.tsx→pair pause disabled LP CTAs (SEC-B05 / GitLab #395)Commands / output
Policy alignment
pause_blocks_swap_and_place_cancel_refunds_escrowinsmartcontracts/tests/src/limit_order_tests.rs(GitLab #87).docs/testing.md§ SEC-B05 andskills/AGENTS_FRONTEND_SWAP_SAFETY_CTA.md.TradePage.test.tsx).Follow-ups (optional)
usePairPausedwith 15s stale cache. Consider indexer exposure if LCD load or consistency becomes a concern.mentioned in issue #414
mentioned in issue #417
mentioned in merge request !945
mentioned in issue #561