Background
Issue 52 designs a referral program. This issue implements the on-chain settlement logic: referral fees should be paid out automatically when a referred expert earns from a session.
Goal
During settle_session, if the expert has a referrer, calculate and transfer the referral commission atomically.
Acceptance Criteria
- Referral commission =
expert_earnings * referral_bps / 10000.
- Deducted from platform fee, not expert earnings.
- Commission only applies for the first 50 sessions of a referred expert (configurable).
- Emits
ReferralCommissionPaid { referrer, referee, amount }.
Key Files
contracts/src/lib.rs, contracts/src/governance.rs
Background
Issue 52 designs a referral program. This issue implements the on-chain settlement logic: referral fees should be paid out automatically when a referred expert earns from a session.
Goal
During
settle_session, if the expert has a referrer, calculate and transfer the referral commission atomically.Acceptance Criteria
expert_earnings * referral_bps / 10000.ReferralCommissionPaid { referrer, referee, amount }.Key Files
contracts/src/lib.rs,contracts/src/governance.rs