Sponsorship Reward

As a sponsor who gives reward

Dyson Finance supports Sponsorship feature, which allows everyone including DAO to add sponsored tokens in specific Gauge to attract more voters. A sponsor needs to specify the sponsored token, the amount of token and the number of week since Epoch. Explore the Sponsorship section in our white paper for further insights into sponsorship.

// Bribe.sol
function addReward(address token, uint week, uint amount) external {
    require(week >= block.timestamp / 1 weeks, "cannot add for previous weeks");
    token.safeTransferFrom(msg.sender, address(this), amount);
    tokenRewardOfWeek[token][week] += amount;
    emit AddReward(msg.sender, token, week, amount);
}

Parameters:

  • token: Address of the token to add as reward

  • week: The week to add the reward to. It's the i-th week since 1970/01/01 and it must be the present week or a week in the future.

  • amount : Amount of token.

Set Up your Contract

For example, a sponsor want to sponsor $MATIC as reward on the target period (3/21 - 3/28, 2024) he can write a contract as below:

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.17;

interface IERC20 {
    function approve(address spender, uint value) external returns (bool);
}

interface IBribe {
    function addReward(address token, uint week, uint amount) external;
}
contract MyBribeTest {
    // The DYSON-USDC bribe contract on Polygon zkEVM.
    address public constant bribe = 0xFCE34AA5fc1Ca594b12248a927e0153680Ef2A90;
    address matic = 0xa2036f0538221a77A3937F1379699f44945018d0;
    uint amount = 100e18; // 100 $MATIC
    // 2024 3/21 0:00 timestamp = 1710979200
    // 1710979200/(86400*7) = 2829
    uint week = 2829
    
    function addReward() external {
        IERC20(matic).approve(bribe, amount);
        IBribe(bribe).addReward(matic, week, amount);
    }
}

As a user who receive reward

Sponsor rewards will be periodically distributed at the end of the Epoch, and it will be distributed according to the users' $sDYSN proportion deposited in the pools at the moment. Explore the Reward Distribution section in our white paper for further insights into sponsorship.

Users can claim their bribe reward using the below functions, by specifying the token and the week.

The details about the claim functions above, please refer to Bribe section.

Setup your contract

Users can check their reward on a specific pool and week by calling checkReward first, then claim their reward using claimReward as follows:

Last updated