Arena player progression: level cap, feature gates, onboarding UX (#299) #441
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!441
Loading…
Reference in a new issue
No description provided.
Delete branch "cursor/arena-player-progression-f101"
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 #299: cap player level at 5, gate buyer-scoped podium mechanics by level (progressive unwrapping), surface XP/level on main
/arena, tune first-buy CRED onboarding for two starterbuyWithCredbuys → level ≥ 2, and documentINV-ARENA-PROGRESSION-*invariants.Onchain:
ArenaXp.MAX_PLAYER_LEVEL, level-gated_finishBuy, WarBow level ≥ 4 checks, flag plant/cancel at level ≥ 5,FIRST_BUY_CRED_BONUS = 1100e18,grandfatherProgressionfor legacy wallets,LevelUp/FeatureUnlockedevents.Frontend:
ArenaXpHero,ArenaLevelGate,FeatureMechanicModal, buy-preview filtering by level.Indexer:
unlocked_levelon wallet stats (capped at 5).Migration note: Production upgrades should call
grandfatherProgressionfor wallets withbuyCount > 0before the feature ships.Acceptance checklist
cd contracts && forge test --match-test test_level_cap_at_fiveforge test --match-test test_level_1_gates_timersforge test --match-test test_level_2_gates_timers…test_level_4_warbow_bp_and_level_5_flagforge test --match-test test_level_4_buy_plant_flag_ignoredforge test --match-test test_level_3_warbow_steal_revertscd frontend && npm test -- arenaProgression+ manual/arenaFeatureMechanicModal+arenaProgression.test.tsnpm test -- arenaCommandConsoleStatic(expectsArenaXpHero)bash scripts/verify-cred-buy-anvil.shforge test --match-test test_onboarding_two_starter_buys_reach_level_twobash scripts/check-doc-anchors.shtest_grandfather_progressionVerification for third parties
cd contracts && forge test(skip fork tests ifdoub.csvmissing).bash scripts/verify-cred-buy-anvil.shcd frontend && npm run typecheck && npm run lint && npm testcd indexer && cargo test arena_wallet_stats_two_epochs_and_bonus_fieldsbash scripts/check-doc-anchors.shBlockers
None — E2E (
bash scripts/e2e-anvil.sh) not run in this MR (UI touched; recommend post-merge smoke).Closes #299 when merged (issue left open per agent instructions).
Security review
Commit reviewed:
71dc5a157b84a2fd7042a6f4cbb97d48e969495cScope: Arena player progression (#299) — onchain level cap/gates (
TimeArena.sol,ArenaXp.sol), WarBow level checks,grandfatherProgressionmigration,FIRST_BUY_CRED_BONUSretune, frontend XP/level UI (ArenaXpHero,ArenaLevelGate, buy-preview gating), indexerunlocked_levelcap.Outcome:
FINDINGS: 0medium+No inline threads — nothing met the medium+ bar with a plausible attacker-controlled path to a security sink.
Summary
Reviewed added/modified paths for injection, authn/authz bypass, permission-boundary mistakes, secret leakage, XSS/CSRF/SSRF, and unsafe deserialization.
_playerLevel/ post-buygateLevel; WarBow steal/guard/revenge now require level ≥ 4 via_requireWarbowLevel. Level state is only written in_finishBuy(applyXpGain) orgrandfatherProgression(onlyOwner). No caller-controlled bypass found.claimWarBowFlagremains holder-only; planting is level ≥ 5 gated. Legacy pending flags may still be claimable pre-migration — expected migration behavior, not a new privilege escalation.pointer-events: none. Copy is static; wallet addresses flow through existing formatters. Onchain enforcement remains authoritative for writes.unlocked_levelis a capped display field; queries remain parameterized; wallet path validated (0x+ 42 chars).FINDINGS: 0 medium or higher on this diff.
mentioned in commit
a49b3dfb21mentioned in commit
62d83d35bf