Contracts: TimeArena core — Last Buy timer, buys, fixed CHARM price #246
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#246
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
Core TimeArena contract: Last Buy timer, DOUB buys, fixed CHARM price. Parent epic: #238.
Relevant files
contracts/src/TimeArena.sol(or refactorTimeCurve.sol)contracts/src/libraries/TimeMath.sol— parameterize per-timer profilescontracts/PARAMETERS.mdTimeArena.t.solAcceptance criteria
buy(charmWad)pulls DOUB =charmWad × charmPriceWad / 1e18with default 1000e18 DOUB per 1e18 CHARMsetCharmPriceWad(or bps) mutableLastBuyEpochStartedTimeMathenvelope or simplified fixed band per spec)Verification checklist
marked as related to #238
mentioned in issue #238
Implementation summary
TimeArenacore: DOUB buys, fixedcharmPriceWad, Last Buy timer, CHARM band, cooldown, referral CRED path prep.contracts/test/TimeArena.t.sol(extension, hard reset, routing).Acceptance criteria (close when all checked)
buy(charmWad)DOUB pull at default 1000e18/CHARMsetCharmPriceWadlastBuyEpochon hard resetVerification checklist
forge test --match-contract TimeArenaTestmentioned in commit
d1daf8cd4bmentioned in commit
ce8ff8d5dcmentioned in commit
7a2cef3a57Verification complete (#246)
Verified TimeArena core — Last Buy timer, DOUB buys, fixed CHARM price — on worktree
issue/246-timearena-core-verify, merged tomainasce8ff8d.What was done
TimeArena.sol(buy,setCharmPriceWad, timer 24h/+120s/13m→15m hard reset,lastBuyEpoch+LastBuyEpochStarted, CHARM band 0.99–10, buy cooldown).testFuzz_buy_charmInBand_doubPullParity— DOUB pull =charmWad × charmPriceWad / 1e18testFuzz_buy_charmBelowMin_reverts/testFuzz_buy_charmAboveMax_revertstestFuzz_setCharmPriceWad_doubOwedtest_feeOnTransfer_buy_reverts_erc20Parity(#123 style)TimeMath.t.sol::testFuzz_extendDeadlineOrReset_arenaProfile(+ unit tests for arena timer profile)test_emits_LastBuyEpochStarted_on_hard_reset, charm bounds, cooldown,setCharmPriceWad.PARAMETERS.md,strategy.md,skills/play-time-arena-doub/SKILL.md.Forge (ran on merged main)
Manual verification checklist
forge test --match-contract TimeArenaTest— timer extension, hard reset, epoch rollover, fuzz parityforge test --match-contract TimeMathTest— arena timer profile fuzzcharmPriceWad = 1000e18, 1 CHARM buy pulls 1000 DOUB (40/30/30 split)TimeArena: charm boundsbuyCooldownSecrevertsTimeArena: buy cooldownLastBuyEpochStartedsetCharmPriceWadchanges DOUB owed on next buyAll issue-body acceptance criteria and verification checklist items pass. Closing.
mentioned in issue #278
mentioned in issue #303
mentioned in issue #305
marked as related to #305