Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dao.sol: Reserve emissions must be turned on for depositLPs and bonds #44

Open
code423n4 opened this issue Jul 18, 2021 · 0 comments
Open
Assignees
Labels

Comments

@code423n4
Copy link
Contributor

Handle

hickuphh3

Vulnerability details

Impact

depositLPForMember() and bond() invokes harvest() if a user has existing LP deposits or bonded assets into the DAO. This is to prevent users from depositing more assets before calling harvest() to earn more DAOVault incentives. However, harvest() reverts if reserve emissions are turned off.

Hence, deposits / bonds performed by existing users will fail should reserve emissions be disabled.

Recommended Mitigation Steps

Cache claimable rewards into a separate mapping when depositLPForMember() and bond() are called. harvest() will then attempt to claim these cached + pending rewards. Perhaps Synthetix's Staking Rewards contract or Sushiswap's FairLaunch contract can provide some inspiration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants