Wire WarBow ambush/streak-break BP and route WarBow DOUB like buys (#310) #465
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!465
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-310-warbow-bp-routing"
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 #310 — economic parity for WarBow:
_applyBuyWarBowBpnow awards streak-break (prior active defended streak × 100 BPwhen a different buyer buys underDEFENDED_STREAK_WINDOW_SEC) and ambush (+200 BP on hard reset + streak break), using defended-streak state captured before_processDefendedStreak(matcheswarbow_buy_bp_deltainsimulations/timecurve_sim/model.py).warbowSteal,warbowRevenge, andwarbowActivateGuardroute pulled DOUB through_routeDoubPrizeSplitand incrementtotalDoubRaised, same asbuy(#300). No DOUB stranded onTimeArena.Docs:
PARAMETERS.md,arena-v2.md, invariants §310,play-time-arena-warbowskill.Acceptance checklist
cd contracts && forge test --match-test "test_warbow_streak_break_bp|test_warbow_ambush"totalDoubRaisedand lands in podium vaultscd contracts && forge test --match-test "test_warbow_steal_pulls_doub|test_warbow_guard_pulls_doub|test_warbow_revenge_pulls_doub|test_warbow_steal_routes_doub_split"TimeArenaafter WarBow actionsdoub.balanceOf(arena)unchanged / vault delta equals spendPARAMETERS.mdand progression docs updatedPARAMETERS.md,arena-v2.md,invariants-and-business-logic.md,skills/play-time-arena-warbow/SKILL.mdTimeArenasuitecd contracts && forge test --match-contract TimeArenacd contracts && forge testdoub.csvfork tests SKIP — file absent)bash scripts/verify-podium-live-anvil.shPodiumEpochFundedalready indexed from anyTimeArenatxThird-party verification
Confirm in
TimeArena.sol:_applyBuyWarBowBpadds streak-break / ambush whenprevDsBuyer != buyerunder the defended-streak window._routeWarbowDoubSpendcalls_routeDoubPrizeSplit+totalDoubRaised += amountfrom steal/guard/revenge paths.Related: #309 (gap analysis), #300 (100% podium routing), #252 (WarBow PvP).
changed the description
changed the description
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Reviewed by Cursor Bugbot for commit
cec216b8b6. Configure here.Stale streak-break after window
Medium Severity
Streak-break WarBow BP reads
activeDefendedStreakfor_dsLastUnderWindowBuyerbefore_processDefendedStreak, but on-chain streak state is not cleared when a later buy happens with Last Buy remaining at or aboveDEFENDED_STREAK_WINDOW_SEC. The sim clears that defender inprocess_defended_streak_sim, so a subsequent under-window buy from another wallet can award streak-break and ambush BP thatwarbow_buy_bp_deltawould not.Reviewed by Cursor Bugbot for commit
cec216b8b6. Configure here.added 1 commit
daf39b30- fix(arena): clear stale defended streak after window expiresCompare with previous version
Security review — MR !465
Commit reviewed:
cec216b8b6cdb0e5db2081a0aa405398a893464bScope:
TimeArena.solWarBow DOUB routing (_routeWarbowDoubSpend) + buy-path streak-break/ambush BP (_applyBuyWarBowBp); associated tests and docs.Method
warbowSteal,warbowRevenge,warbowActivateGuard, and_finishBuy→_applyBuyWarBowBp.safeTransfer/notifyPodiumEpochFunded,totalDoubRaised, and_addBattlePoints.nonReentranton all WarBow externals and buys,require(received == expected)on_pullDoubExact,msg.sender == arenaonPodiumVaultsnotify paths, steal-band / revenge-window / level gates unchanged.simulations/timecurve_sim/model.py::warbow_buy_bp_delta(ordering and conditions align).Outcome
FINDINGS: 0 medium+
No inline threads — nothing met the reporting bar.
Notes (below threshold / not introduced here)
_routeWarbowDoubSpendruns beforerequire(abp > 0 && vbp >= 2 * abp …). A failing band still reverts the whole transaction (includingtransferFromand vault transfers); no partial fund movement.totalDoubRaisedon WarBow spends: Accounting/display metric only; podium payouts usedoub.balanceOf(pool), not this counter. Intended parity withbuy(#300 / #310).remainingBefore < DEFENDED_STREAK_WINDOW_SEC,prevDsBuyer != buyer, andprevDsStreak > 0; state is snapshotted before_processDefendedStreakas specified. CRED-path BP parity is pre-existing product design, not new auth bypass.warbow_buy_bpreplay omits new bonuses — display drift only; out of scope for onchain security on this diff.Security review: no medium+ findings on this diff.
changed the description
resolved all threads
added 22 commits
main28fbbba3- Merge origin/main into issue-310-warbow-bp-routingCompare with previous version
Resolved merge conflicts with
main:TimeArena.sol: Kept #310 WarBow streak-break/ambush BP (prevDsBuyer/prevDsStreakbefore_processDefendedStreak),_routeWarbowDoubSpendon steal/guard/revenge, and stale defended-streak clear. Integrated main changes: AdminSellVault removal (#314), batch podium vault routing (#316), cred-buy epoch pool accrual (#311), and related API/view updates.TimeArena.t.sol: Rebased warbow routing assertions and #310 streak/ambush tests onto main’s test harness (noAdminSellVault).Sanity:
forge test --match-contract TimeArena— 121 passed.changed the description
Security review — MR !465
Commit reviewed:
28fbbba37045376e6af1aac1cc6700db0c483a28Scope:
TimeArena.solWarBow DOUB routing (_routeWarbowDoubSpend→_routeDoubPrizeSplit+totalDoubRaised), buy-path streak-break/ambush BP (_applyBuyWarBowBp+ defended-streak snapshot/clear), merge withmain(#314/#316 batch vault routing, #311 cred epoch pool). Tests/docs in diff reviewed for exploit paths only.Method
msg.sender,victim,payBypassBurn, buy timing) to sinks:_pullDoubExact,_routeDoubPrizeSplit/safeTransfer,notifyPodiumEpochFunded,totalDoubRaised,_addBattlePoints.nonReentranton all WarBow externals and buys;require(received == expected)on pulls;PodiumVaultsnotify paths requiremsg.sender == arena; steal-band / revenge-window / level gates unchanged; Solidity revert atomicity on steal-band failure after routing.daf39b30(clear_dsLastUnderWindowBuyer/activeDefendedStreakwhenremainingBefore >= DEFENDED_STREAK_WINDOW_SEC) is present post-merge; aligns withprocess_defended_streak_sim._applyBuyWarBowBpordering/conditions tosimulations/timecurve_sim/model.py::warbow_buy_bp_delta.forge test --match-test "test_warbow_streak_break_bp|test_warbow_ambush|test_warbow_steal_routes"— PASS.Outcome
FINDINGS: 0 medium+
No inline threads — nothing met the reporting bar on this diff.
Notes (below threshold / not introduced here)
totalDoubRaisedon WarBow spends: display/event metric only; payouts usedoub.balanceOf(pool), not this counter. Intended #300/#310 parity.warbow_buy_bpreplay: omits new bonuses — offchain display drift only.Security review: no medium+ findings on this diff.
mentioned in commit
0bc2582912