all files / contracts/interfaces/staking/ IFarmRewardsV2.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 132 133 134 135                                                                                                                                                                                                                                                                             
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;
 
 
/**
 * @title FarmRewardsV2
 * @author solace.fi
 * @notice Rewards farmers with [**SOLACE**](./../../SOLACE).
 *
 * [FarmRewards V1](./../../staking/FarmRewards) rewarded CpFarmers in [**xSOLACEV1**](./../../staking/xSOLACEV1) linearly vested until May 2022. [**xSOLACEV1**](./../../staking/xSOLACEV1) was deprecated for [**xsLocker**](./../../staking/xsLocker) and will stop receiving rebases. FarmRewards V2 attachs on top of [FarmRewards V1](./../../staking/FarmRewards) and allows farmers to early withdraw their [**xSOLACEV1**](./../../staking/xSOLACEV1) and deposit it into a lock, as long as that lock ends after May 2022. This will give them staking rewards and voting power.
 *
 * FarmRewards V2 is an optional alternative to [FarmRewards V1](./../../staking/FarmRewards). Each user will decide how they would like their rewards. Either way, farmers will need to pay $0.03/[**SOLACE**](./../../SOLACE).
 */
interface IFarmRewardsV2 {
 
    /***************************************
    EVENTS
    ***************************************/
 
    event ReceiverSet(address receiver);
 
    /***************************************
    GLOBAL VARIABLES
    ***************************************/
 
    /// @notice Address of the [**SOLACE**](./../../SOLACE) contract.
    function solace() external view returns (address);
    /// @notice Address of the [**xSOLACEV1**](./../../staking/xSOLACEV1) contract.
    function xsolacev1() external view returns (address);
    /// @notice Address of the [**xsLocker**](./../../staking/xsLocker) contract.
    function xsLocker() external view returns (address);
    /// @notice Address of the [**FarmRewardsV1**](./../../staking/FarmRewards) contrcat.
    function farmRewardsv1() external view returns (address);
    /// @notice Receiver for payments.
    function receiver() external view returns (address);
 
    /// @notice timestamp that rewards finish vesting
    function VESTING_END() external view returns (uint256); // midnight UTC before May 1, 2022
 
    /// @notice The ID of the user's lock.
    function userLock(address user) external view returns (uint256 xsLockID);
 
    /***************************************
    VIEW FUNCTIONS
    ***************************************/
 
    /**
     * @notice Calculates the amount of token in needed for an amount of [**SOLACE**](./../../SOLACE) out.
     * @param tokenIn The token to pay with.
     * @param amountOut The amount of [**SOLACE**](./../../SOLACE) wanted.
     * @return amountIn The amount of `tokenIn` needed.
     */
    function calculateAmountIn(address tokenIn, uint256 amountOut) external view returns (uint256 amountIn);
 
    /**
     * @notice Calculates the amount of [**SOLACE**](./../../SOLACE) 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 [**SOLACE**](./../../SOLACE) out.
     */
    function calculateAmountOut(address tokenIn, uint256 amountIn) external view returns (uint256 amountOut);
 
    /**
     * @notice The amount of [**xSOLACEV1**](./xSOLACEV1) that a farmer can purchase.
     * Does not include the amount they've already redeemed.
     * @param farmer The farmer to query.
     * @return amount The amount of [**xSOLACEV1**](./xSOLACEV1).
     */
    function purchaseableXSolace(address farmer) external view returns (uint256 amount);
 
    /**
     * @notice The amount of [**SOLACE**](./../../SOLACE) that a farmer can purchase.
     * Does not include the amount they've already redeemed.
     * @param farmer The farmer to query.
     * @return amount The amount of [**SOLACE**](./../../SOLACE).
     */
    function purchaseableSolace(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 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 Accepts the governance role for the FarmRewards V1 contract.
     * Can only be called by the current [**governor**](/docs/protocol/governance).
     */
    function acceptFarmRewardsV1Governance() external;
 
    /**
     * @notice Sets the pending governance role for the FarmRewards V1 contract.
     * Can only be called by the current [**governor**](/docs/protocol/governance).
     * @param newGovernor The pending new governor.
     * @param newReceiver The FarmRewardsV1 receiver.
     */
    function setFarmRewardsV1Governance(address newGovernor, address newReceiver) external;
 
    /**
     * @notice Rescues tokens that may have been accidentally transferred in.
     * Can only be called by the current [**governor**](/docs/protocol/governance).
     * @param token The token to rescue.
     * @param amount Amount of the token to rescue.
     */
    function rescueTokens(address token, uint256 amount) external;
}