Skip to content

Commit d0a2ce7

Browse files
Fix MultiPegOutPayer build annotations by correcting declaration order and optimizing the loop
1 parent a8d761e commit d0a2ce7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/test-contracts/MultiPegOutPayer.sol

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import {Quotes} from "../libraries/Quotes.sol";
66

77
// solhint-disable comprehensive-interface
88
contract MultiPegOutPayer {
9-
IPegOut public immutable LBC;
10-
address public immutable OWNER;
11-
129
struct PegOutPayment {
1310
Quotes.PegOutQuote quote;
1411
bytes signature;
1512
}
1613

14+
IPegOut public immutable LBC;
15+
address public immutable OWNER;
16+
1717
event Deposit(address indexed sender, uint256 indexed amount);
1818
event Withdraw(address indexed owner, uint256 indexed amount);
1919

@@ -32,7 +32,8 @@ contract MultiPegOutPayer {
3232

3333
/// @notice Pays for all N quotes in a single transaction, emitting N PegOutDeposit events.
3434
function executeMultiplePegOuts(PegOutPayment[] calldata payments) external {
35-
for (uint256 i = 0; i < payments.length; i++) {
35+
uint256 paymentsLength = payments.length;
36+
for (uint256 i = 0; i < paymentsLength; ++i) {
3637
Quotes.PegOutQuote calldata q = payments[i].quote;
3738
uint256 total = q.value + q.gasFee + q.callFee;
3839
if (address(this).balance < total) {

0 commit comments

Comments
 (0)