Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: tokenized staker #56

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions src/Bases/Staker/ITokenizedStaker.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.18;

import {IStrategy} from "@tokenized-strategy/interfaces/IStrategy.sol";

interface ITokenizedStaker is IStrategy {
struct Reward {
/// @notice The only address able to top up rewards for a token (aka notifyRewardAmount()).
address rewardsDistributor;
/// @notice The duration of our rewards distribution for staking, default is 7 days.
uint256 rewardsDuration;
/// @notice The end (timestamp) of our current or most recent reward period.
uint256 periodFinish;
/// @notice The distribution rate of reward token per second.
uint256 rewardRate;
/**
* @notice The last time rewards were updated, triggered by updateReward() or notifyRewardAmount().
* @dev Will be the timestamp of the update or the end of the period, whichever is earlier.
*/
uint256 lastUpdateTime;
/**
* @notice The most recent stored amount for rewardPerToken().
* @dev Updated every time anyone calls the updateReward() modifier.
*/
uint256 rewardPerTokenStored;
}

/* ========== EVENTS ========== */

event RewardAdded(address rewardToken, uint256 reward);
event RewardPaid(address indexed user, address rewardToken, uint256 reward);
event RewardsDurationUpdated(address rewardToken, uint256 newDuration);

/* ========== STATE VARIABLES ========== */

function rewardTokens(uint256 index) external view returns (address);

function rewardToken(address) external view returns (address);

function periodFinish(address) external view returns (uint256);

function rewardRate(address) external view returns (uint256);

function rewardsDuration(address) external view returns (uint256);

function lastUpdateTime(address) external view returns (uint256);

function rewardPerTokenStored(address) external view returns (uint256);

function userRewardPerTokenPaid(
address account,
address rewardToken
) external view returns (uint256);

function rewards(
address account,
address rewardToken
) external view returns (uint256);

/* ========== FUNCTIONS ========== */
function lastTimeRewardApplicable(
address rewardToken
) external view returns (uint256);

function rewardPerToken(
address rewardToken
) external view returns (uint256);

function earned(
address account,
address rewardToken
) external view returns (uint256);

function getRewardForDuration(
address rewardToken
) external view returns (uint256);

function notifyRewardAmount(address rewardToken, uint256 reward) external;

function getReward() external;

function exit() external;

function setRewardsDuration(
address rewardToken,
uint256 _rewardsDuration
) external;

function rewardData(
address rewardToken
) external view returns (Reward memory);

function addReward(
address rewardToken,
address rewardsDistributor,
uint256 rewardsDuration
) external;

function getOneReward(address rewardToken) external;
}
Loading
Loading