Comment on page
This is the contract used for staking uniswap version 3 LP tokens. It includes primary functionalities like deposit, withdrawal, reward claim, reward distribution for LP token holders, and others.
function initialize( address, uint256, uint256, uint256)
This function is used to initialize Astra DAO contract address, owner/dev address, ASTRADAO per block to be rewarded, start reward block, end reward block, for the LM pool contract.
Astra DAO contract address
rewards per block
start block number for starting rewards distribution
end block number for ending reward distribution
function add(IERC20,address, address, uint24)
This function is used to add the pool for LP token on the LM pool contract. This function is only to be called by the owner of the LM pool contract.
lm pool contract address
Pair's first token address
Pair's second token address
Fee range for pair
This function is used to add the vault value for the LP token on the LM pool contract. This function is only to be called by the owner of the LM pool contract.
value of month like 0, 3, 6, 9, 12
function deposit(uint256, uint256, uint256)
This function is used to deposit/stake the amount by the user. On the LM pool contract, users can stake and lock their LP token.
amount to be deposited
function withdraw(uint256, bool)
This function is used to withdraw the staked/deposited amount and ASTRADAO reward from the LM pool contract. Users can choose the option of re-staking ASTRADAO reward or instant payout.
: pool id
: withdraw the amount with or without the stake.
function viewEligibleAmount(uint256, address)
This function is basically used to view the eligible amount which needs to be withdrawn if the user deposits the amount in multiple vaults.
function updateBlockReward(uint256, address)
This function is used to calculate the total block reward as defined ASTRADAO per block and the distribution will be calculated with the current user reward multiplier, total user multiplier, and total pool multiplier. After calling this function users can update their reward.
function viewRewardInfo(uint256, address)
This function is used to view the total reward (including block reward) which the user has earned on the Astra DAO platform.
function withdrawASTRReward(uint256 _pid, bool _withStake)
This function is used to claim the ASTRADAO rewards. Users can claim the claimable ASTRADAO reward. There are two options for claiming the reward with or without staking the Astra DAO token. If the user wants to claim 100% then he needs to stake the ASTRADAO to Astra DAO pool. Otherwise, a percentage of ASTRADAO amount would be deducted as a fee.
_withStake: with or without stake
function getTodayReward(uint256 _pid)
This function is used to show the amount of rewards the user has claimed to date.