all files / contracts/interfaces/staking/ IFarmRewards.sol

100% Statements 0/0
100% Branches 0/0
100% Functions 0/0
100% Lines 0/0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131                                                                                                                                                                                                                                                                     
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;
 
 
/**
 * @title IFarmRewards
 * @author solace.fi
 * @notice Rewards farmers with [**SOLACE**](./../../SOLACE).
 *
 * Rewards were accumulated by farmers for participating in farms. Rewards will be unlocked linearly over six months and can be redeemed for [**SOLACE**](./../../SOLACE) by paying $0.03/[**SOLACE**](./../../SOLACE).
 */
interface IFarmRewards {
 
    /***************************************
    EVENTS
    ***************************************/
 
    event ReceiverSet(address receiver);
 
    /***************************************
    GLOBAL VARIABLES
    ***************************************/
 
    /// @notice [**xSOLACE**](./../../staking/xSOLACEV1) Token.
    function xsolace() external view returns (address);
 
    /// @notice receiver for payments
    function receiver() external view returns (address);
 
    /// @notice timestamp that rewards start vesting
    function VESTING_START() external view returns (uint256);
 
    /// @notice timestamp that rewards finish vesting
    function VESTING_END() external view returns (uint256);
 
    function solacePerXSolace() external view returns (uint256);
 
    /// @notice The stablecoins that can be used for payment.
    function tokenInSupported(address tokenIn) external view returns (bool);
 
    /// @notice Total farmed rewards of a farmer.
    function farmedRewards(address farmer) external view returns (uint256);
 
    /// @notice Redeemed rewards of a farmer.
    function redeemedRewards(address farmer) external view returns (uint256);
 
    /***************************************
    VIEW FUNCTIONS
    ***************************************/
 
    /**
     * @notice Calculates the amount of token in needed for an amount of [**xSOLACE**](./../../staking/xSOLACEV1) out.
     * @param tokenIn The token to pay with.
     * @param amountOut The amount of [**xSOLACE**](./../../staking/xSOLACEV1) wanted.
     * @return amountIn The amount of `tokenIn` needed.
     */
    function calculateAmountIn(address tokenIn, uint256 amountOut) external view returns (uint256 amountIn);
 
    /**
     * @notice Calculates the amount of [**xSOLACE**](./../../staking/xSOLACEV1) out for an amount of token in.
     * @param tokenIn The token to pay with.
     * @param amountIn The amount of `tokenIn` in.
     * @return amountOut The amount of [**xSOLACE**](./../../staking/xSOLACEV1) out.
     */
    function calculateAmountOut(address tokenIn, uint256 amountIn) external view returns (uint256 amountOut);
 
    /**
     * @notice The amount of [**xSOLACE**](./../../staking/xSOLACEV1) that a farmer has vested.
     * Does not include the amount they've already redeemed.
     * @param farmer The farmer to query.
     * @return amount The amount of vested [**xSOLACE**](./../../staking/xSOLACEV1).
     */
    function purchaseableVestedXSolace(address farmer) external view returns (uint256 amount);
 
    /***************************************
    MUTATOR FUNCTIONS
    ***************************************/
 
    /**
     * @notice Deposit tokens to redeem rewards.
     * @param tokenIn The token to use as payment.
     * @param amountIn The max amount to pay.
     */
    function redeem(address tokenIn, uint256 amountIn) external;
 
    /**
     * @notice Deposit tokens to redeem rewards.
     * @param tokenIn The token to use as payment.
     * @param amountIn The max amount to pay.
     * @param depositor The farmer that deposits.
     * @param deadline Time the transaction must go through before.
     * @param v secp256k1 signature
     * @param r secp256k1 signature
     * @param s secp256k1 signature
     */
    function redeemSigned(address tokenIn, uint256 amountIn, address depositor, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
 
    /***************************************
    GOVERNANCE FUNCTIONS
    ***************************************/
 
    /**
     * @notice Adds support for tokens. Should be stablecoins.
     * Can only be called by the current [**governor**](/docs/protocol/governance).
     * @param tokens The tokens to add support for.
     */
    function supportTokens(address[] calldata tokens) external;
 
    /**
     * @notice Sets the recipient for proceeds.
     * Can only be called by the current [**governor**](/docs/protocol/governance).
     * @param receiver_ The new recipient.
     */
    function setReceiver(address payable receiver_) external;
 
    /**
     * @notice Returns excess [**xSOLACE**](./../../staking/xSOLACEV1).
     * Can only be called by the current [**governor**](/docs/protocol/governance).
     * @param amount Amount to send. Will be sent from this contract to `receiver`.
     */
    function returnXSolace(uint256 amount) external;
 
    /**
     * @notice Sets the rewards that farmers have earned.
     * Can only be called by the current [**governor**](/docs/protocol/governance).
     * @param farmers Array of farmers to set.
     * @param rewards Array of rewards to set.
     */
    function setFarmedRewards(address[] calldata farmers, uint256[] calldata rewards) external;
}