The Rare Staking Pool ERC20 (Rarity Pool) interface containing all functions, events, etc.
Functions
initialize
function initialize(address _rare, address _userStakedTo, address _stakingRegistry, address _creator) external;
addRewards
Allocates rewards for the current round with the given amount.
function addRewards(address _donor, uint256 _amount) external;
Parameters
takeSnapshot
Snapshots the rewards for the current round. Anyone can call this.
function takeSnapshot() external;
stake
Stake $RARE tokens to the target associated with the contract and receive synthetic tokens in return.
function stake(uint256 _amount) external;
Parameters
unstake
Unstake by returning synthetic tokens and receiving previously staked $RARE in return.
function unstake(uint256 _amount) external;
Parameters
claimRewardsForRounds
Claim rewards due to the _user for the supplied rounds. Rewards are proportional to the synthetic tokens held during the snapshot associated with each round. Throws if user has already claimed for a given round. Throws if current round is being claimed.
function claimRewardsForRounds(address _user, uint256[] memory _rounds) external;
Parameters
stakerHasClaimedForRound
Query if a user has claimed their reward for a given round.
function stakerHasClaimedForRound(address _staker, uint256 _round) external view returns (bool);
Parameters
getAmountStakedByUser
Query total amount of $RARE a user has staked on this contract.
function getAmountStakedByUser(address _user) external view returns (uint256);
Parameters
Returns
getCurrentRound
Query current round. The current round is accumulating rewards.
function getCurrentRound() external view returns (uint256);
Returns
name
Name of the synthetic asset.
function name() external view returns (string memory);
Returns
symbol
Symbol of the synthetic asset.
function symbol() external view returns (string memory);
Returns
getTargetBeingStakedOn
Query the target being staked on by this contract.
function getTargetBeingStakedOn() external view returns (address);
Returns
getAllStakers
Retrieves a list of all the users that have staked.
function getAllStakers() external view returns (address[] memory);
Returns
getRoundRewards
Total rewards available for the supplied round.
function getRoundRewards(uint256 _round) external view returns (uint256);
Returns
getHistoricalRewardsForUserForRounds
Query rewards for the supplied user address for the round supplied rounds. Does not omit rewards for rounds that have already been claimed. Allows for easier historical lookups.
function getHistoricalRewardsForUserForRounds(address _user, uint256[] memory _rounds)
external
view
returns (uint256);
Parameters
Returns
getClaimableRewardsForUserForRounds
Query rewards for the supplied user address for the round supplied rounds. Throws if any round has already been claimed.
function getClaimableRewardsForUserForRounds(address _user, uint256[] memory _rounds) external view returns (uint256);
Parameters
Returns
calculatePurchaseReturn
Calculates the number of sRare yielded from staking.
function calculatePurchaseReturn(uint256 _totalSRare, uint256 _stakedAmount) external pure returns (uint256);
Parameters
Returns
calculateSaleReturn
Calculates the number of rare yielded from unstaking.
function calculateSaleReturn(uint256 _totalSRareByUser, uint256 _totalRareStakedByUser, uint256 _unstakeAmount)
external
pure
returns (uint256);
Parameters
Returns
getAllTimeRewards
Total rewards snapshotted since con.
function getAllTimeRewards() external view returns (uint256);
Returns
getClaimRounds
List of all rounds with claim associated with them.
function getClaimRounds() external view returns (uint256[] memory);
Returns
getCreationTime
Get the unix creation time of the staking contract.
function getCreationTime() external view returns (uint256);
Returns
getLastSnapshotTimestamp
Get the unix time of the most recent snapshot.
function getLastSnapshotTimestamp() external view returns (uint256);