Receive Referral Reward

Trader can claim their referral reward via ReferralRewarder contract for each chain.

Contract address

BNB chain: 0xCEaBce51c59d44C8dE3E58599c296787A9523Fc7

Arbitrum One: 0x2100Ed94172b0627D6fe772EB11B16d9Ba1C4CeA

Note: Please use the contract on the exact chain you set to claim reward before

Step 1: Get claimable reward

  • Get the reward information via this method

function epoches() external view 
    returns (
        bytes32 merkleRoot,
        bytes32 ipfsHash,
        uint256 totalRewards,
        uint256 totalClaimed,
        uint64 startVestingTime,
        uint64 endVestingTime

The ipfsHash is decoded IPFS CID of the airdrop detail file. You will need to encode to get the original CID, like this

const hex = '1220' + ipfs.slice(2); // remove '0x' prefix and prepend 1220 tag for v2 CID
bs58.encode(Buffer.from(hash, 'hex'))


bs58.encode(Buffer.from('1220f6e849cffef302146a84e8d4e41c072410ea214dba9cc05a44af0f302c713a1b', 'hex'));

// result: QmexUSUxsUvDzfns9GUoMw19Gqoj885v6H85XMxu68EpVG

Then use any IPFS gateway to get file content, like this. It is a JSON file with some data. Find your address in the file, something like this

    "id": 0,
    "address": "0xd93497c4659276569f49a32a7abd0691f5ac4467",
    "rewards_amount": "53872166745238961245",
    "rewards_claim_on": 56,
    "rewards_value": "183046130390007773813415143771401",
    "ref_tier": 0,
    "ref_count": 7,
    "ref_point": "0",
    "ref_rebate_value": "0",
    "ref_rebate_amount": "0",
    "trader_ref_tier": 1,
    "trader_ref_to": "0xebc175b5e5323ceae881ed165fee6f7164a912da",
    "trader_point": "3660922607800155476268302875428039",
    "trader_discount_value": "183046130390007773813415143771401",
    "trader_discount_amount": "53872166745238961245",
    "trading_fee": [
        "chain_id": 56,
        "value": "319913282924852490765592624530694"
        "chain_id": 42161,
        "value": "3341009324875302985502710250897345"
    "proof": [

Save the value of the fields id and proof to claim your reward

Step 2: Claim reward

Use this method from the ReferralRewarder contract to claim your reward.

function claimRewards(uint256 _epoch, address _to, uint256 _index, uint256 _rewards, bytes32[] memory _merkleProof);
  • _epoch: The epoch number

  • _to: The address to which reward will be sent

  • _index: the id value in step 1

  • _merkleProof: the proof value in step 1

Now the reward should be sent to the address you set.

Last updated