HelioxPayments
Fee distribution and referral routing
HelioxPayments handles fee distribution. When a user pays a registration or cycle fee, Heliox calls payWithReferral() to determine how much of that payment should be sent to the referral treasury instead of the configured fee receiver.
Payment Flow
User initiates payment (Register, buyCycleCredits, etc.)
Heliox calls payWithReferral(token, payer, amount, paymentType)
Payments asks the treasury how much of the referral portion is actually eligible for credit
Heliox transfers the distributed portion to ReferralTreasury and the remainder to the designated fee receiver
InvalidDistributedPortion(). This prevents a malicious treasury from draining excess funds.Access Control
Only the Heliox contract can call payWithReferral() or update the treasury pointer on Payments. Governance reachessetReferralTreasury() through Heliox.setReferralTreasury(), not by calling Payments directly.