DOUGH liquidity mining contracts.
DOUGH token address: 0xad32a8e6220741182940c5abf610bde99e737b2d
Forked of the Synthetix Rewards Escrow contract.
The contract was changed to allow multiple contracts to append vesting entries and for it to be upgraded.
To allow for the dough token to be migrated it can be changed by the owner
.
function setDough(address _dough) external
For a contract to be able to add vesting entries it needs to be whitelisted by the owner
.
function addRewardsContract(address _rewardContract) external
A reward contract can be removed by the owner.
function removeRewardsContract(address _rewardContract) external
Whitelisted contracts (use addRewardsContract
) can add vesting entries for accounts. Before calling this function quantity
amount of tokens should be transfered to the rewardsEscrow.
function appendVestingEntry(address account, uint quantity) external
Using this function a user can withdraw vested dough from all vested entries.
function vest() external
function numVestingEntries(address account) external
function getVestingScheduleEntry(address account, uint index) external
function getVestingTime(address account, uint index) external
function getVestingQuantity(address account, uint index) external
function getNextVestingIndex(address account) external
function getNextVestingEntry(address account) external
function getNextVestingTime(address account) external
function getNextVestingQuantity(address account) external
function checkAccountSchedule(address account) external
function balanceOf(address account) external
function totalSupply() external
The staking used currently used is a fork of the contract made by Alchemix.
What we've added:
- Upgradeablity using the OpenZeppelin upgradable contracts
- Refferal system
- Easy Getter to fetch all LP positions
- Configurable escrow percentage
- Configurable exit fee percentage
Setting the governance address is a two step process. First the old governance
address needs to set a new pending address:
function setPendingGovernance(address _pendingGovernance) external
After this the new governance
address can accept it:
function acceptGovernance() external
The reward rate sets the amount of tokens in total to disperse per block. Only the governance
address can call this.
function setRewardRate(uint256 _rewardRate) external
A new token which can be staked can be added by the governance
address. By default the escrowPercentage
, exitFeePercentage
and rewardWeight
will be set to 0
function createPool(IERC20 _token) external returns (uint256 newPoolId)
When a new pool is added escrowPercentage
, exitFeePercentage
and rewardWeight
will be set to 0. It can be updated by the governance
address by calling the following functions:
All functions update all pools at the same time. Make sure you know the order of the pools.
The reward weights determin how the rewardRate
is split up between pools
function setRewardWeights(uint256[] calldata _rewardWeights) external
The escrow percentages determin what percentage of rewards are locked in the RewardEscrow
contract
function setEscrowPercentages(uint256[] calldata _escrowPercentages) external
The exit fee percentages how much of an exit fee is charged when unstaking
function setExitFeePercentages(uint256[] calldata _exitFeePercentages) external
Can only be called by the governance
address.
function setExitFeeReceiver(address _exitFeeReceiver) external
Addresses which would like to participate in the referral program for liquidity mining need to be whitelisted by the governance
address.
function setReferrerValues(address _referrer, uint256 _referralPercentage, uint256 _referralEscrowPercentage) external
Approve the deposit token first and call to deposit.
function deposit(uint256 _poolId, uint256 _depositAmount) external;
To pass the referrer on deposit call.
function depositReferred(uint256 _poolId, uint256 _depositAmount, address _referrer) external;
Withdraw deposit token and rewards
function withdraw(uint256 _poolId, uint256 _withdrawAmount) external
Claim rewards
function claim(uint256 _poolId) external
Claim rewards earned as a referrer
function claimReferralRewards() external
In case the reward token somehow becomes untransferable you can withdraw forfeiting your rewards
function emergencyExit(uint256 _poolId) external
Get the amount of DOUGH released every block to the pools
function rewardRate() external view returns (uint256)
The total weight of all pools combined
function totalRewardWeight() external view returns (uint256)
Total amount of reward pools
function poolCount() external view returns (uint256)
Get the deposit token for a pool
function getPoolToken(uint256 _poolId) external view returns (IERC20)
Get the reward weight of a pool
function getPoolRewardWeight(uint256 _poolId) external view returns (uint256)
Get the percentage of rewards that are escrowed for a pool
function getPoolEscrowPercentage(uint256 _poolId) external view returns (uint256)
Get the exit fee of a pool
function getPoolExitFeePercentage(uint256 _poolId) external view returns (uint256)
Get the reward per block for this pool
function getPoolRewardRate(uint256 _poolId) external view returns (uint256)
Get all global and account pool info
function getPools(address _account) external view returns (Pool.ViewData[] memory)
Get the total deposited for a pool by an account
function getStakeTotalDeposited(address _account, uint256 _poolId) external view returns (uint256)
Get the amount of unclaimed rewards for an account
function getStakeTotalUnclaimed(address _account, uint256 _poolId) external view returns (uint256)