Contracts: Referrals earn Play CRED (5% + 5%) instead of CHARM weight #253
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#253
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
Adapt referrals to mint Play CRED instead of CHARM weight bonuses. Parent epic: #238.
Relevant files
contracts/src/ReferralRegistry.solcontracts/src/TimeArena.soldocs/product/referrals.mdfrontend/src/pages/referrals/Acceptance criteria
codeHash → ownermappings preserved in redeploy or merkle/import script documentedReferralAppliedschema updatedVerification checklist
/referralspage shows CRED earnings not CHARMmarked as related to #238
mentioned in issue #238
Implementation summary
ReferralCredApplied; removed CHARM weight bonuses.Acceptance criteria
Verification checklist
/referralsUI copy (follow-up)mentioned in commit
a5572871f5Verification complete (agent @
c7eda6a)Issue #253 verified on worktree
issue/253-referral-cred, merged tomain.Findings
TimeArena._accrueCharmAndCredalready minted 5% + 5% ofCRED_PER_BUYviaReferralCredApplied(no CHARM weight bonus). Gaps were tests, indexer HTTP (still queried legacy CHARM table), and/referralsUI copy.Changes
test_referred_buy_mints_cred_not_charm,test_self_referral_revertsinTimeArena.t.sol/v1/referrals/applied,referrer-leaderboard,wallet-cred-summaryreadidx_arena_referral_credwithreferrer_cred/total_referrer_cred_wadfields; legacy/wallet-charm-summaryalias retainedidx_arena_referral_cred(referrer|buyer)/referralsearnings + leaderboard show CRED;indexerApitypes updatedreferrals.md(code continuity + CRED math),INV-REFERRAL-253-CRED, manual QA §253, guardrails 6f, indexer design crosslinkAutomated checks (passed)
FOUNDRY_PROFILE=ci forge test --match-test test_referred_buy_mints_cred_not_charmFOUNDRY_PROFILE=ci forge test --match-test test_self_referral_revertscargo test --lib api::npm run typecheck(via pre-commit)Manual verification checklist (@brouie — after indexer rebuild)
Running stack still serves x-schema-version: 2.2.0 (infra left up per agent policy). After
cargo run/indexer restart + migration apply:GET /v1/referrals/referrer-leaderboard?limit=1returnstotal_referrer_cred_wad(nottotal_referrer_charm_wad)TimeArena.buy(charm, codeHash)indexes row inidx_arena_referral_credwithreferrer_cred = buyer_cred = 1.75e18(default params)GET /v1/referrals/wallet-cred-summary?wallet=<referrer>showsreferrer_cred_wad > 0/referralsYour earnings panel labels CRED; leaderboard ranks by CREDTimeArena: self-referralReferralRegistryUUPS upgrade preservescodeOwner; fresh deploy requires re-registration (documented indocs/product/referrals.md)Closing — acceptance criteria satisfied in merged code + tests; post-restart smoke above confirms live stack.
mentioned in issue #272