Ethereum Referral Protocol
Interfaces

IERP.sol

contracts/src/IERP.sol

getReferralProgram

function getReferralProgram(
    uint256 programId
) external view returns (
    address[] memory hooks
)

Parameters

NameTypeDescription
programIduint256Unique ID of the referral program

Returns

NameTypeDescription
hooksaddress[]Array of referral hooks

getTotalReferrals

function getTotalReferrals(
    uint256 programId,
    address account
) external view returns (
    uint256 total
)

Parameters

NameTypeDescription
programIduint256Unique ID of the referral program
accountaddressAddress of the referee

Returns

NameTypeDescription
totaluint256Referrers total referrals in a program

getReferral

function getReferral(
    uint256 programId,
    address account
) external view returns (
    address referral
)

Parameters

NameTypeDescription
programIduint256Unique ID of the referral program
accountaddressAddress of the referee

Returns

NameTypeDescription
referraladdressAddress of the referrer

newReferralProgram

function newReferralProgram(
    address[] memory hooks
) external returns (
    uint256 programId
)

Parameters

NameTypeDescription
hooksaddress[]Array of referral hooks

Returns

NameTypeDescription
programIduint256Unique ID of the referral program

setReferral

function setReferral(
    uint256 programId, 
    address referral
) external

Parameters

NameTypeDescription
programIduint256Unique ID of the referral program
referraladdressAddress of the referrer

On this page