Add sparse and empty podium roll contract tests (#355) #528
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!528
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-355-sparse-empty-podium-roll-tests"
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
GitLab #355 — sparse and empty podium roll contract tests (parent #342 P2 #15 / M-C2).
Adds two Forge tests in
TimeArena.t.solmatching existing roll test style:test_roll_empty_pool_tranche_promotion— roll whenactivePoolBalance == 0skips payout, still promotes seed/future tranches, disarms timer, and cannot extract DOUB from an empty active ledger.test_roll_partial_winners— single Time Booster entrant: zero-address 2nd/3rd slots receive no transfer; sole winner gets 4/7; unclaimed shares remain on vault.Documents invariants
INV-TIME-ARENA-PODIUM-ROLL-EMPTY/INV-TIME-ARENA-PODIUM-ROLL-SPARSE(invariants §355) and cross-linksskills/play-time-arena-doub.Acceptance checklist
cd contracts && forge test --match-test test_roll_emptyTimeArena.t.soltests + invariants §355cd contracts && forge test --match-test test_roll_podiumcd contracts && forge testDoubAirdropMegaethForkSKIP — missingairdrop/doub.csv)docs/testing/invariants-and-business-logic.md§355Verification checklist (third parties)
cd contracts && forge test --match-test "test_roll_empty|test_roll_partial" -vvcd contracts && forge test --match-test test_roll_podiumrg "PODIUM-ROLL-EMPTY|PODIUM-ROLL-SPARSE" docs/testing/invariants-and-business-logic.mdcd contracts && forge test(expect 4 fork tests FAIL withoutairdrop/doub.csv— pre-existing)Related issue
Relates to #355 (issue stays open until merge).
Security review — MR !528
Commit reviewed:
a824654811746579d1a7563deff71727df11a32cBase:
c91c2cfa59c2eec9931a54e33691ffc5356dddfaScope
contracts/test/TimeArena.t.sol— two new Forge tests (test_roll_empty_pool_tranche_promotion,test_roll_partial_winners), helper_ensureLevelCred, import ofArenaPodiumSettlementdocs/testing/invariants-and-business-logic.md— invariant rows §355skills/play-time-arena-doub/SKILL.md— cross-linksNo production contract, indexer, frontend, or dependency changes in this diff.
Method
Traced attacker-controlled inputs on the exercised onchain paths (
rollPodiumEpoch→_rollPodiumEpoch,PodiumVaults.payPodiumWinners,PodiumVaults.rollEpochTranches,ArenaPodiumSettlement.payoutShares) at MR head SHA. Confirmed existing controls:nonReentranton roll entrypoint,podiumTimerArmed+ deadline gates,msg.sender == arenaon vault mutators, zero-address skip on winner transfers, ledger underflow guard on commingled pools.Test-only
vm.prank(address(arena))+creditTrancheis Foundry setup mirroring arena-only auth — not reachable offchain.Outcome
FINDINGS: 0 medium+
Security review: no medium+ findings on this diff.
No inline threads (nothing to block on).
Automated security review (Cursor Cloud agent).
mentioned in commit
d8fbb7ab2f