Iron Bank staking rewards is a system that distributes rewards to iToken stakers in Iron Bank Earn. Users need to supply assets into Iron Bank to received iTokens and stake them in corresponding staking reward contract to earn rewards. Please note that this means the supplied assets can't be used as collateral since the iToken would be transferred out from user's wallet.
There are 3 components associated with Iron Bank staking rewards system.
StakingRewardsFactory: The factory that creates all the staking reward contracts.
StakingRewards: The contract that handles the main logic.
StakingRewardsHelper: The contract that helps users stake, unstake, and claim rewards.
Get all the staking reward contracts created by this factory.
Get the staking reward contract address given the staking token (iToken).
Get the staking token (iToken) address given the underlying.
All the mutative functions in StakingRewardsFactory are admin functions.
Create staking reward contracts by providing a list of iToken addresses and the staking reward helper contract address. The helper contract is not necessary at this moment and could be set in each staking reward contract later.
Remove a staking reward contract given the staking token. This only updates the record in the factory. It won't stop the rewards distribution in the staking reward contract.
Get the total amount of the staking token (iToken) staked in the contract.
Get user balance of the staking token staked in the contract.
Get the user claimable reward token amount.
Get the reward rate of one reward token.
Get total reward amount in one epoch. (rewardRate * rewardsDuration)
Get all the reward tokens address.
Get the staking token (iToken) address of this staking reward contract.
Stake the staking token (iToken) into the staking reward contract.
Helper contract stakes the staking token into the staking reward contract on behalf of users.
Withdraw the staking token (iToken) from the staking reward contract.
Helper contract withdraws the staking token from the staking reward contract on behalf of users.
Claim rewards for the message sender.
Helper contract claims rewards on behalf of users.
Withdraw all the staking tokens (iToken) and claim all rewards.
This is an admin function. Set new reward amount for the next epoch.
This is an admin function. Update the epoch reward duration.
This is an admin function. Support new reward token.
This is an admin function. Set the helper contract.
Get the reward token info.
Get user claimable rewards.
Get user staked info.
Get all the staking info.
Supply assets into Iron Bank and stake the corresponding iToken into the staking reward contract for users.
Unstake iToken from the staking reward contract and redeem the underlying from Iron Bank for users.
Exit one staking reward contract for users.
Exit all staking reward contracts for users.
Claim rewards of staking reward contracts for users.