Sovryn-smart-contracts
Sovryn-smart-contracts copied to clipboard
Multiple rewards Liquidity Mining
Multiple rewards Liquidity Mining
Goal
A new liquidity mining contract will be deployed that will let users to get multiple tokens in exchange of staking LP Tokens as opposed to the current version which only rewards SOV:
- Different reward tokens can be configured by the contract administrator. Reward amiunt per block can be configured depending when doing so.
- LP Pools can be configured with different allocation points, i.e. weight, and be associated to multiple reward tokens.
- Users, by depositing LP tokens, will get as many different tokens based on the aforementioned quantities.
Implementation
Upgrading the original LiquidityMining.sol contract would have been extremely complex the storage layout would require lots of changes. In order to make users experience smoother and not to make them to actively move their funds to the new contract and pay for the migration trnasaction fees, the following plan is proposed:
- Implement the new liquidity mining contract as a brand new deployment, named
LiquidityMiningV2. - Replace
LiquidityMiningcontract with a new version that contains a new set of capabilities: a. Allows admins to stop some operations (see3) b. Exposes a new interface to extract some data from it's state - Stop rewarding users by invoking
stopMining - Define a period where users can opt-out of this automatic migration. Deposits will be forbidden but the users will be able to claim the rewards or even withdraw all their funds if they consider so.
- One that period has finished, the
LiquidityMining.solcontract will be locked the users will not be able to neither withdraw or claim rewards. - The admin will invoke a function on
LiquidityMiningV2that will: a. Copy the original pools and rewards configurations into the new liquidity mining contract b. Move the remainingSOVandLP Tokensstored inLiquidityMiningV1 - Update the GUI to let the users interact with the new contract
Deployment steps
- Replace
LiquidityMiningimplementation byLiquidityMiningV1 - Deploy
LiquidityMiningV2 - Add
LMV1toLMV2MigratorasLiquidityMiningV2andLiquidityMiningV1admin - Disable
LiquidityMiningV1deposits - Let the users migrate and then invoke the migration functions to copy data from the old contract and transfer funds