Contracts: Manual DOUB podium pool top-up (no platform take) #261
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#261
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Context
Arena v2 buy routing (GitLab #249) sends 70% of gross DOUB to prizes (10% → each active podium pool, 7.5% → each next-round seed pool) and 30% to
AdminSellVault. Operators and participants also need a permissionless manual top-up path that boosts prize liquidity without the platform take.Parent epic: #238. Complements #249 (shared
PodiumVaults/ routing helpers).Relevant files
contracts/src/TimeArena.sol— new external entrypointcontracts/src/PodiumVaults.sol(or prize-routing module from #249)contracts/src/Doubloon.sol—transferFrom/ allowancedocs/product/time-arena.md(spec #240) — document donor economicsindexer/src/decoder.rs— ingest new event(s)Behavior
Add a public function (e.g.
topUpPodiumPools(uint256 amountDoubWad)) that:require(amountDoubWad > 0)msg.senderviaIERC20.transferFrom(msg.sender, …, amountDoubWad)(balance-delta parity per #123)amountDoubWadacross the eight prize vaults using the same per-category ratios as buys, but noAdminSellVaultslice:Applied independently for Last Buy, Streak, Time Booster, and WarBow (four categories × two vaults). Integer rounding: document remainder policy (recommend: last vault or largest active pool — match #249).
Equivalence: A manual top-up of 700 DOUB must land the same per-vault increments as the prize portion of a 1000 DOUB buy (100 active + 75 seed per category).
PodiumPoolsToppedUp(donor, amountDoubWad)plus per-vaultPodiumFunded/SeedFundedif reusing #249 events)totalRaisedincrement unless product explicitly wants gross accounting (default: do not count toward buy stats)Acceptance criteria
topUpPodiumPools(amount)pulls DOUB only frommsg.sender(transferFrom); reverts without allowance/balanceAdminSellVault(no 30% platform take)nonReentrantif sharing vault code withbuydocs/product/time-arena.md: manual top-up is voluntary prize sponsorship onlyVerification checklist
topUpPodiumPools(700e18)→ each active pool +100e18, each seed +75e18 (four categories)topUpPodiumPools(1000e18)→AdminSellVaultbalance unchangedtransferFromfailure reverts with no vault mutationmarked as related to #238
marked as related to #249
mentioned in issue #262
marked as related to #262
mentioned in issue #267
marked as related to #267
mentioned in commit
0c9a320299Summary
GitLab #261 (
topUpPodiumPools) was already implemented onmain(shipped with #262 indexer/AUDIT work). This pass verified acceptance, tightened Forge coverage, and cross-linked docs/skills for third-party agents.Onchain (unchanged behavior):
TimeArena.topUpPodiumPools(amountDoubWad)—transferFromcaller, 100% to eight prize vaults viaArenaBuyRouting.splitPrizeTopUpAmount(10:7.5 active:seed per category), noAdminSellVault, nototalDoubRaised/ CRED / XP / timer side effectsPodiumPoolsToppedUp+PodiumFunded/SeedFundedMerged to
main:0c9a320— extra tests + documentation cross-links.Verification checklist
cd contracts && forge test --match-test topUp— all pass (equivalence 700 top-up vs 1000 DOUB buy prize slice, admin vault unchanged on 1000 top-up, allowance revert, event emit)cd contracts && FOUNDRY_PROFILE=ci forge test --match-contract 'ArenaPrizeRouting|TimeArena'— greenapprove(TimeArena, amount)thentopUpPodiumPools(700e18)— eight pools gain 100e18 active + 75e18 seed per category; admin vault balance unchangedGET /v1/arena/podium-pool-donationsshows donor + amount; no rows inidx_arena_vault_fundingfor that tx (buy-only table)@brouie — please verify on your target network when convenient. Leaving issue open until sign-off.
mentioned in commit
ce5a80fef3Verification pass (issue/261-verify worktree)
Re-verified #261 (
TimeArena.topUpPodiumPools) on currentmainafter merging strengthened Forge coverage (ce5a80f).What was verified (automated)
transferFromcaller only; 100% of DOUB to eight prize vaults viaArenaBuyRouting.splitPrizeTopUpAmount(10:7.5 active:seed per category); zeroAdminSellVault; nototalDoubRaised/ CRED / XP / timer side effects; emitsPodiumPoolsToppedUp+PodiumFunded/SeedFunded.cd contracts && forge test --match-test topUp): 9/9 pass, including equivalence 700 top-up vs buy prize slice, admin vault unchanged on 1000 top-up, four PodiumFunded/SeedFunded events, failed transferFrom leaves vaults unchanged, and fuzz no-dust.INV-TIME-ARENA-PODIUM-TOPUP, invariants §261, fee-routing § top-up, arena-v2, play-time-arena-doub;bash scripts/check-doc-anchors.shOK.Not fully exercised in this agent session
scripts/verify-donate-pools-anvil.sh(#262 ingest for PodiumPoolsToppedUp): blocked here by flaky Anvil lifecycle on port 8545. Please run on a clean host.integration_stage2: requiresYIELDOMEGA_PG_TEST_URL(CI).QA checklist (please confirm on your stack)
cd contracts && forge test --match-test topUp— all greenbash scripts/verify-donate-pools-anvil.sh— printsverify-donate-pools-anvil: OKStatus: Leaving open per prior note awaiting operator sign-off on deployed dev + indexer E2E. Requesting verification by the other QA agent team when convenient.
mentioned in commit
ef5ed6cf4cmentioned in issue #260
mentioned in issue #300
mentioned in merge request !440
mentioned in issue #342