Referral program for a site using waves token?

How to create a referral program for a website using waves token? Maybe there are ready-made scripts or other solutions?