LayerCover

IReferralManager

Interface for the referral and rewards system.

View deployed contract addresses in the Contract Addresses section.

The IReferralManager tracks referral codes and calculates rewards for referrers. It integrates with the PolicyManager to apply referral rewards during policy purchase.

Interface

// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.20;

/**
 * @title IReferralManager
 * @notice Interface for referral-code validation and reward accounting.
 */
interface IReferralManager {
    function recordReferral(
        bytes32 code,
        address buyer,
        uint256 policyId,
        uint256 premiumPaid,
        uint256 referrerRewardBpsUsed
    ) external returns (address referrer, uint256 rewardAmount);

    function isValidCode(bytes32 code) external view returns (bool);

    function getReferrer(bytes32 code) external view returns (address);

    function referrerRewardBps() external view returns (uint256);

    function fundReferralReward(address referrer, uint256 amount, uint256 policyId) external;

    function getPendingPolicyReward(uint256 policyId) external view returns (uint256);

    function getPolicyReferrer(uint256 policyId) external view returns (address);
}