Contract in charge of generating Delegator contracts, handling delegations and CTX balance map, rewards.. Uses Open Zeppelin Library.
Address of the staking governance token.
Address of the reward token.
Minimum wait time before removing stake.
Tracks the period where users stop earning rewards.
Tracks the reward rate that users can earn.
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.
Tracks the address of a delegatee with a delegator contract address.
Tracks the delegator contract address from delegatee address.
Tracks if address is an official delegator.
Tracks minimum wait time the account has to wait before removing stake.
Tracks the total supply of staked tokens.
Tracks the amount of staked tokens per user.
Events are called each time the state changes on the contract.
An event emitted when a Delegator is created.
An event emitted when a user has staked and delegated.
An event emitted when a user removes stake and undelegated.
An event emitted when the minimum wait time is updated.
An event emitted when a reward is added.
An event emitted when reward is paid to a user.
An event emitted when the reward duration is updated.
Updates the reward and time on call.
Returns the total amount of staked tokens.
Returns the amount of staked tokens from specific user.
Returns reward rate for a duration.
Returns the minimum between current block timestamp or the finish period of rewards.
Returns the calculated reward per token deposited.
Returns the amount of reward tokens a user has earned.
Returns the minimum between two variables.
Called once the contract it's deployed, transfers ownership to timelock.
Notifies the contract that reward has been added to be given. Only owner can call it. Increases duration of rewards
Updates the reward duration. Only owner can call it.
Transfers to the caller the current amount of rewards tokens earned. Update rewards on call.
Creates a new delegator contract that delegates all votes to delegatee_. Only one delegator contract pointing to the same delegatee can exist.
Stakes to delegator the amount specified. Delegator must be valid and amount has to be greater than 0. amount_ is transferred to the delegator contract and staker starts earning rewards if active. Update rewards on call.
Removes amount from delegator. Delegator must be valid and amount has to be greater than 0. amount must be <= that current user stake. amount is transferred from the delegator contract to the staker. Update rewards on call. Requires that at least waitTime has passed since delegation to unDelegate.
Updates the min wait time between delegation and unDelegation.