Skip to content

Commit

Permalink
fix: some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Feb 6, 2025
1 parent 8c86635 commit 297fd84
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
44 changes: 22 additions & 22 deletions snapshots/BatchRepayBadDebtSteward.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"function batchLiquidate: with 0 users": "71060",
"function batchLiquidate: with 1 user": "584711",
"function batchLiquidate: with 2 users": "872924",
"function batchLiquidate: with 3 users": "1179875",
"function batchLiquidate: with 4 users": "1509830",
"function batchLiquidate: with 5 users": "1831233",
"function batchLiquidate: with 6 users": "2051923",
"function batchLiquidate: with 1 user": "582428",
"function batchLiquidate: with 2 users": "868360",
"function batchLiquidate: with 3 users": "1173028",
"function batchLiquidate: with 4 users": "1500701",
"function batchLiquidate: with 5 users": "1819821",
"function batchLiquidate: with 6 users": "2038229",
"function batchLiquidateWithMaxCap: with 0 users": "86155",
"function batchLiquidateWithMaxCap: with 1 user": "599424",
"function batchLiquidateWithMaxCap: with 2 users": "879479",
Expand All @@ -14,22 +14,22 @@
"function batchLiquidateWithMaxCap: with 5 users": "1788395",
"function batchLiquidateWithMaxCap: with 6 users": "2000926",
"function batchRepayBadDebt: with 0 users": "70085",
"function batchRepayBadDebt: with 1 user": "222265",
"function batchRepayBadDebt: with 2 users": "284669",
"function batchRepayBadDebt: with 3 users": "347073",
"function batchRepayBadDebt: with 4 users": "409476",
"function batchRepayBadDebt: with 5 users": "471880",
"function batchRepayBadDebt: with 6 users": "534284",
"function batchRepayBadDebt: with 1 user": "222254",
"function batchRepayBadDebt: with 2 users": "284647",
"function batchRepayBadDebt: with 3 users": "347040",
"function batchRepayBadDebt: with 4 users": "409432",
"function batchRepayBadDebt: with 5 users": "471825",
"function batchRepayBadDebt: with 6 users": "534218",
"function getBadDebtAmount: with 0 users": "12830",
"function getBadDebtAmount: with 1 user": "38647",
"function getBadDebtAmount: with 2 users": "51412",
"function getBadDebtAmount: with 4 users": "76944",
"function getBadDebtAmount: with 5 users": "89710",
"function getBadDebtAmount: with 6 users": "102476",
"function getBadDebtAmount: with 1 user": "38636",
"function getBadDebtAmount: with 2 users": "51390",
"function getBadDebtAmount: with 4 users": "76900",
"function getBadDebtAmount: with 5 users": "89655",
"function getBadDebtAmount: with 6 users": "102410",
"function getDebtAmount: with 0 users": "12897",
"function getDebtAmount: with 1 user": "38645",
"function getDebtAmount: with 2 users": "51412",
"function getDebtAmount: with 4 users": "76735",
"function getDebtAmount: with 5 users": "89432",
"function getDebtAmount: with 6 users": "102129"
"function getDebtAmount: with 1 user": "34363",
"function getDebtAmount: with 2 users": "51390",
"function getDebtAmount: with 4 users": "59606",
"function getDebtAmount: with 5 users": "68020",
"function getDebtAmount: with 6 users": "76435"
}
8 changes: 5 additions & 3 deletions src/maintenance/BatchRepayBadDebtSteward.sol
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,12 @@ contract BatchRepayBadDebtSteward is
address user;
for (uint256 i = 0; i < length; i++) {
user = users[i];
DataTypes.UserConfigurationMap memory userConfiguration = POOL.getUserConfiguration(user);

if (!usersCanHaveCollateral && userConfiguration.isUsingAsCollateralAny()) {
revert UserHasSomeCollateral(user);
if (!usersCanHaveCollateral) {
DataTypes.UserConfigurationMap memory userConfiguration = POOL.getUserConfiguration(user);
if (userConfiguration.isUsingAsCollateralAny()) {
revert UserHasSomeCollateral(user);
}
}

totalDebtAmount += debtAmounts[i] = IERC20(variableDebtTokenAddress).balanceOf(user);
Expand Down

0 comments on commit 297fd84

Please sign in to comment.