Retire TimeCurve v1 surfaces — routes, indexer aliases, env, and legacy UX
Summary
Remove remaining TimeCurve v1 launchpad surfaces from the product, indexer HTTP API, frontend routes/naming, deploy env, and contributor docs — after Arena v2 (TimeArena) is the sole live game contract. This is the cross-repo retirement umbrella; contract deletion is largely done (#243 (closed)); docs cleanup is tracked in #263 (closed).
Coordinate with: #264 (closed) (Arena frontend buy/router migration) — retirement should not leave /timecurve/arena on TimeCurve ABI; finish #264 (closed) first or in the same release train.
Parent epic: #238 (closed).
Current codebase
Contracts (mostly retired)
contracts/src/ships Arena v2 only:TimeArena,PodiumVaults,AdminSellVault,Doubloon,PlayCred,ReferralRegistry,TimeArenaBuyRouter, fixtures.- No
TimeCurve.sol,FeeRouter,RabbitTreasury, orLeprechaunincontracts/src/. DeployDev.s.soldeploys Arena stack only.- Legacy still in repo: deploy scripts (
scripts/deploy-megaeth-contracts.sh),DeployProductionreferences, fork tests, public ABIs underfrontend/public/abis/TimeCurve*.json, README mainnet TimeCurve proxy row.
Indexer (Arena-primary, TimeCurve-named HTTP)
- Ingestion decodes Arena v2 + ReferralRegistry only (
INV-INDEXER-260-NO-TIMECURVE-DECODE). - Registry watches
TimeArena,PodiumVaults,AdminSellVault,ReferralRegistry. - Legacy HTTP paths remain, e.g.:
GET /v1/timecurve/sale-state— head-RPC snapshot reused for Simple session (sale_state.rs)GET /v1/timecurve/chain-timer,platform-usage,warbow/battle-feed, etc.
- Arena-native routes exist:
GET /v1/arena/buys,timers,podium-pool-donations, etc.
Frontend (mixed naming and routes)
| Route | Today | Issue |
|---|---|---|
/ (post-launch) |
TimeArenaPage |
OK — rename internals optional |
/arena |
Simple Arena (TimeCurveSimplePage + bridge) |
Uses VITE_TIMECURVE_ADDRESS alias + arenaV2SaleSessionBridge |
/timecurve |
Redirect → /arena |
Legacy path kept |
/timecurve/arena |
TimeCurvePage → useTimeCurveArenaModel (TimeCurve ABI) |
Must migrate or remove (#264 (closed)) |
/timecurve/protocol |
AUDIT (TimeCurveProtocolPage) |
TimeCurve-named components; donate pools card works |
/vesting |
Presale vesting (if routed) | #243 (closed) scope |
addresses.ts:timeCurvealias fromVITE_TIMECURVE_ADDRESS??VITE_TIME_ARENA_ADDRESS.- Hundreds of
TimeCurve*filenames and CSS classes (timecurve-*). - Kumbaya env:
VITE_KUMBAYA_TIMECURVE_BUY_ROUTER(TimeCurve-era name). FeeTransparencyalready Arena vault copy whenVITE_TIME_ARENA_ADDRESSset.
Docs / ops / skills
docs/operations/deployment-guide.md— still TimeCurve/UUPS/buy-router centric.- Play skills reference
GET /v1/timecurve/sale-stateas fallback. docs/onchain/fee-routing-and-governance.md— FeeRouter (retired #244 (closed)).- Invariant file still ~1.6k lines of v1 anchors (#263 (closed)).
Why this is needed
- Product truth: Arena v2 is always-live; there is no TimeCurve sale-end, CHARM redemption, or FeeRouter CL8Y buy path. Keeping TimeCurve routes and env names confuses operators, agents, and participants.
- Safety: A misconfigured
VITE_TIMECURVE_ADDRESSpointing at an old proxy while/arenausesVITE_TIME_ARENA_ADDRESScan re-enable wrong ABI reads (#264 (closed) addresses Advanced view; retirement removes the alias footgun). - Indexer clarity: Dual
/v1/timecurve/*and/v1/arena/*APIs duplicate concepts; frontend should consume arena routes only for game state. - Maintenance cost: E2E, manual QA, and agent skills still mention retired flows — grep noise blocks confident refactors.
Constraints and guardrails
- Do not reintroduce Leprechaun (#241 (closed)), Rabbit/Burrow (#242 (closed)), TimeCurve sale-end/redemption (#243 (closed)), FeeRouter five-sink CL8Y (#244 (closed)).
- Preserve
/vesting+DoubPresaleVestingonly if product still requires claims on mainnet — otherwise fold into #243 (closed) and remove here. - Onchain authority unchanged:
TimeArenaeconomics perarena-v2.md. - AGPL-3.0; one SQL transaction per block for indexer (#140 (closed)).
- Production indexer guards (#142 (closed), #156 (closed)).
- Breaking changes OK for env vars and HTTP paths if versioned (
x-schema-versionbump) and documented in deploy runbooks. - Historical mainnet data: indexer may still serve read-only legacy tables for archived TimeCurve txs if needed — separate from removing decode of new blocks (already off). Do not delete historical DB tables without migration plan.
Relevant files
| Layer | Files |
|---|---|
| Routing | frontend/src/app/LaunchGate.tsx, RootLayout.tsx, surfaceContent.ts, footerSiteLinks.ts |
| Pages to remove/redirect | TimeCurveBranchPage.tsx, legacy stake/redemption sections, TimeCurveProtocolDoubProjectionSection.tsx (sale projection) |
| Env / addresses | addresses.ts, .env.example, scripts/check-frontend-vite-env.sh, scripts/e2e-anvil.sh, scripts/start-local-anvil-stack.sh |
| Indexer HTTP | indexer/src/api.rs, sale_state.rs, api_arena.rs, indexer/README.md |
| Kumbaya naming | kumbayaRoutes.ts, timeCurveKumbayaSingleTx.ts |
| ABIs / artifacts | frontend/public/abis/TimeCurve*.json, TimeCurveBuyRouter.json (keep only if historical pages remain) |
| Deploy / registry | indexer/address-registry.megaeth-mainnet.json, scripts/deploy-megaeth-contracts.sh, scripts/write-production-registry-from-broadcast.sh |
| Docs | #263 (closed) files + docs/frontend/arena-views.md, docs/integrations/kumbaya.md |
| Tests / E2E | frontend/e2e/timecurve*.spec.ts, timecurve-live-buys-modals.spec.ts — rename or retire |
Recommended direction
Phase A — Product routes (breaking OK)
- Canonical routes:
/arena(play),/arena/protocolor/protocol(AUDIT) — drop/timecurve/*or 301 to arena equivalents inLaunchGate. - Remove
/timecurve/arenaafter #264 (closed) merges Advanced features into shared Arena session or redirect to/arenawith sub-nav query. - Env: require
VITE_TIME_ARENA_ADDRESS(+ vault vars); removeVITE_TIMECURVE_ADDRESSfrom checklists and scripts. - Rename user-visible “TimeCurve” → “Time Arena” where still shown (hero titles, subnav).
Phase B — Indexer HTTP migration
- Add/rename
GET /v1/arena/sale-state(or extendGET /v1/arena/timers) with fields Simple session needs; deprecateGET /v1/timecurve/sale-state(410 or redirect doc). - Migrate
platform-usage/ WarBow feed to arena semantics (DOUB spends) or mark deprecated. - Bump
x-schema-version; document in README.
Phase C — Code hygiene
- Delete unused TimeCurve ABIs and frontend modules tied to sale-end/redemption/envelope curve.
- Rename files incrementally (
TimeCurveSimplePage→ArenaSimplePage) or one-shot rename PR — team preference; avoid dual names long-term. - Update play skills to
GET /v1/arena/*only. - Trim deploy guide to Arena +
TimeArenaBuyRouter(coordinate env rename with #264 (closed)).
Phase D — Docs (#263 (closed))
Land doc deletion in parallel or as sub-task — do not block route removal on full invariant file rewrite.
Acceptance criteria
- No production route requires
VITE_TIMECURVE_ADDRESS. -
/timecurvepaths redirect or 404 with clear migration note (no empty outlets). - Simple + Advanced play surfaces read TimeArena only (no
timeCurveReadAbifor session state). - Frontend indexer reads use
/v1/arena/*for timers/sale snapshot (not/v1/timecurve/sale-state). -
scripts/check-frontend-vite-env.shvalidates Arena env only. - Grep
contracts/srcstays clean ofTimeCurve/FeeRouterimplementations. - Retired E2E specs removed or rewritten for
/arenaonly. - README quick-reference reflects TimeArena proxy addresses (not TimeCurve launchpad).
- #243 (closed) items either done or explicitly deferred with issue link (vesting, presale pages).
Test plan — functional paths
| # | Path | Expected |
|---|---|---|
| 1 | Visit /timecurve |
Lands on /arena (or documented redirect) |
| 2 | Visit /timecurve/arena |
Redirect to /arena or equivalent Advanced tab |
| 3 | Visit /timecurve/protocol |
AUDIT page at new canonical URL |
| 4 | make check-frontend-env with only Arena vars |
Pass |
| 5 | Anvil stack start | Writes VITE_TIME_ARENA_* only |
| 6 | Indexer GET /v1/arena/timers + sale fields |
Powers Simple UI without timecurve path |
| 7 | Deep link old URL bookmark | Still reaches correct content (redirect) |
| 8 | /vesting |
Per #243 (closed): removed or still works independently |
Automated: npm test, cargo test, ANVIL_E2E=1 arena specs; grep CI job or script for forbidden strings (buyFeeRoutingEnabled on Arena, redeemCharms, endSale in frontend src).
Test plan — attack / abuse vectors
| Vector | Test | Expected |
|---|---|---|
| Wrong env alias | Set only legacy VITE_TIMECURVE to random contract |
App fails closed / does not send buys to wrong ABI |
| Stale indexer path | Point frontend at deprecated /v1/timecurve/sale-state after removal |
404 handled — no fake “sale active” UI |
| Open redirect | New redirects only to same-origin arena routes | No arbitrary URL redirects |
| Historical ABI phishing | UI never loads retired TimeCurve write ABI for /arena |
Only timeArenaReadAbi / router ABI |
Verification criteria
- CI green across contracts (unchanged), indexer, frontend.
- Manual QA checklist updated — no
/timecurve/arenaTimeCurve-only rows. -
rg -l 'VITE_TIMECURVE_ADDRESS' frontend scripts→ empty or migration shim with deprecation comment + removal date. - Indexer README lists canonical Arena HTTP table; timecurve paths marked deprecated/removed.
- Deploy runbook for next mainnet release uses Arena registry fields only.
- Close or link child issues: #243 (closed), #263 (closed), #256 (closed), #264 (closed).
Out of scope
- Mainnet decommission of deployed TimeCurve proxy (onchain artifact may remain forever).
- Full CSS/class rename (
timecurve-*→arena-*) — optional follow-up if too large for one PR. - Indexer ingest of
PodiumFunded/SeedFunded/AdminVaultFunded— separate issue (buy funding events).