Contracts: Play CRED ledger, epoch CHARM, pro-rata CRED yield, claim on Last Buy reset #248
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#248
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
Play CRED non-transferable token, epoch CHARM, and CRED claim flow. Parent epic: #238.
Relevant files
contracts/src/PlayCred.solcontracts/src/TimeArena.sol— epoch CHARM mappingscharmWad[epoch][user]contracts/src/interfaces/IPlayCred.solAcceptance criteria
PlayCred— no transfer;MINTER_ROLEfor TimeArena + admin grantorCredGrantorcontract admin can authorizebuyWithCred(charmWad)burns 70 CRED from buyer; same min/max CHARM rulesclaimCred(epoch)callable after Last Buy epoch ends; zeroscharmWad[epoch][user]; transfers accrued CREDVerification checklist
marked as related to #238
mentioned in issue #238
Implementation summary
PlayCred.sol, epoch CHARM mappings,buyWithCred,claimCred, 35 CRED pool per DOUB buy.Acceptance criteria
buyWithCredburns 70 CREDVerification checklist
test_cred_pro_rata_claim,test_buy_with_credmentioned in issue #268
mentioned in commit
89682a35f6Verification complete (#248)
Verified Play CRED ledger, epoch CHARM weighting, pro-rata CRED yield, and
claimCredon Last Buy epoch reset. Worktree:issue/248-play-cred-verify→ merged tomain@89682a3.What was verified
PlayCrednon-transferable;MINTER_ROLEfor TimeArenaPlayCred.sol,PlayCred.t.sol::test_non_transferable, deploy wiring inTimeArena.t.solsetUpCredGrantordocs/product/time-arena.md)buyWithCredburns CRED; same CHARM min/maxtest_buy_with_cred,test_buyWithCred_reverts_charm_boundstest_cred_accrue_on_doub_buyclaimCred(epoch)after epoch ends; zeros CHARM; mints pro-rataclaimCredinTimeArena.sol,test_cred_pro_rata_claim_accrueCharmAndCred/_accrueCharmOnlyuselastBuyEpochAdded in this verification pass
PlayCred.t.sol— non-transfer + minter role guardstest_cred_pro_rata_exact_1_2_split— two DOUB buyers at 1:2 CHARM split 70 CRED pool (≤1 wei rounding dust)test_claimCred_cannot_double_claimtest_buyWithCred_reverts_charm_boundsINV-PLAY-CRED-NON-TRANSFER, expandedINV-TIME-ARENA-CRED-*indocs/testing/invariants-and-business-logic.mdskills/play-time-arena-doub/SKILL.mdManual verification checklist
cd contracts && forge test --match-contract "TimeArenaTest|PlayCredTest"— all greenPlayCred.transfer/transferFromrevert with"PlayCred: non-transferable"claimCredmints ~23.33 / ~46.67 CRED from 70 CRED poolclaimCredfor same epoch reverts"TimeArena: nothing to claim"buyWithCredbelow 0.99 CHARM or above 10 CHARM reverts"TimeArena: charm bounds"buyWithCredaccrues epoch CHARM but does not incrementepochCredPoolAll automated criteria from the issue body and verification checklist pass. Closing.