Skip to content

Commit

Permalink
fix: Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf committed Nov 15, 2022
1 parent ab07a4e commit 84b900c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ library ReserveConfiguration {
uint256 internal constant BORROWABLE_IN_ISOLATION_START_BIT_POSITION = 61;
uint256 internal constant SILOED_BORROWING_START_BIT_POSITION = 62;
uint256 internal constant FLASHLOAN_ENABLED_START_BIT_POSITION = 63;

uint256 internal constant RESERVE_FACTOR_START_BIT_POSITION = 64;
uint256 internal constant BORROW_CAP_START_BIT_POSITION = 80;
uint256 internal constant SUPPLY_CAP_START_BIT_POSITION = 116;
Expand Down
6 changes: 4 additions & 2 deletions contracts/protocol/libraries/logic/LiquidationLogic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ library LiquidationLogic {
// Transfer fee to treasury if it is non-zero
if (vars.liquidationProtocolFeeAmount != 0) {
uint256 liquidityIndex = collateralReserve.getNormalizedIncome();
uint256 scaledDownLiquidationProtocolFee = vars.liquidationProtocolFeeAmount.rayDiv(liquidityIndex);
uint256 scaledDownLiquidationProtocolFee = vars.liquidationProtocolFeeAmount.rayDiv(
liquidityIndex
);
uint256 scaledDownUserBalance = vars.collateralAToken.scaledBalanceOf(params.user);
// To avoid trying to send more aTokens than available on balance, due to 1 wei imprecision
if (scaledDownLiquidationProtocolFee > scaledDownUserBalance) {
Expand All @@ -211,7 +213,7 @@ library LiquidationLogic {
vars.liquidationProtocolFeeAmount
);
}

// Transfers the debt asset being repaid to the aToken, where the liquidity is kept
IERC20(params.debtAsset).safeTransferFrom(
msg.sender,
Expand Down
6 changes: 2 additions & 4 deletions contracts/protocol/libraries/logic/ReserveLogic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,8 @@ library ReserveLogic {
reserveCache.reserveLastUpdateTimestamp = reserve.lastUpdateTimestamp;

reserveCache.currScaledVariableDebt = reserveCache.nextScaledVariableDebt = IVariableDebtToken(
reserveCache
.variableDebtTokenAddress
)
.scaledTotalSupply();
reserveCache.variableDebtTokenAddress
).scaledTotalSupply();

(
reserveCache.currPrincipalStableDebt,
Expand Down
5 changes: 0 additions & 5 deletions test-suites/stable-debt-token-events.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,6 @@ makeSuite('StableDebtToken: Events', (testEnv: TestEnv) => {
aliceBalanceBefore.add(balances.balance[alice.address]),
2
);
log(
'check',
aliceBalanceAfter.toString(),
aliceBalanceBefore.add(balances.balance[alice.address]).toString()
);
};

it('Alice borrows 100 DAI, Bob borrows 100 DAI, Alice borrows 50 DAI, repays 150 DAI and repays 100 DAI on behalf of Bob, borrows 10 DAI more (without index change)', async () => {
Expand Down

0 comments on commit 84b900c

Please sign in to comment.