How Can We Help?

< Back
You are here:

Use shortcode [ethereum-ico-referral] to display a referral address field.


User needs to input her Ethereum account address in the Account field. Referral link would be displayed as a result.

If user has MetaMask account unlocked, the Account field will be hidden, and the MetaMask account address would be used automatically.

Referral link example:

User can copy the referral link produced with a special Copy button and send it to her friends. If they buy tokens while opened this referral link, your Crowdsale contract would get a referral address in the Data field.

Your Crowdsale contract should be able to work with it. You can use the Crowdsale Contract and ERC20 Token Development Service to let us do this job for you.

Live demo

Input an Ethereum address like 0x476Bb28Bc6D0e9De04dB5E19912C392F9a76535d into the Account field to see resulting referral link here:

Code examples

You can use this solidity code snippets as a base for your referral/affiliate system implementation.

Put this code to your payable token buy function:

    if( == 20) {
      address referer = bytesToAddress(bytes(;
      // self-referrer check
      require(referer != address(0x0), "zero-referrer");
      require(referer != msg.sender, "self-referrer");
      uint refererTokens = tokens.mul(2).div(100);
      // bonus for referrer
      token.transfer(referer, refererTokens);

The bytesToAddress function:

  function bytesToAddress(bytes source) internal pure returns(address) {
    uint result;
    uint mul = 1;
    for(uint i; i &lt; 20; i++) {
        result = result.add(mul.mul(uint8(source[19-i])));
        mul = mul.mul(256);
    return address(result);

You can use the Crowdsale Contract and ERC20 Token Development Service to let us do this job for you.

Source: Пишем смарт-контракт Ethereum — это просто: Часть 12 — ICO, реферальная система [ru_RU]

Previous Live Demo
Next Style the Progressbar

Attention! Support delays!

Thanks to the NFT boom, we are experiencing scaling issues.

We are doing our best, but be warned, that your support requests can be delayed for two or three weeks unfortunately.

Use the Knowledge Base and video tutorials please.

On the you can find someone to help you with our plugins configuration.

The NFT Marketplace – HOWTO is a best place to learn more about our NFT solutions.

Thank you for your understanding and patience,

Oleg Abrosimov Founder and CEO