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

1

User initiates payment (Register, buyCycleCredits, etc.)

2

Heliox calls payWithReferral(token, payer, amount, paymentType)

3

Payments asks the treasury how much of the referral portion is actually eligible for credit

4

Heliox transfers the distributed portion to ReferralTreasury and the remainder to the designated fee receiver

ValidationThe Payments contract verifies that the treasury never returns more than the referral portion. If it does, the call reverts with 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.