Staking pool with a time lock and throttled exit. Inherits all staking logic from RewardsPoolBase. Only allows exit at the end of the time lock and via the throttling mechanism.
NonCompoundingRewardsPool
StakeReceiverFeature
StakeReceiver
StakeTransfererFeature
StakeTransferer
ThrottledExitFeature
ThrottledExit
StakeLockingFeature
StakeLock
OnlyExitFeature
RewardsPoolBase
Ownable
Context
mapping(address => bool) receiversWhitelist;
uint256 nextAvailableExitTimestamp;
uint256 nextAvailableRoundExitVolume;
uint256 throttleRoundSeconds;
uint256 throttleRoundCap;
uint256 campaignEndTimestamp;
mapping(address => struct ThrottledExit.ExitInfo) exitInfo;
uint256 lockEndTimestamp;
uint256 PRECISION;
uint256 totalStaked;
uint256[] rewardPerSecond;
address[] rewardsTokens;
contract IERC20 stakingToken;
uint256 startTimestamp;
uint256 endTimestamp;
uint256 extensionDuration;
uint256[] extensionRewardPerSecond;
uint256[] accumulatedRewardMultiplier;
uint256 stakeLimit;
uint256 contractStakeLimit;
string name;
mapping(address => struct RewardsPoolBase.UserInfo) userInfo;
struct RewardsPoolBase.Campaign[] previousCampaigns;
contract IERC20 _stakingToken; // The token to stake
address[] _rewardsTokens; // The reward tokens
uint256 _stakeLimit; // Maximum amount of tokens that can be staked per user
uint256 _throttleRoundSeconds; // Seconds per throttle round
uint256 _throttleRoundCap; // Maximum tokens withdrawn per throttle round
uint256 _contractStakeLimit; // Maximum amount of tokens that can be staked in total
string _name; // Name of the pool
Start the pool and set locking and throttling parameters.
uint256 _startTimestamp; // The start time of the pool
uint256 _endTimestamp; // The end time of the pool
uint256[] _rewardPerSecond; // Amount of rewards given per second
Not allowed
uint256 _tokenAmount;
Not allowed
Requests a throttled exit from the pool and gives you a time from which you can withdraw your stake and rewards.
Completes the throttled exit from the pool.
Exits the pool and tranfer to another pool
address transferTo; // The new pool to tranfer to
Not allowed
uint256 ;
uint256[] ;
Receives a stake from another pool
address _staker; // The address who will own the stake
uint256 _amount; // The amount to stake
Change whitelist status of a receiver pool to receive transfers.
address _receiver; // The pool address to whitelist
bool _whitelisted; // If it should be whitelisted or not
Returns the amount of reward tokens that are pending for exit for this user
uint256 _tokenIndex; // The index of the reward to check
Cancels the scheduled start. Can only be done before the start.
Stake an amount of tokens
uint256 _tokenAmount; // The amount to be staked
Returns the amount of tokens the user has staked
address _userAddress; // The user to get the balance of
Updates the accumulated reward multipliers for everyone and each token
Checks if the staking has started
Returns the amount of reward debt of a specific token and user
address _userAddress; // the address of the updated user
uint256 _index; // index of the reward token to check
Returns the amount of reward owed of a specific token and user
address _userAddress; // the address of the updated user
uint256 _index; // index of the reward token to check
Calculates the reward at a specific time
address _userAddress; // the address of the user
uint256 _tokenIndex; // the index of the reward token you are interested
uint256 _time; // the time to check the reward at
Returns the length of the owed tokens in the user info
address _userAddress;
Returns the length of the reward debt in the user info
address _userAddress;
Returns the amount of reward tokens
Returns the amount of previous campaigns
Cancels the schedules extension
Calculates the available amount of reward tokens that are not locked
uint256 _rewardTokenIndex; // the index of the reward token to check
Withdraw tokens other than the staking and reward token, for example rewards from liquidity mining
address _recipient; // The address to whom the rewards will be transferred
address _token; // The address of the rewards contract
Withdraw excess rewards not needed for current campaign and extension
address _recipient; // The address to whom the rewards will be transferred
Returns the address of the current owner.
Leaves the contract without owner. It will not be possible to call
onlyOwner
functions anymore. Can only be called by the current owner.
NOTE: Renouncing ownership will leave the contract without an owner,
thereby removing any functionality that is only available to the owner.
Transfers ownership of the contract to a new account (newOwner
).
Can only be called by the current owner.
address newOwner;
address user;
uint256 exitTimestamp;
address user;
uint256 stake;
uint256 startTimestamp;
uint256 endTimestamp;
uint256[] rewardsPerSecond;
address user;
uint256 amount;
address user;
uint256 amount;
address token;
address user;
uint256 amount;
address user;
uint256 amount;
uint256 newStartTimestamp;
uint256 newEndTimestamp;
uint256[] newRewardsPerSecond;
address previousOwner;
address newOwner;
uint256 exitTimestamp;
uint256 exitStake;
uint256[] rewards;
uint256 firstStakedTimestamp;
uint256 amountStaked;
uint256[] rewardDebt;
uint256[] tokensOwed;
uint256 startTimestamp;
uint256 endTimestamp;
uint256[] rewardPerSecond;