Guides
Using Hooks
Referral programs are made up of hooks, which are smart contracts that get called every time the referral program is interacted with.
Inheriting the hook interface
In order to make your hook smart contracts compatible with ERP, they must inherit the IERPHook interface.
Overriding hook functions
The hook interface has two functions, beforeReferral
and afterReferral
. These functions are called before and after a referral respectively. You can override these functions to develop your own custom logic which is run atomically on new referrals.