|
1 | 1 | // SPDX-License-Identifier: MIT |
2 | 2 | pragma solidity 0.8.26; |
3 | 3 |
|
4 | | -import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; |
| 4 | +import { ReentrancyGuard } from "@openzeppelin/contracts@v5.0.2/utils/ReentrancyGuard.sol"; |
5 | 5 |
|
6 | | -import { TokenCollector } from "./abstracts/TokenCollector.sol"; |
7 | | -import { Ownable } from "./abstracts/Ownable.sol"; |
8 | 6 | import { EIP712 } from "./abstracts/EIP712.sol"; |
9 | | -import { IWETH } from "./interfaces/IWETH.sol"; |
| 7 | +import { Ownable } from "./abstracts/Ownable.sol"; |
| 8 | +import { TokenCollector } from "./abstracts/TokenCollector.sol"; |
| 9 | + |
10 | 10 | import { ILimitOrderSwap } from "./interfaces/ILimitOrderSwap.sol"; |
11 | 11 | import { IStrategy } from "./interfaces/IStrategy.sol"; |
| 12 | +import { IWETH } from "./interfaces/IWETH.sol"; |
| 13 | + |
| 14 | +import { Asset } from "./libraries/Asset.sol"; |
12 | 15 | import { Constant } from "./libraries/Constant.sol"; |
13 | 16 | import { LimitOrder, getLimitOrderHash } from "./libraries/LimitOrder.sol"; |
14 | | -import { Asset } from "./libraries/Asset.sol"; |
15 | 17 | import { SignatureValidator } from "./libraries/SignatureValidator.sol"; |
16 | 18 |
|
17 | 19 | /// @title LimitOrderSwap Contract |
@@ -88,7 +90,7 @@ contract LimitOrderSwap is ILimitOrderSwap, Ownable, TokenCollector, EIP712, Ree |
88 | 90 | uint256[] memory takerTokenAmounts = new uint256[](orders.length); |
89 | 91 | uint256 wethToPay; |
90 | 92 | address payable _feeCollector = feeCollector; |
91 | | - for (uint256 i = 0; i < orders.length; ++i) { |
| 93 | + for (uint256 i; i < orders.length; ++i) { |
92 | 94 | LimitOrder calldata order = orders[i]; |
93 | 95 | uint256 makingAmount = makerTokenAmounts[i]; |
94 | 96 | if (makingAmount == 0) revert ZeroMakerSpendingAmount(); |
@@ -133,13 +135,13 @@ contract LimitOrderSwap is ILimitOrderSwap, Ownable, TokenCollector, EIP712, Ree |
133 | 135 | } |
134 | 136 | } |
135 | 137 |
|
136 | | - for (uint256 i = 0; i < orders.length; ++i) { |
| 138 | + for (uint256 i; i < orders.length; ++i) { |
137 | 139 | LimitOrder calldata order = orders[i]; |
138 | 140 | order.takerToken.transferTo(order.maker, takerTokenAmounts[i]); |
139 | 141 | } |
140 | 142 |
|
141 | 143 | // any token left is considered as profit |
142 | | - for (uint256 i = 0; i < profitTokens.length; ++i) { |
| 144 | + for (uint256 i; i < profitTokens.length; ++i) { |
143 | 145 | uint256 profit = profitTokens[i].getBalance(address(this)); |
144 | 146 | profitTokens[i].transferTo(payable(msg.sender), profit); |
145 | 147 | } |
|
0 commit comments