SEC-B05: disable swap and LP CTAs when pair is paused (#395) #925
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!925
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-395-pair-pause-swap-pool-cta"
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
Addresses GitLab #395 (SEC-B05): SwapPage and PoolPage now query LCD
is_pausedfor the active route pair(s) via shared hookusePairPaused, show pause banners, and disable swap / provide / withdraw submit CTAs before users broadcast txs that would revert on-chain under invariant L6./): checks all pair contract addresses on the resolved swap route; CTA label Pair is paused (after wrap-mapper pause, before blacklist)./pool): checks the selected pool card pair; provide and withdraw CTAs disabled with matching banner.frontend.md,testing.md,user-incident-faq.md,contracts-security-audit.mdL6,skills/AGENTS_FRONTEND_SWAP_SAFETY_CTA.md.Note: issue comment suggested indexer-backed pause tracking as a follow-up; this MR uses the same LCD
getPairPausedpath as Trade/Limit Orders for consistency and fail-closed UX when indexer is up or down.Acceptance checklist
getPairPausedfor selected route pair(s)usePairPaused+swapBlacklistProbe.pairAddressesinSwapPage.tsxbash scripts/with-node.sh --cwd frontend-dapp -- npm run test:run -- src/pages/SwapPage.test.tsx -t "SEC-B05"getPairPausedfor selected pairusePairPausedinPoolCard(PoolPage.tsx)bash scripts/with-node.sh --cwd frontend-dapp -- npm run test:run -- src/pages/PoolPage.test.tsx -t "SEC-B05"SwapPage.test.tsxdescribeSEC-B05PoolPage.test.tsxdescribeSEC-B05Verification checklist (third parties)
bash scripts/with-node.sh --cwd frontend-dapp -- npm run test:run -- src/pages/SwapPage.test.tsx src/pages/PoolPage.test.tsx -t "SEC-B05"bash scripts/with-node.sh --cwd frontend-dapp -- npm run test:run -- src/pages/TradePage.test.tsx -t "pair is paused"(trade path regression)SetPairPaused, open/with that pair on the route and/poolfor that pair — confirm banners and disabled CTAs before signing.Related
docs/contracts-security-audit.mdSecurity review — MR !925
Commit reviewed:
bcf9872536f8f0666d546e396e62fe2fba3a247fScope: Frontend pause gating for Swap (
/) and Pool (/pool) via new shared hookusePairPaused, LCDgetPairPaused/is_pausedqueries, disabled submit CTAs + incident banners, and SEC-B05 unit tests. Docs/skills cross-links only.Outcome:
FINDINGS: 0medium+Inline threads: None (no medium+ findings to anchor on the diff).
Method
usePairPaused.ts,SwapPage.tsx,PoolPage.tsx, tests, docs).swapBlacklistProbe.pairAddresses), filtered withstartsWith('terra1')before LCDqueryContractcalls — same pattern as existing Trade/Limit pause paths.assert_not_pausedgatesReceive(swap / LP withdraw via CW20 Send),ProvideLiquidity, and limit-order withdrawal paths; paused txs revert regardless of UI state (smartcontracts/teststest_paused_withdraw_still_works).Notes (below medium threshold)
isPausedis true only whendata.paused === true(fail-open on error), matching pre-existingTradePagebehavior. Worst case: user broadcasts a tx that reverts on-chain and pays gas — no fund-loss or authz bypass introduced by this MR.isPairPaused; devtools bypass is possible but chain rejects paused executes.USER_INCIDENT_FAQ_HREF); no new user-controlled HTML or logging. LCD queries target configuredTERRA_LCD_URLwith bech32 addresses — unchanged trust model.Security review: no medium+ findings on this diff. This MR is a defensive UX alignment with existing Trade/Limit pause handling; authoritative controls remain on-chain.
mentioned in commit
d487a0cd94