FloorDAO / floor-v2

Floor aims to create a fully onchain governance mechanism for sweeping and deploying NFTs to profitable NFT-Fi strategies as well as seeding liquidity for its own NFT-Fi products.
https://floor.xyz
2 stars 0 forks source link

Rewards Miscount in DistributedRevenueStaking Strategy #55

Closed aleph-v closed 1 year ago

aleph-v commented 1 year ago

The available() function returns the currently withdrawable total plus lifetime rewards. When it is called by the total rewards function the lifetime rewards are added again. Therefore when snapshot calls total rewards the function loads the currently claimable rewards plus two times lifetime rewards. This causes the strategy to payout twice the intended rewards as it will pay them out once when they are pending and then again when they are doubled in lifetime rewards.

tomwade commented 1 year ago

Whilst making this change, I also discovered a small issue in the available function call. It was previously checking if there were funds in the same epoch, but the withdrawal function was checking the next epoch. This has now been resolved so that it can only be withdrawn during the next epoch to align with the withdrawals.

The PR has been created here: https://github.com/FloorDAO/floor-v2/pull/58