Referrals (TimeCurve): on-chain slugs, routing restrictions, CHARM bonuses, leaderboard #43
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#43
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
End-to-end review and implementation of referrals for TimeCurve (and shared Yieldomega infrastructure): documentation, invariants, smart contracts, indexer, frontend, scripts, and agent skills. This issue is the tracking umbrella for all touchpoints.
Product behavior
On-chain referral slug (identity)
[a-zA-Z0-9]+(alphanumeric only).Restricted words / routing (governance)
timecurve, other top-level app segments).yieldomega.com/{slug}while preventing collisions with product routes.URL capture → persistent referral code (client)
yieldomega.com/{slug}yieldomega.com/timecurve/{slug}(and analogous paths as product routes evolve)TimeCurve purchase incentives (CHARM)
UX requirements (TimeCurve)
Leaderboard (on-chain linked list + indexer)
Deliverables / review checklist
Use this list to scope MRs; check off as completed.
Documentation
docs/testing/invariants-and-business-logic.md(or equivalent): new invariants and test map entries for referrals + TimeCurve purchase paths.Smart contracts
docs/testing/strategy.md.Indexer
Frontend (Yieldomega + TimeCurve)
{slug}vs. product routes using on-chain restricted set (or cached mirror with clear staleness rules).Scripts & tooling
Agent skills / rules (if applicable)
.cursor/skills/or docs underdocs/agents/so future agents treat on-chain state as authoritative and reference new invariants.Open questions (to resolve in design)
Related
docs/product/primitives.mdwhere CHARM flows are defined.mentioned in commit
7ce23157f0Issue 43 — implementation note (pushed to `main` @
7ce2315)Summary: Shipped a focused slice of the referral/TimeCurve umbrella: client capture + routing, a real Referrals surface (on-theme), and a safe TimeCurve sub-route branch so
arena/protocolcannot be lost behind a single dynamictimecurve/:xparam.What changed
Note on issue body vs on-chain spec: The umbrella issue text mentions +5% CHARM per side; `TimeCurve.REFERRAL_EACH_BPS` and `docs/product/referrals.md` are the canonical 10% (1000 bps) each until governance changes the constant.
@brouie — can you run through this checklist on staging or a build from `
7ce2315`?CI: `unit-tests` will run `npm run build` + `test:e2e` with the workflow’s VITE env; local e2e can still be sensitive to a stale preview on :4173 or a mismatched post-launch build.
Follow-up — referral CHARM rate (5% each side)
Completed a consistency pass so per-side referral CHARM matches 5% everywhere that documents or displays this split (not FeeRouter / Rabbit 10% or WarBow 10% steal mechanics).
TimeCurve.REFERRAL_EACH_BPSis 500 (5% ofcharmWadeach to buyer + referrer ascharmWeight).docs/product/referrals.md,contracts/PARAMETERS.mdupdated.TimeCurvePage): copy usesREFERRAL_EACH_BPSviaformatBpsAsPercentwith fallback 5.00% if the read is unavailable.TimeCurveReferral.t.solassertsrefEachfromREFERRAL_EACH_BPS().Merged to
mainand pushed (0f400e0). Note: already-deployed TimeCurve instances keep their prior constant until redeployed or otherwise upgraded—verify liveREFERRAL_EACH_BPSon the target contract.@PlasticDigits #43 verification on
7ce2315+0f400e0.Checklist results
/timecurve/abc12captures to localStorage —referralPathCapture.test.ts5/5 vitest passing; Playwrightreferral-path.spec.tsconfirms localStorage keyyieldomega.ref.v1set withcode: 'abc12'after navigation.?ref=abc12overrides path when both present —applyReferralUrlCaptureinreferralStorage.tscallscaptureFromRefQueryString(search)FIRST; short-circuits if query valid. Docstring and code path consistent./timecurve/arenaand/timecurve/protocolstill show Arena/Protocol —TimeCurveBranchPage.tsxdispatchesarena→TimeCurvePage,protocol→TimeCurveProtocolPage, else →TimeCurveSimplePage.extractReferralCodeFromPathnametest explicitly rejects both segments./referralsUI — arcade shell + register panel — structural code review OK (ReferralRegisterSectionresolves registry viaVITE_REFERRAL_REGISTRY_ADDRESSenv var else TimeCurvereferralRegistry()fallback; reads liveREFERRAL_EACH_BPS; approve +registerCodeflow present; stores plaintext in localStorage on success). Visual render not tested in this session — stack state doesn't match both post-launch + configured-registry requirements in one go, deferring browser walkthrough./homepreservation —LaunchGate.tsxL65-66: post-launch routes are/→TimeCurveSimplePage(index),/home→HomePage. No/:slugcatch-all exists. Protected from shadowing.Follow-up (5% consistency pass on
0f400e0)REFERRAL_EACH_BPS = 500verified consistent across:contracts/src/TimeCurve.sol:76— constant definitioncontracts/src/TimeCurve.sol:305— applied inbuy():(charmWad × 500) / 10_000= 5%contracts/PARAMETERS.md:41— '5% referrer + 5% referee'contracts/test/TimeCurveReferral.t.sol:93— reads fromtc.REFERRAL_EACH_BPS()(not hardcoded, auto-follows future governance changes)docs/product/referrals.md— consistentFrontend
TimeCurvePageusesformatBpsAsPercentwith 5.00% fallback when live read unavailable.What I did NOT verify
/referralspage (arcade shell, hero, sections)registerCodetx against a live stack (approve → register → localStorage write flow)The umbrella items remain open in the body — this note signs off only on what landed in
7ce2315+0f400e0. Leaving issue open as the umbrella tracker; individual future shipped slices can be signed off similarly.mentioned in issue #42
The visual render review is important - if it is challening enough to deserve its own issue, please open one. @Brouie
mentioned in issue #59
mentioned in issue #64
mentioned in issue #223