Contracts: WarBow PvP on DOUB + WarBow-epoch score reset #252

Closed
opened 2026-05-27 07:07:30 +00:00 by PlasticDigits · 16 comments
PlasticDigits commented 2026-05-27 07:07:30 +00:00 (Migrated from gitlab.com)

Context

WarBow PvP with DOUB costs and independent WarBow epoch reset. Parent epic: #238.

Relevant files

  • contracts/src/TimeCurve.sol WarBow section → TimeArena.sol
  • Tests: TimeCurveWarBow*.t.sol

Acceptance criteria

  • Steal 1000 DOUB, Guard 10000 DOUB, steal-limit override 50000 DOUB, Revenge 1000 DOUB
  • All WarBow spends route through DOUB accounting (no CL8Y)
  • BP/scoring rules retained from docs/product/primitives.md unless spec amends
  • On WarBow timer epoch roll: reset live BP/podium scores; persist epoch id for admin finalizeWarbowPodium(epoch, first, second, third)
  • Flag plant/claim mechanics retained (claim cost = 0 DOUB)

Verification checklist

  • Forge: steal/guard/override pull DOUB amounts
  • Epoch reset clears battlePoints but finalizeWarbowPodium(oldEpoch, ...) still pays from that epoch's pool
## Context WarBow PvP with DOUB costs and independent WarBow epoch reset. Parent epic: #238. ## Relevant files - `contracts/src/TimeCurve.sol` WarBow section → `TimeArena.sol` - Tests: `TimeCurveWarBow*.t.sol` ## Acceptance criteria - [ ] Steal **1000 DOUB**, Guard **10000 DOUB**, steal-limit override **50000 DOUB**, Revenge **1000 DOUB** - [ ] All WarBow spends route through DOUB accounting (no CL8Y) - [ ] BP/scoring rules retained from `docs/product/primitives.md` unless spec amends - [ ] On **WarBow timer epoch roll**: reset live BP/podium scores; persist epoch id for admin `finalizeWarbowPodium(epoch, first, second, third)` - [ ] Flag plant/claim mechanics retained (claim cost = 0 DOUB) ## Verification checklist - [ ] Forge: steal/guard/override pull DOUB amounts - [ ] Epoch reset clears `battlePoints` but `finalizeWarbowPodium(oldEpoch, ...)` still pays from that epoch's pool
PlasticDigits commented 2026-05-27 07:07:31 +00:00 (Migrated from gitlab.com)

marked as related to #238

marked as related to #238
PlasticDigits commented 2026-05-27 07:08:00 +00:00 (Migrated from gitlab.com)

mentioned in issue #238

mentioned in issue #238
PlasticDigits commented 2026-05-28 12:43:16 +00:00 (Migrated from gitlab.com)

mentioned in issue #243

mentioned in issue #243
PlasticDigits commented 2026-05-28 12:43:26 +00:00 (Migrated from gitlab.com)

mentioned in issue #245

mentioned in issue #245
PlasticDigits commented 2026-05-28 13:58:46 +00:00 (Migrated from gitlab.com)

Implementation summary

  • WarBow on DOUB: steal/guard/revenge/flag; BP on buys; finalizeWarbowPodium.

Acceptance criteria

  • DOUB costs 1000/10000/50000/1000
  • BP scoring on buys
  • WarBow podium epoch reset + admin finalize

Verification checklist

  • test_warbow_steal_pulls_doub
## Implementation summary - WarBow on DOUB: steal/guard/revenge/flag; BP on buys; `finalizeWarbowPodium`. ## Acceptance criteria - [x] DOUB costs 1000/10000/50000/1000 - [x] BP scoring on buys - [x] WarBow podium epoch reset + admin finalize ## Verification checklist - [x] `test_warbow_steal_pulls_doub`
PlasticDigits commented 2026-05-29 03:24:02 +00:00 (Migrated from gitlab.com)

mentioned in issue #263

mentioned in issue #263
PlasticDigits commented 2026-05-30 14:40:35 +00:00 (Migrated from gitlab.com)

mentioned in commit 64e2f830e1

mentioned in commit 64e2f830e1be090b03347d883f371f5ef3966135
PlasticDigits commented 2026-05-30 14:40:35 +00:00 (Migrated from gitlab.com)

mentioned in commit d7c880768d

mentioned in commit d7c880768dd51f5bb011fb2722aec9b931ed7106
PlasticDigits commented 2026-05-30 14:40:51 +00:00 (Migrated from gitlab.com)

