Skip to content

Commit

Permalink
fix: cannot borrow reserves
Browse files Browse the repository at this point in the history
  • Loading branch information
QGarchery committed Jan 29, 2024
1 parent e46bbba commit de77d30
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/prod/compound/setup/TestSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ contract TestSetup is Config, ProdTest {
uint96 _amount,
uint256 _price
) internal view returns (uint256) {
ICToken poolToken = ICToken(_market.poolToken);
return
bound(
_amount,
Expand All @@ -199,9 +200,7 @@ contract TestSetup is Config, ProdTest {
Math.min(
Math.min(
(_market.maxBorrows - _market.totalBorrows) / 2,
_market.underlying == wEth
? cEth.balance
: ERC20(_market.underlying).balanceOf(_market.poolToken)
poolToken.getCash() - poolToken.totalReserves()
),
MAX_USD_AMOUNT.div(_price)
),
Expand Down

0 comments on commit de77d30

Please sign in to comment.