Closed ewilz closed 3 years ago
Welcome to v3 staking dilema, how to determine rewardPerToken or rewardPerSecond, if the user can modify his position in the NFT without touching the staking contract, you could be rewarding empty or closed NFT positions if you cannot see how much liquidity the user is providing or if the position moves out of range and is no longer actively contributing to liquidity... The tight coupling...this thing secondsPerLiquidityInsideX128
determines how much liquidity the user has contributed!. the solution here works , BUT i think its rewarding everyone who is in the uniswap pool regardless if they are staking or not,
We are going to start our fair launch event in a few days. It seems we will be the first project to use the officially deployed V3 Staker contract and also the first to develop a UI for this.
Check us out: www.uniearn.fi
Staking contract implementation is deeply coupled with other Uniswap components It is worth mentioning that the correct behavior of the staking contract directly depends on core and peripheral components which are outside the scope of this audit. For instance, to stake an incentive, the NFTPosition and the pool are queried:
Figure D.1: Part of the _stakeToken function Additionally, the correct computation of the rewards and the total seconds claimed also require an external call to a uniswap pool:
Figure D.2: Part of the unstakeToken function As expected, to review the correctness of such interactions without a clear specification of the properties of such components is challenging. To enhance either manual and tool-assisted security review (fuzzing, symbolic execution or even formal verification), consider specifying the properties from these components. Additionally, we strongly recommend performing security reviews including all the mentioned functions to make sure they have the expected properties.