From 026fef06681f94f0a142b6d9da83e9301f6e1bc1 Mon Sep 17 00:00:00 2001 From: lsqrl Date: Tue, 19 Dec 2023 17:04:14 +0100 Subject: [PATCH] fix i10 --- src/services/DebitService.sol | 3 --- src/services/debit/GmxService.sol | 1 - 2 files changed, 4 deletions(-) diff --git a/src/services/DebitService.sol b/src/services/DebitService.sol index 3176865..e865364 100644 --- a/src/services/DebitService.sol +++ b/src/services/DebitService.sol @@ -80,10 +80,7 @@ abstract contract DebitService is Service, BaseRiskModel { address(this), agreement.loans[index].margin ); - // No need to launch borrow if amount is zero uint256 freeLiquidity; - // this call does not constitute reentrancy, since transferring additional margin - // has the same effect as opening a single position with the sum of the two margins (freeLiquidity, ) = manager.borrow( agreement.loans[index].token, agreement.loans[index].amount, diff --git a/src/services/debit/GmxService.sol b/src/services/debit/GmxService.sol index d9a91f9..44a45a8 100644 --- a/src/services/debit/GmxService.sol +++ b/src/services/debit/GmxService.sol @@ -75,7 +75,6 @@ contract GmxService is AuctionRateModel, DebitService { ); totalCollateral += agreement.collaterals[0].amount; - // This check is here to protect the msg.sender from slippage, therefore reentrancy is not an issue if (totalCollateral == 0) revert ZeroGlpSupply(); // we assign a virtual deposit of v * A / S, __afterwards__ we update the total deposits virtualDeposit[id] =