Ethereum Referral Protocol
Guides

Creating Programs

In this guide, you will create a new referral program.

Calling newReferralProgram

function newReferralProgram(
    bytes32 programId,
    address hook
) external

When calling the newReferralProgram function on the ERP smart contract you will need to provide a unique program ID. This unique ID is what will be used to reference your referral program in the future.

This function also takes an address parameter called hook, this is an address that must inherit the IERPHook interface, and will be called before, and after all new referrals, and is how you will build your custom referral logic. Or you can use the zero address to prevent any custom logic.

On this page