Deploy: TimeArenaBuyRouter on Anvil + setTimeArenaBuyRouter + default ETH E2E wiring #270
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#270
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?
Summary
Automate local Anvil deployment of
TimeArenaBuyRouter, wireTimeArena.setTimeArenaBuyRouter, and exportVITE_KUMBAYA_TIME_ARENA_BUY_ROUTERsoscripts/e2e-anvil.shruns the ETH pay Playwright case without manual env. Closes the deploy gap left after onchain #251 and frontend #264.Parent epic: #238. Related: #84 (registry + Vite merge), #78 (buy-router verification).
Current codebase
Onchain (done in #251)
TimeArenaBuyRouter.sol—buyViaKumbaya(ETH / stable / CL8Y → KumbayaexactOutput→ DOUB →TimeArena.buyFor). Paths end in DOUB (not CL8Y).TimeArena.sol—timeArenaBuyRouter,setTimeArenaBuyRouter(address)(owner),buyForrestricted to router.Deploy / scripts (gap)
DeployDev.s.soldeploys Arena v2 (TimeArena, vaults,Doubloon, etc.) andstartArena()but does not deploy a buy router or callsetTimeArenaBuyRouter.DeployKumbayaAnvilFixtures.s.solis referenced throughout docs and shell (scripts/lib/anvil_deploy_dev.sh,scripts/start-local-anvil-stack.sh,docs/integrations/kumbaya.md) but is not present undercontracts/script/(onlyDeployDev.s.solandDeployProduction.s.solexist today).TimeCurveBuyRouterSolidity was retired; scripts still grep log lines forTimeCurveBuyRouter (single-txand registry keyTimeCurveBuyRouter(scripts/lib/kumbaya_local_anvil_env.sh).scripts/e2e-anvil.shrunsDeployDevonly; setsVITE_KUMBAYA_TIME_ARENA_BUY_ROUTERonly whenKUMBAYA_BUY_ROUTERis non-empty after optionalYIELDOMEGA_DEPLOY_KUMBAYA=1— which currently does not run in the default E2E path.scripts/verify-time-arena-buy-router-anvil.shis a stub (prints instructions, exits 0).Frontend (done in #264)
resolveTimeArenaBuyRouterForKumbayaSingleTxandsubmitArenaKumbayaSingleTxBuywhen onchaintimeArenaBuyRouteris set.anvil-arena-wallet-writes.spec.tsskips ETH pay unlessVITE_KUMBAYA_TIME_ARENA_BUY_ROUTER(or legacy alias) is set at build time.Fixtures
AnvilKumbayaFixture.sol—AnvilWETH9,AnvilMockUSDM,AnvilKumbayaRouter(swap + quoter) for local constant-product pools.Why this is needed
DeployKumbayaAnvilFixtures— references assume a script that must be restored or replaced with an Arena v2 variant.docs/frontend/arena-views.md) require a non-zerotimeArenaBuyRouteron devnet for integrators and agents runningbash scripts/e2e-anvil.sh.Constraints and guardrails
DevOnlyChainGuard.assertDevScriptChain()(Anvil / MegaETH testnet only) — same asDeployDev(docs/contracts/foundry-and-megaeth.md).buyForrouter gate — seedocs/product/arena-v2.mdanddocs/testing/invariants-and-business-logic.md.TimeCurveBuyRouteras the Arena authority (#244).AnvilKumbayaRoutersoexactOutputsucceeds for ETH/USDM paths used by the frontend (#264).doubSurplusRecipient: Use a documented dev sink (e.g. deployer orAdminSellVault) — constructor reverts on zero (#251).TimeArenaBuyRoutertocontracts/deployments/local-anvil-registry.json(and example JSON); optionalBuyViaKumbayadecode follow-up — minimum: do not break existingBuyingest.docs/testing/strategy.md.Relevant files
TimeArenaBuyRouter.sol,TimeArena.sol,AnvilKumbayaFixture.solcontracts/script/DeployKumbayaAnvilFixtures.s.sol(orDeployArenaKumbayaAnvilFixtures.s.sol)scripts/lib/anvil_deploy_dev.sh,scripts/e2e-anvil.sh,scripts/lib/kumbaya_local_anvil_env.sh,scripts/start-local-anvil-stack.sh,scripts/verify-time-arena-buy-router-anvil.shcontracts/deployments/local-anvil-registry.json,contracts/deployments/kumbaya-anvil-registry.example.jsoncontracts/script/export_abi_hashes.shcontracts/test/TimeArenaBuyRouter*.t.sol(local + optional fork)frontend/e2e/anvil-arena-wallet-writes.spec.tsdocs/integrations/kumbaya.md,docs/testing/e2e-anvil.md,docs/testing/local-swap-testing.md,skills/play-time-arena-doub/SKILL.mdRecommended direction
Add
DeployKumbayaAnvilFixtures.s.sol(Arena v2)TimeArenaproxy address (fromDeployDev).AnvilWETH9,AnvilMockUSDM,AnvilKumbayaRouter,TimeArenaBuyRouter(immutable args: arena, kumbaya router,doub, reserve/CL8Y token, WETH, USDM, surplus recipient, owner).exactOutputpaths (ETH: DOUB←WETH; USDM: DOUB←WETH←USDM).TimeArena.setTimeArenaBuyRouter(router)in same broadcast (deployer = owner).TimeArenaBuyRouter (single-tx): 0x….Wire
anvil_deploy_dev.shYIELDOMEGA_DEPLOY_KUMBAYA=1forscripts/e2e-anvil.sh(or always run fixtures afterDeployDevin that script only).TimeArenaBuyRouterlog label; setKUMBAYA_BUY_ROUTER.cast call $TA "timeArenaBuyRouter()(address)"equals deployed router.Registry + Vite helpers
yieldomega_registry_merge_*forTimeArenaBuyRouter.yieldomega_frontend_merge_kumbaya_vite_full: setVITE_KUMBAYA_TIME_ARENA_BUY_ROUTER(keep legacyVITE_KUMBAYA_TIMECURVE_BUY_ROUTERonly if still needed for transitional tooling).Implement
verify-time-arena-buy-router-anvil.shforge test --match-contract TimeArenaBuyRouter→ spot-check onebuyViaKumbaya(ETH) on Anvil.Forge tests
StableIngressParity, bad path, paused arena, charm bounds, expired deadline.E2E
e2e-anvil.shalways provides router env; document thatYIELDOMEGA_DEPLOY_KUMBAYA=0opts out.Acceptance criteria
DeployKumbayaAnvilFixtures(or renamed equivalent) exists, passesDevOnlyChainGuard, and broadcasts on Anvil.bash scripts/e2e-anvil.sh:TimeArena.timeArenaBuyRouter()is non-zero and equals deployedTimeArenaBuyRouter.scripts/e2e-anvil.shexportsVITE_KUMBAYA_TIME_ARENA_BUY_ROUTERwithout manual steps.anvil-arena-wallet-writes.spec.tsruns (not skipped) on CI/local when usinge2e-anvil.sh.local-anvil-registry.json(or merge helper) includesTimeArenaBuyRouterwhen fixtures run.verify-time-arena-buy-router-anvil.shperforms real checks (non-stub) and exits non-zero on failure.TimeCurveBuyRouteras Arena authority.Test plan — functional paths
bash scripts/e2e-anvil.shcast calltimeArenaBuyRouterbuyViaKumbayaBuy/BuyViaKumbayaeventbuyViaKumbayaYIELDOMEGA_DEPLOY_KUMBAYA=0 bash scripts/e2e-anvil.shYIELDOMEGA_DEPLOY_KUMBAYA=1 bash scripts/start-local-anvil-stack.sh.env.localmergedbash scripts/verify-time-arena-buy-router-anvil.shAutomated:
forge test --match-contract TimeArenaBuyRouter; frontend build unchanged; optional indexercargo testif registry decode extended.Test plan — attack / abuse vectors
setTimeArenaBuyRouterat non-router contractbuyViaKumbayaselector or post-deploy smoke callsetTimeArenaBuyRouteron prod pathssetTimeArenaBuyRouteron AnvilsetTimeArenaBuyRouterwithout ownercast sendfrom random key revertsexactOutputwith empty reservesStableIngressParityrevert on routerDevOnlyChainGuardrevertsVerification criteria
forge testgreen for newTimeArenaBuyRoutersuite.bash scripts/e2e-anvil.shgreen including ETH wallet-write spec.cast callspot-check: router address,paused()==false, arena live.DeployKumbayaAnvilFixturesreferences resolve to an existing.s.solfile.docs/testing/manual-qa-checklists.mdArena ETH/USDM rows (if present) pass on Anvil.mentioned in commit
46d347b491mentioned in commit
6616779e30Summary (#270)
Implemented Arena v2 Kumbaya Anvil fixtures and default ETH pay E2E wiring on
main(6616779).Delivered
contracts/script/DeployKumbayaAnvilFixtures.s.sol—AnvilWETH9,AnvilMockUSDM,AnvilKumbayaRouter,TimeArenaBuyRouter, DOUB pool seeding,setTimeArenaBuyRouter,DevOnlyChainGuard.scripts/e2e-anvil.sh— defaultsYIELDOMEGA_DEPLOY_KUMBAYA=1, exportsVITE_KUMBAYA_TIME_ARENA_BUY_ROUTER, kills stale Anvil on port before start.scripts/lib/anvil_deploy_dev.sh+kumbaya_local_anvil_env.sh— parseTimeArenaBuyRouter, registry merge, Vite merge (legacyTimeCurveBuyRouterlog alias kept).scripts/verify-time-arena-buy-router-anvil.sh— real deploy + cast checks +forge test --match-contract TimeArenaBuyRouter.contracts/test/TimeArenaBuyRouter.t.sol— ETH/USDM happy paths, stable ingress parity, revert cases.TimeArena._buyDoubpulls DOUB fromtimeArenaBuyRouterwhenbuyForis used (was incorrectly pulling from buyer wallet).INV-DEV-KUMBAYA-270-*,INV-TIME-ARENA-BUYFOR-PULL,local-swap-testing.md,e2e-anvil.md,skills/play-time-arena-doub/SKILL.md.Verification checklist for @brouie
cd contracts && forge test --match-contract TimeArenaBuyRouterbash scripts/verify-time-arena-buy-router-anvil.sh(fresh Anvil; exits 0)YIELDOMEGA_DEPLOY_NO_COOLDOWN=1 bash scripts/e2e-anvil.sh— confirm log lineTimeArenaBuyRouter=…andcast call $TA timeArenaBuyRouter()(address)matchesfrontend/e2e/anvil-arena-wallet-writes.spec.tsruns (not skipped) when router env is setYIELDOMEGA_DEPLOY_KUMBAYA=0 bash scripts/e2e-anvil.sh— DOUB path still deploys; ETH test skipped with messageYIELDOMEGA_DEPLOY_KUMBAYA=1 bash scripts/start-local-anvil-stack.sh—local-anvil-registry.jsonincludesTimeArenaBuyRouterNotes
@brouie — please verify on a clean Anvil run when you have a moment. Leaving issue open until confirmed.
mentioned in issue #259
mentioned in commit
5079fde4d5mentioned in commit
2baf79563fmentioned in issue #260
QA verification (#270) — passed
Verified on branch
main@096c6f9using worktreeissue/270-verify(clean Anvil, no code changes required).What was run
cd contracts && forge test --match-contract TimeArenaBuyRouter— 11/11 passed (TimeArenaBuyRouter.t.sol) + forkVerifyTimeArenaBuyRouterAnvil.t.sol::test_Forked_issue251_eth_usdm_cl8y_pathspassed.bash scripts/verify-time-arena-buy-router-anvil.sh— fresh Anvil → DeployDev + DeployKumbayaAnvilFixtures →timeArenaBuyRoutermatches loggedTimeArenaBuyRouter; registry merge + Vite env; exit 0.YIELDOMEGA_DEPLOY_NO_COOLDOWN=1 bash scripts/e2e-anvil.sh— DeployDev + Kumbaya fixtures; logTimeArenaBuyRouter=0x1613…78E8; 6/6 Playwright passed including ETH pay (anvil-arena-03-wallet-writes.spec.ts— not skipped).YIELDOMEGA_DEPLOY_KUMBAYA=0 bash scripts/e2e-anvil.sh— DOUB + CRED paths pass; ETH case skipped with router message (5 passed, 1 skipped).DeployKumbayaAnvilFixturesdoc/script references resolve tocontracts/script/DeployKumbayaAnvilFixtures.s.sol.Acceptance criteria (issue body)
DeployKumbayaAnvilFixturesexists,DevOnlyChainGuard, broadcasts on Anvile2e-anvil.sh:timeArenaBuyRouter()non-zero and equals deployed routerVITE_KUMBAYA_TIME_ARENA_BUY_ROUTERexported without manual stepslocal-anvil-registry.jsonincludesTimeArenaBuyRouterafter fixturesverify-time-arena-buy-router-anvil.shreal checks, exit 0 on successINV-DEV-KUMBAYA-270-*,e2e-anvil.md,local-swap-testing.md,play-time-arena-doub/SKILL.md); no stale TimeCurve authorityVerification checklist for follow-up
cd contracts && forge test --match-contract TimeArenaBuyRouterbash scripts/verify-time-arena-buy-router-anvil.sh(fresh Anvil)YIELDOMEGA_DEPLOY_NO_COOLDOWN=1 bash scripts/e2e-anvil.sh— confirm ETH wallet-write spec greenYIELDOMEGA_DEPLOY_KUMBAYA=0 bash scripts/e2e-anvil.sh— ETH skipped, DOUB greenYIELDOMEGA_DEPLOY_KUMBAYA=1 bash scripts/start-local-anvil-stack.sh— registry +.env.local(requires Postgres/docker stack)docs/testing/manual-qa-checklists.mdon Anvil (optional; onchain covered by Forge + verify script)Notes
start-local-anvil-stack.shdeploy/registry merge for Kumbaya succeeded; script exited 1 only because local Postgres container was not running (unrelated to router wiring).mainalready satisfies #270.Closing as all issue-body acceptance criteria and verification criteria pass.
mentioned in commit
55e57688e7