The function _doBorrow() of BlueBerryBank.sol does not verify if value of uBalanceBefore is 0.
Summary
The function _doBorrow() of BlueBerryBank.sol does not verify if value of uBalanceBefore is 0, which can lead to unnecessary calculation, unexpected issues and gas costs. This could mean adding 0 amount check in the borrowfunction (caller) itself. (Same goes for the repay function as well)
Vulnerability Detail
function _doBorrow() of BlueBerryBank.sol does not verify if value of uBalanceBefore is 0 which can possible lead to unexpected issues / gas costs.
Impact
function _doBorrow() of BlueBerryBank.sol does not verify if value of uBalanceBefore is 0 which can possible lead to unexpected issues / gas costs.
SanketKogekar
medium
The function
_doBorrow()
ofBlueBerryBank.sol
does not verify if value ofuBalanceBefore
is 0.Summary
The function
_doBorrow()
ofBlueBerryBank.sol
does not verify if value ofuBalanceBefore
is 0, which can lead to unnecessary calculation, unexpected issues and gas costs. This could mean adding 0 amount check in theborrow
function (caller) itself. (Same goes for the repay function as well)Vulnerability Detail
function
_doBorrow()
ofBlueBerryBank.sol
does not verify if value ofuBalanceBefore
is 0 which can possible lead to unexpected issues / gas costs.Impact
function
_doBorrow()
ofBlueBerryBank.sol
does not verify if value ofuBalanceBefore
is 0 which can possible lead to unexpected issues / gas costs.Code Snippet
https://github.com/sherlock-audit/2023-04-blueberry/blob/main/blueberry-core/contracts/BlueBerryBank.sol#L832
Tool used
Manual Review
Recommendation
revert if uBalanceBefore == 0