Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vminkov committed Mar 19, 2024
1 parent 9eea8ad commit 169f954
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions contracts/compound/ComptrollerFirstExtension.sol
Original file line number Diff line number Diff line change
Expand Up @@ -442,16 +442,16 @@ contract ComptrollerFirstExtension is
view
returns (uint256 _totalPages, address[] memory _pageOfBorrowers)
{
if (pageSize == 0) pageSize = 300;
uint256 currentPageSize = pageSize;
uint256 allBorrowersCount = allBorrowers.length;

if (allBorrowersCount == 0) {
return (0, new address[](0));
}

_totalPages = allBorrowersCount / pageSize;
if (pageSize == 0) pageSize = 300;
uint256 currentPageSize = pageSize;
uint256 sizeOfPageFromRemainder = allBorrowersCount % pageSize;

_totalPages = allBorrowersCount / pageSize;
if (sizeOfPageFromRemainder > 0) {
_totalPages++;
if (page + 1 == _totalPages) {
Expand All @@ -463,9 +463,9 @@ contract ComptrollerFirstExtension is
return (_totalPages, new address[](0));
}

uint256 offset = page * pageSize;
_pageOfBorrowers = new address[](currentPageSize);
for (uint256 i = 0; i < currentPageSize; i++) {
uint256 offset = page * pageSize;
_pageOfBorrowers[i] = allBorrowers[i + offset];
}
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/liquidators/IonicLiquidatorTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ contract IonicLiquidatorTest is UpgradesBaseTest {
swapRouter = 0x5D61c537393cf21893BE619E36fC94cd73C77DD3; // kim router
//quoter = IUniswapV3Quoter(0x7Fd569b2021850fbA53887dd07736010aCBFc787); // other sup quoter?
quoter = IUniswapV3Quoter(0x5E6AEbab1AD525f5336Bd12E6847b851531F72ba); // sup quoter
usdcWhale = 0xB4fb31E7B1471A8e52dD1e962A281a732EaD59c1;
usdcWhale = 0x34b83A3759ba4c9F99c339604181bf6bBdED4C79; // vault
wethWhale = 0xF4C85269240C1D447309fA602A90ac23F1CB0Dc0;
poolAddress = 0xFB3323E24743Caf4ADD0fDCCFB268565c0685556;
//uniV3PooForFlash = 0x293f2B2c17f8cEa4db346D87Ef5712C9dd0491EF; // kim weth-usdc pool
Expand Down

0 comments on commit 169f954

Please sign in to comment.