Missing onlyCalmPeriods modifier on important functions
Summary
Missing onlyCalmPeriods modifier on important functions
Vulnerability Detail
Beefy tries to to protect its users from price manipulation attacks (e.g. flash loan attacks) and it does so by allowing them to deposit only during a calm period. This is done with the implementation of the onlyCalmPeriods modifier. However the issue is that this modifier is not used on the withdraw() and harvest() functions.
Impact
Because of this users are allowed to withdraw and harvest during unsafe periods which may lead to a loss for them
0xboriskataa
high
Missing
onlyCalmPeriods
modifier on important functionsSummary
Missing
onlyCalmPeriods
modifier on important functionsVulnerability Detail
Beefy tries to to protect its users from price manipulation attacks (e.g. flash loan attacks) and it does so by allowing them to deposit only during a calm period. This is done with the implementation of the
onlyCalmPeriods
modifier. However the issue is that this modifier is not used on thewithdraw()
andharvest()
functions.Impact
Because of this users are allowed to withdraw and harvest during unsafe periods which may lead to a loss for them
Code Snippet
https://github.com/sherlock-audit/2024-05-beefy-cowcentrated-liquidity-manager/blob/main/cowcentrated-contracts/contracts/strategies/velodrome/StrategyPassiveManagerVelodrome.sol/#L425-L435 https://github.com/sherlock-audit/2024-05-beefy-cowcentrated-liquidity-manager/blob/main/cowcentrated-contracts/contracts/strategies/velodrome/StrategyPassiveManagerVelodrome.sol/#L226-L240
Tool used
Manual Review
Recommendation
Add the onlyCalmPeriods modifier to the
withdraw()
andharvest()
functionsDuplicate of #74