Verification complete (#252)

Verified WarBow DOUB PvP on TimeArena in worktree issue/252-warbow-pvp, merged to main at 64e2f83.

Findings & fixes

  1. DOUB costs — constants match spec: steal 1000e18, guard 10000e18, override 50000e18, revenge 1000e18, flag claim 0.
  2. BP epoch reset — rollPodiumEpoch(CAT_WARBOW) now bumps warbowBpGeneration so stale battlePoints read as zero (was podium-only clear).
  3. Admin finalize path — WarBow roll skips auto 4∶2∶1 pay (other categories unchanged); finalizeWarbowPodium(epoch, …) pays the retained active pool after roll.
  4. Tests added — guard/revenge/override/flag/epoch-reset/finalize Forge tests; all 60 TimeArenaTest cases pass.

Acceptance criteria

  • Steal 1000 / Guard 10000 / override 50000 / Revenge 1000 DOUB
  • All WarBow spends route through DOUB (no CL8Y)
  • BP/scoring rules retained (Last Buy timer for bonuses — #271)
  • WarBow epoch roll resets live BP + podium; epoch id persisted for finalizeWarbowPodium
  • Flag plant/claim retained (claim cost 0 DOUB)

Docs / skills updated

  • docs/product/arena-v2.md, docs/product/time-arena.md
  • docs/testing/invariants-and-business-logic.md — INV-TIME-ARENA-WARBOW-DOUB, INV-TIME-ARENA-WARBOW-EPOCH-RESET
  • skills/play-time-arena-warbow/SKILL.md (live, no longer stub)
  • contracts/PARAMETERS.md, guardrails + agent metadata crosslinks

Manual verification checklist

  • cd contracts && forge test --match-contract TimeArenaTest --match-test warbow
  • Confirm WARBOW_*_DOUB on deployed proxy via cast call
  • After buys, warbowSteal / warbowActivateGuard / warbowRevenge pull DOUB (Anvil wallet balance delta)
  • rollPodiumEpoch(3) clears battlePoints(user) reads; pool balance unchanged until owner finalizeWarbowPodium(0, …)
  • Indexer GET /v1/arena/warbow/* feeds reflect WarBowSteal / WarBowGuard events post-deploy

All automated criteria from the issue body and prior comment pass; closing.

## Verification complete (#252) Verified WarBow DOUB PvP on `TimeArena` in worktree `issue/252-warbow-pvp`, merged to `main` at `64e2f83`. ### Findings & fixes 1. **DOUB costs** — constants match spec: steal `1000e18`, guard `10000e18`, override `50000e18`, revenge `1000e18`, flag claim `0`. 2. **BP epoch reset** — `rollPodiumEpoch(CAT_WARBOW)` now bumps `warbowBpGeneration` so stale `battlePoints` read as zero (was podium-only clear). 3. **Admin finalize path** — WarBow roll **skips** auto 4∶2∶1 pay (other categories unchanged); `finalizeWarbowPodium(epoch, …)` pays the retained active pool after roll. 4. **Tests added** — guard/revenge/override/flag/epoch-reset/finalize Forge tests; all 60 `TimeArenaTest` cases pass. ### Acceptance criteria - [x] Steal 1000 / Guard 10000 / override 50000 / Revenge 1000 DOUB - [x] All WarBow spends route through DOUB (no CL8Y) - [x] BP/scoring rules retained (Last Buy timer for bonuses — #271) - [x] WarBow epoch roll resets live BP + podium; epoch id persisted for `finalizeWarbowPodium` - [x] Flag plant/claim retained (claim cost 0 DOUB) ### Docs / skills updated - `docs/product/arena-v2.md`, `docs/product/time-arena.md` - `docs/testing/invariants-and-business-logic.md` — `INV-TIME-ARENA-WARBOW-DOUB`, `INV-TIME-ARENA-WARBOW-EPOCH-RESET` - `skills/play-time-arena-warbow/SKILL.md` (live, no longer stub) - `contracts/PARAMETERS.md`, guardrails + agent metadata crosslinks ### Manual verification checklist - [ ] `cd contracts && forge test --match-contract TimeArenaTest --match-test warbow` - [ ] Confirm `WARBOW_*_DOUB` on deployed proxy via `cast call` - [ ] After buys, `warbowSteal` / `warbowActivateGuard` / `warbowRevenge` pull DOUB (Anvil wallet balance delta) - [ ] `rollPodiumEpoch(3)` clears `battlePoints(user)` reads; pool balance unchanged until owner `finalizeWarbowPodium(0, …)` - [ ] Indexer `GET /v1/arena/warbow/*` feeds reflect `WarBowSteal` / `WarBowGuard` events post-deploy All automated criteria from the issue body and prior comment pass; closing.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-30 14:40:51 +00:00
PlasticDigits commented 2026-06-01 03:31:04 +00:00 (Migrated from gitlab.com)

mentioned in issue #273

mentioned in issue #273
PlasticDigits commented 2026-06-07 07:50:10 +00:00 (Migrated from gitlab.com)

mentioned in issue #300

mentioned in issue #300
PlasticDigits commented 2026-06-07 13:57:54 +00:00 (Migrated from gitlab.com)

mentioned in issue #302

mentioned in issue #302
PlasticDigits commented 2026-06-13 07:02:54 +00:00 (Migrated from gitlab.com)

mentioned in issue #309

mentioned in issue #309
PlasticDigits commented 2026-06-13 10:19:34 +00:00 (Migrated from gitlab.com)

mentioned in merge request !465

mentioned in merge request !465
PlasticDigits commented 2026-06-13 13:26:58 +00:00 (Migrated from gitlab.com)

mentioned in issue #310

mentioned in issue #310
PlasticDigits commented 2026-07-07 12:54:37 +00:00 (Migrated from gitlab.com)

mentioned in issue #367

mentioned in issue #367
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/yieldomega#252
No description provided.