Rena V2 Weekly Dev Report #13
We hope you’ve all had a fun Halloween! After a grueling week of problem-solving and refactoring, we’re back at it again! This week we’re brainstorming & building around Rena rRewarder and finding new methods of using Uniswapv3 LP rewards for rRewarder. Let’s dive in!
Weekly Task Summary
- Custom staking contract — rRewarderV2
- UniswapV3 LP rewards
What was Achieved?
Allow rRewarderV2 to use Custom Staking Contracts
The original rStaking contract that was developed for RenaV2 has two methods of distributing rewards. The first method is to call the “distribute” function with an amount taken from the caller and distributed to stakers.
For this method, an allowance needs to be set up. Nonetheless, the first method was the original avenue for distributing the rewards in Rewarderv2. The second method is by sending the tokens to the contract and calling the “forward” function. No allowance is required for this method.
As such, most of the other staking contracts are implemented using a simpler method because they have different implementations (that we consider obsolete but definitely operational), thus rRewarderV2 was incompatible with other staking contracts. Hence we modified the rRewarder v2 to deposit the tokens in the staking contract and call an optional “forward” function. This call will always be executed after the tokens are sent. Without the “forward” function in the contracts, the call will simply be reverted without reverting the original transaction.
The cost of calling the “forward” function, which does not exist, is minimal in terms of gas. The current implementation of rRewarder can use a staking contract, which operates by receiving the tokens by an ERC-20 transfer.
Analyze the possibility of using UniswapV3 LP rewards
UniswapV2 uses the standard ERC-20 tokens to represent liquidity ownership, thus allowing easy distribution of those tokens via the rRewarder contracts to the stakers. On the other hand, UniswapV3 uses NFT with complex computation of liquidity positions. Since NFTs are not fractionable, they cannot be leveraged to distribute rewards.
The original idea was to fractionalize these UniswapV3 NFTs via adapter contracts. To idea is certainly executable, but the resources, time, and development efforts it requires are equivalent to building a complete project itself. Not to mention it’s a highly complex endeavor. We did find projects using a similar idea with deployed contracts and usability. We’re still analyzing if this solution is viable & efficient in terms of integration and security.
Next week’s tasks:
- Write skeleton for Web3 library
- Update the deployment script to match draftv2
Thank you for reading our Rena V2 report! We’ll be back next week with another update on Week #14.🙌