A wrong setting of the BeefyFeeConfig can block StrategyPassiveManagerVelodrome.harvest() functionality
Summary
If the strategist sets the beefyFeeConfig wrongly, having the StratFeeManagerInitializable.getFees returns greater than the StratFeeManagerInitializable.DIVISOR constant, the StrategyPassiveManagerVelodrome._harvest() method will revert forever.
Niser
medium
A wrong setting of the BeefyFeeConfig can block StrategyPassiveManagerVelodrome.harvest() functionality
Summary
If the
strategist
sets thebeefyFeeConfig
wrongly, having theStratFeeManagerInitializable.getFees
returns greater than theStratFeeManagerInitializable.DIVISOR constant
, the StrategyPassiveManagerVelodrome._harvest() method will revert forever.Vulnerability Detail
The _chargeFees method uses the StratFeeManagerInitializable.DIVISOR constant and the StratFeeManagerInitializable.getFees() method to calculate the amount to swap (Lines StrategyPassiveManagerVelodrome.sol#L486-L487):
If
fee.total
>DIVISOR
, then theamountToSwap
>_amount
, and the line 487 will revert.fee.total
is computed in line StrategyPassiveManagerVelodrome.sol#L480:The
getFees
method is implemented in StratFeeManagerInitializable.sol#L115-L117:It takes the configuration setted using the StrategyFactory.setBeefyFeeConfig() method:
Impact
The StrategyPassiveManagerVelodrome._harvest() method can be not-callable for a period.
Code Snippet
Tool used
Manual Review
Recommendation
Having a check in the StrategyFactory.setBeefyFeeConfig() method](https://github.com/sherlock-audit/2024-05-beefy-cowcentrated-liquidity-manager/blob/main/cowcentrated-contracts/contracts/strategies/StrategyFactory.sol#L170-L173) to have the
fee.total
less thanStratFeeManagerInitializable.DIVISOR