Incorrect condition in function doCutVaultWithdrawFee() of FeeManager.sol
Summary
The condition mentioned in comments Cut vault withdraw fee when perform withdraw from Blueberry Money Market within the given window does not match with condition added in IF statement.
(It's either that or comment does not mention things clearly - when the withdrawVaultFeeWindowStartTime is set, etc)
Vulnerability Detail
The protocol won't be able to collect the withdraw fee.
Impact
The protocol won't be able to collect the withdraw fee within the given window.
/// @notice Cut vault withdraw fee when perform withdraw from Blueberry Money Market within the given window
function doCutVaultWithdrawFee(
address token,
uint256 amount
) external returns (uint256) {
// Cut withdraw fee if it is in withdrawVaultFee Window
if (
block.timestamp <
config.withdrawVaultFeeWindowStartTime() +
config.withdrawVaultFeeWindow()
) {
return _doCutFee(token, amount, config.withdrawVaultFee());
} else {
return amount;
}
}
SanketKogekar
medium
Incorrect condition in function
doCutVaultWithdrawFee()
ofFeeManager.sol
Summary
The condition mentioned in comments
Cut vault withdraw fee when perform withdraw from Blueberry Money Market within the given window
does not match with condition added in IF statement.(It's either that or comment does not mention things clearly - when the withdrawVaultFeeWindowStartTime is set, etc)
Vulnerability Detail
The protocol won't be able to collect the withdraw fee.
Impact
The protocol won't be able to collect the withdraw fee within the given window.
Code Snippet
https://github.com/sherlock-audit/2023-04-blueberry/blob/main/blueberry-core/contracts/FeeManager.sol#L81
Tool used
Manual Review
Recommendation
Consider changing the condition to