Liquidity Reward
Contract in charge of handling CTX rewards for liquidity providers.
Code
Address
Mainnet
Contract | Address |
---|---|
ETH Liquidity Reward | 0xc8BB1cd417D20116387a5e0603e195cA4f3Cf59A |
CTX Liquidity Reward | 0xdC4cDd5dB9EE777EFD891690dc283638CB3A5f94 |
Rinkeby
Contract | Address |
---|---|
ETH Liquidity Reward | 0x7Cc49304b0Ef50f1e3F808D1E494149Ca177DFf7 |
DAI Liquidity Reward | 0x2E0a511DD1d4aB8EB3F9c0441CfCcde19C9544F0 |
Public Variables
Address of the reward.
Address of the staking token.
Tracks the period where users stop earning rewards.
Tracks the current reward rate.
How long the rewards lasts, it updates when more rewards are added.
Last time rewards were updated.
Amount of reward calculated per token stored.
Track the rewards paid to users.
Tracks the user rewards.
Time were vesting ends.
Vesting ratio.
tracks vesting amount per user.
Private Variables
Tracks the total supply of staked tokens.
Tracks the amount of staked tokens per user.
Events
Events are called each time the state changes on the contract.
An event emitted when a reward is added.
An event emitted when tokens are staked to earn rewards
An event emitted when staked tokens are withdrawn.
An event emitted when reward is paid to a user.
An event emitted when the rewards duration is updated.
An event emitted when a erc20 token is recovered.
Modifiers
updateReward
Updates the reward and time on call.
Read-Only Functions
totalSupply
Returns the total amount of staked tokens.
balanceOf
Returns the amount of staked tokens from specific user.
getRewardForDuration
Returns the Reward rate multiplied by the rewards duration time.
lastTimeRewardApplicable
Returns the minimun between current block timestamp or the finish period of rewards.
rewardPerToken
Returns the calculated reward per token deposited.
earned
Returns the amount of reward tokens a _account
has earned.
min
Returns the minimun between two variables.
State-Changing Functions
constructor
Called once the contract it's deployed, sets the orchestrator as owner.
stake
Transfer staking token to contract. Updates reward on call.
exit
Removes all stake and transfers all rewards to the staker.
claimVest
Claims all vesting amount.
notifyRewardAmount
Notifies the contract that reward has been added to be given. Only owner can call it. Increases duration of rewards.
recoverERC20
Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders.
setRewardsDuration
Updates the reward duration. Only owner can call it. Previous rewards must be complete.
withdraw
Remove staking token and transfer back to staker. Updates rewards on call.
getReward
Transfers to the caller the current amount of rewards tokens earned. Updates rewards on call. Only 70% of reward is inmediate transfered the rest is locked into vesting