Skip to content

Commit

Permalink
fix i9
Browse files Browse the repository at this point in the history
  • Loading branch information
lsqrl committed Dec 19, 2023
1 parent 0557a51 commit 2efa09e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ contract Vault is IVault, ERC4626, ERC20Permit {
currentLosses = _calculateLockedLosses() + (assets - loan);
latestRepay = block.timestamp;

IERC20(asset()).safeTransfer(receiver, assets);
if (assets > 0) IERC20(asset()).safeTransfer(receiver, assets);

emit Borrowed(receiver, assets);

Expand Down Expand Up @@ -265,7 +265,7 @@ contract Vault is IVault, ERC4626, ERC20Permit {
// the vault is not responsible for any payoff
// slither-disable-next-line arbitrary-send-erc20
// super.totalAssets() += assets and never overflows by definition
IERC20(asset()).safeTransferFrom(repayer, address(this), assets);
if (assets > 0) IERC20(asset()).safeTransferFrom(repayer, address(this), assets);

emit Repaid(repayer, assets, debt);
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/credit/CallOption.sol
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ contract CallOption is CreditService {
toBorrow = toTransfer - redeemed > freeLiquidity ? freeLiquidity : toTransfer - redeemed;
}
// We will always have ithil.balanceOf(address(this)) >= toCall, so the following succeeds
ithil.safeTransfer(ownerAddress, toCall);
if (toCall > 0) ithil.safeTransfer(ownerAddress, toCall);
// repay the user's losses
if (toBorrow > 0 && freeLiquidity > 0) manager.borrow(agreement.loans[0].token, toBorrow, 0, ownerAddress);
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/debit/GmxService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ contract GmxService is AuctionRateModel, DebitService {
totalRewards = toTransfer < newRewards ? newRewards - toTransfer : 0;
totalCollateral -= agreement.collaterals[0].amount;
// Transfer weth: since toTransfer <= totalWithdraw
weth.safeTransfer(msg.sender, toTransfer);
if (toTransfer > 0) weth.safeTransfer(msg.sender, toTransfer);
}

function wethReward(uint256 tokenID) public view returns (uint256) {
Expand Down

0 comments on commit 2efa09e

Please sign in to comment.