Skip to content

Commit

Permalink
Merge pull request #230 from Ithil-protocol/audit-fix-i10
Browse files Browse the repository at this point in the history
fix i10
  • Loading branch information
OxMarco authored Dec 20, 2023
2 parents aa9f116 + 026fef0 commit 2fd628b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/services/DebitService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/services/debit/GmxService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,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] =
Expand Down

0 comments on commit 2fd628b

Please sign in to comment.