feat(timecurve-arena): WarBow revenge hero card BP preview + live countdown (GitLab #236) #394
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!394
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/236-revenge-hero-refactor"
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?
Closes #236.
Revenge hero card on
/timecurve/arena(WarbowHeroActions) gets a refactor so each open counter-hit row shows what's actually useful at a glance: stealer BP, expected BP gained on revenge, and a liveValid To: HH:MM:SScountdown. Removes the redundantYou have N open counter-hits. Earliest expiry …summary paragraph and drops the per-row UTCUnixTimestampDisplay.Helper
frontend/src/lib/warbowRevengeRowPreview.tsmirrors onchain_warbowStealDrainBp(stealerBp, WARBOW_STEAL_DRAIN_BPS=1000)with BigInt floor semantics — 10% drain, returns 0 for non-positive input.stealerBp=10, arbitrary inputs vs solidity floor, large BPs via BigInt, regression guard againststealerBp/10ncross-check.Model (
useTimeCurveArenaModel.tsx)useReadContractsonbattlePoints(stealer)keyed offpendingRevengeTargets(sorted, expiry-filtered).useMemowith explicit deps so the call doesn't churn on every render — same pattern as steal-discovery batching the issue body called out.stealerBpByAddressas aReadonlyMap<string, bigint | undefined>from lowercased stealer to live BP;undefined= pending or failed row.Component (
WarbowHeroActions.tsx)Target: {humanBp} BP · Gain: +{drainBp} BPwhenstealerBpis loaded; mutedLoading BP…while the multicall is in flight;Revenge zero (no BP to drain)when drain math floors to 0 instead of a misleading+0 BP.Valid Tocountdown usesledgerNowSec(same interpolated chain now as guard / phase / claim-flag via parent'seffectiveLedgerSec); clamps to00:00:00once a row slips pastexpiry_exclusive(the 8s indexer poll then drops the row).UnixTimestampDisplayimport, andrevengeDeadlineSecprop all removed as dead code.Tests
WarbowHeroActions.test.tsxcover acceptance criteria: no summary paragraph, BP fields render, loading hint, revenge-zero hint, countdown reflectsledgerNowSec(two static renders at different times asserted to differ),00:00:00clamp past expiry, no UTCUnixTimestampDisplayleakage.tsc -bsilent.Docs
timecurve-views.mdArena WarBow hero section bullet 3 extended with the new per-row contract.INV-FRONTEND-236-REVENGE-HEROadded toinvariants-and-business-logic.mdright after the #101 hero-actions row.Acceptance criteria
Valid To: HH:MM:SScounting down every second until expiry.Date.now()alone).UnixTimestampDisplayremoved from hero revenge rows.Valid To:; countdown string changes whenledgerNowSecadvances./timecurve/arenawithVITE_INDEXER_URLand a wallet holding multiple open stealers (left for reviewer / next live sale).mentioned in issue #236
mentioned in commit
d348a7e38b