Description:Description\
Users call [BBBorrow::repay(...)]() to repay their loans.
Also Liquidators call BBLiquidation::liquidateBadDebt(...) to liquidate bad debt and BBLiquidation::_liquidateUser(...). However, due to the implementation of the USDO::burn(...) function, users call to repay will revert when USDO is paused
They are both minted 10_000Usdo each bringing to a total of exactly 20_000Usdo to circulation in the BBLendingCommon::_borrow(...) bringing the totalSupply of USDO to 20_000Usdo
Alice repays her loan but more than 10_000Usdo is burnt on her behalf as seen on L133 above, because the amount of USDO burned now includes accrued fees bring the totalSupply of USDO to less than 10_000 meanwhile Bob has yet to repay his po
Admin pauses USDO
Bob tries to repay but the function reverts because the USDO is paused Bob keeps accruing fees,
Bob has become undercollateralised
Carol tries to liquidate Bob but the transaction reverts because USDO is paused
Attachments
Impact
This can lead to
cascade of bad loans in the protocol
loss of funds for well meaning users who are prevented from repaying their loans due to system desing
Revised Code File (Optional)
Remove the whenNotPaused modifier from the USDO::burn(...) function as shown below
Github username: @Audinarey Twitter username: audinarey Submission hash (on-chain): 0x54044826f2e0e9a845127b83173919d5a9ba05a2c9803e1185a20835aae8b41e Severity: high
Description: Description\ Users call [
BBBorrow::repay(...)
]() to repay their loans. Also Liquidators callBBLiquidation::liquidateBadDebt(...)
to liquidate bad debt andBBLiquidation::_liquidateUser(...)
. However, due to the implementation of theUSDO::burn(...)
function, users call to repay will revert when USDO is pausedThe repay call flow on a high level is
->
BBBorrow::repay(...)
-->BBLendingCommon::_repay(...)
.... --->USDO::burn(...)
The _liquidateUser and liquidateBadDebt call flow on a high level is
->
BBBorrow::liquidateBadDebt(...)
/BBBorrow::_liquidateUser(...)
.... --->USDO::burn(...)
As shown below.
USDO::burn(...)
will revert when USDO is pausedAttack Scenario\
BBLendingCommon::_borrow(...)
bringing thetotalSupply
of USDO to 20_000UsdototalSupply
of USDO to less than 10_000 meanwhile Bob has yet to repay his poAttachments
Impact
This can lead to
Revised Code File (Optional)
whenNotPaused
modifier from theUSDO::burn(...)
function as shown below