I'm building a DApp in solidity where I want give a bonus to the users that wants promote it. My problem is that, to use my Referral system, now I need to insert manually the wallet address of the person who promote the DApp to send him the bonuses. My expextation is to build a Referral System like the steps listed below:

1) Referral link creation sumbitting the opreration into the smart contract;

2) Smart Contract will generate a unique referral link composed like the example: https://DApp.org/"wallet address"

3) Sharing the link, the players who will click on, will be automatically added, by the Smart Contract, to the frineds list.

Anyone can help me??



As I see it, you can create it very easily.

1) Have that kind of referral link

2) Whenever someone enters your site with a referral link your backend gives a reward to the address in the referral link. For example mints him some tokens or so. So your backend sends a transaction to your contract to issue whatever reward. Or if the reward is not related to the blockchain then you don't even need the transaction.

Of course there are many security issues with such a simple approach (such as nothing preventing users referring themselves) but the basic idea should work.

  • Thanks a loto for your reply. Have you an example code to be implemented and test? Cinsider that i'm working for TRON blockchain but it is similar to Ethereum – Crypto Value Mar 18 '19 at 12:28
  • No, I don't have example code and I have no idea how Tron works. You should ask Tron questions in Tron forums, not here. – Lauri Peltonen Mar 18 '19 at 12:29
  • the Ethereum code is the same... can be easily used also for TRON. – Crypto Value Mar 18 '19 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.