WarBow steal daily-cap UX: UTC reset + inline cap warning (#361) #534
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega!534
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-361-warbow-steal-quota-ux"
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
Implements GitLab #361 (parent #360): WarBow play surface shows attacker steal quota and UTC-day reset in the viewer summary, and surfaces
describeStealPreflightinline above the Steal button when daily caps apply — without waiting for a failed transaction.STEAL QUOTA:line inwarbow-hero-viewer-summary—X / 3steals landed today +HH:MM:SScountdown to next UTC day; bypass hint when at cap.warbow-hero-steal-preflightwarning/error above Steal; Steal disabled on error tone (mirrors protocol page).useReadContractwhen indexer unset; one-shotreadWarbowStealCapDisplaywhenVITE_INDEXER_URLis set (no recurring display RPC mirrors per #301).warbowUtcDayReset.tsmatches onchainSECONDS_PER_DAYfloor division.INV-FRONTEND-361-WARBOW-STEAL-QUOTA-UX, arena-views §361, play skill update.Acceptance checklist
X/3+ UTC reset countdowncd frontend && npm test -- --run ArenaWarbowHeroPanel.test.tscd frontend && npm test -- --run ArenaWarbowHeroPanel.test.ts timeArenaUx.test.tscd frontend && npm test -- --run warbowUtcDayReset.test.tscd frontend && npm test -- --run indexerFirstDisplay.test.tscd frontend && npm run typechecknpx eslint src/pages/arena/ArenaWarbowHeroPanel.tsx src/pages/arena/useArenaWarbowHero.ts src/lib/warbowUtcDayReset.ts src/lib/readWarbowStealCapDisplay.tscd frontend && npm testArenaSimplePage.test.tsx(shouldShowLevelLockexpectations) onmain; unrelated to this MR/bash scripts/start-qa-local-full-stack.sh --live-sale --no-swarm --no-frontendthencd frontend && npm run devbash scripts/qa/build-frontend-for-rabby.sh+ previewVerification for third parties
git checkout issue-361-warbow-steal-quota-uxcd frontend && npm run typecheck && npx eslint src/pages/arena/ArenaWarbowHeroPanel.tsx src/pages/arena/useArenaWarbowHero.ts && npm test -- --run ArenaWarbowHeroPanel.test.tsx warbowUtcDayReset.test.ts timeArenaUx.test.ts indexerFirstDisplay.test.ts/at WarBow level ≥ 4.Issue #361 left open for merge close.
Bugbot is not enabled for your account, so this pull request was not reviewed.
Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.
Security review — MR !534
Commit reviewed:
d363d40ff38b20afce23b4042c601ab363297abbScope: Frontend WarBow steal daily-cap UX (#361) —
warbowUtcDayReset.ts,readWarbowStealCapDisplay.ts,useArenaWarbowHero.ts,ArenaWarbowHeroPanel.tsx, submit-preflight attacker-cap read, docs/tests/skills. No contract/indexer/API changes in this diff.Method: Diff + sink tracing for injection, authz, XSS, cap-bypass, and EVM steal paths (
warbowStealonchain remains authoritative).Outcome:
FINDINGS: 0medium+Inline threads: none
Security review: no medium+ findings on this diff.
Notes (informational, below threshold)
TimeArena.warbowStealstill gatesstealsReceivedOnDay/stealsCommittedByAttackerOnDayand requirespayBypassBurnwhen capped). New UI is display + pre-submit guidance only.readFreshWarbowStealPreflightnow includesattackerStealsToday(previouslyundefinedat submit), closing a UX gap where attacker-side cap could be missed before signing — defense-in-depth, not a protocol bypass.errorpreflight only;warning(daily cap) still allows click, butrunWarBowStealre-reads chain state and onchain reverts without bypass — self-grief gas at worst.describeStealPreflightstrings render as React text viaStatusMessage; victim input isisAddress-gated before contract reads.readWarbowStealCapDisplayon dependency change; stale/missing indexer RPC data affects display only, not signed tx args.No
block:securitylabel applied.added 4 commits
main1459ead1- Merge origin/main into issue-361-warbow-steal-quota-uxCompare with previous version
Bugbot is not enabled for your account, so this pull request was not reviewed.
Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.
Resolved merge conflicts with
origin/main.warbowUtcDayReset.ts(warbowUtcDayId,warbowSecondsUntilNextUtcDay,warbowUtcDayResetSecalias).readWarbowStealCapDisplayone-shot when indexer on;useReadContractwhen off) per #301.describeStealPreflightabove Steal.indexerFirstDisplay.test.tsfor the one-shot path.Sanity:
npm run typecheckPASS; targeted unit tests (53) PASS.Security review — MR !534
Commit reviewed:
1459ead164787976f9962610be3d4d156072efd3(post-merge withorigin/main)Scope: Frontend WarBow steal daily-cap UX (#361) —
readWarbowStealCapDisplay.ts,warbowUtcDayReset.ts,useArenaWarbowHero.ts,ArenaWarbowHeroPanel.tsx,readFreshWarbowStealPreflightattacker-cap read, docs/tests/skills. No contract, indexer, or API surface changes.Method: Full diff review after merge-conflict resolution; traced attacker-controlled inputs (victim address, bypass checkbox, indexer clock) to sinks (RPC reads, preflight narrative,
warbowStealsubmit). Verified onchainTimeArena.warbowStealremains authoritative for cap enforcement.Outcome:
FINDINGS: 0medium+Inline threads: none
Security review: no medium+ findings on this diff.
Notes (informational, below threshold)
stealsReceivedOnDay/stealsCommittedByAttackerOnDay+require(payBypassBurn)when capped). New UI is display and pre-submit guidance only.readFreshWarbowStealPreflightnow includesattackerStealsToday, closing a UX gap where attacker-side cap could be missed before signing — defense-in-depth, not a protocol bypass.errorpreflight only;warning(daily cap) still allows click, butrunWarBowStealre-reads fresh onchain state and the contract reverts without bypass — self-grief gas at worst.describeStealPreflightstrings render as React text viaStatusMessage; victim input isisAddress-gated before contract reads.readWarbowStealCapDisplayon dependency change; stale/missing RPC data affects display only, not signed tx args. Victim BP/guard now come from onchain one-shot reads instead of indexer target list — improves fidelity vs prior path.warbowUtcDayId/warbowSecondsUntilNextUtcDaymirror onchainblock.timestamp / SECONDS_PER_DAYfloor division; boundary skew between indexerchainNowSecand minedblock.timestampcan affect display/preflight reads but not cap bypass onchain.No
block:securitylabel applied.mentioned in commit
c4de872e05