Closed sherlock-admin closed 1 year ago
SanketKogekar
medium
liqThreshold
BlueBerryBank.addBank()
liqThreshold could be less than or equal to Constants.MIN_LIQ_THRESHOLD and also could be greater than or equal to Constants.DENOMINATOR.
Having liqThreshold is on the edge (upper/lower limits), is not allowed.
If liqThreshold is on the edge (upper/lower limits), it would still revert.
if (liqThreshold > Constants.DENOMINATOR) revert Errors.LIQ_THRESHOLD_TOO_HIGH(liqThreshold); if (liqThreshold < Constants.MIN_LIQ_THRESHOLD) revert Errors.LIQ_THRESHOLD_TOO_LOW(liqThreshold);
https://github.com/sherlock-audit/2023-04-blueberry/blob/main/blueberry-core/contracts/BlueBerryBank.sol#L248
Manual Review
Consider replacing it by following code
if (liqThreshold >= Constants.DENOMINATOR) revert Errors.LIQ_THRESHOLD_TOO_HIGH(liqThreshold); if (liqThreshold <= Constants.MIN_LIQ_THRESHOLD) revert Errors.LIQ_THRESHOLD_TOO_LOW(liqThreshold);
SanketKogekar
medium
Incorrect
liqThreshold
check inBlueBerryBank.addBank()
Summary
liqThreshold could be less than or equal to Constants.MIN_LIQ_THRESHOLD and also could be greater than or equal to Constants.DENOMINATOR.
Vulnerability Detail
Having liqThreshold is on the edge (upper/lower limits), is not allowed.
Impact
If liqThreshold is on the edge (upper/lower limits), it would still revert.
Code Snippet
https://github.com/sherlock-audit/2023-04-blueberry/blob/main/blueberry-core/contracts/BlueBerryBank.sol#L248
Tool used
Manual Review
Recommendation
Consider replacing it by following code