Skip to content

Commit 781dbd8

Browse files
committed
Build an Across specific transfer bridge test
1 parent a2d4781 commit 781dbd8

18 files changed

+255
-31
lines changed

src/builder/actions/CometActionsBuilder.sol

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ contract CometActionsBuilder is QuarkBuilderBase {
2727
string[] collateralAssetSymbols;
2828
address comet;
2929
address repayer;
30+
bool preferAcross;
3031
}
3132

3233
function cometRepay(
@@ -84,7 +85,7 @@ contract CometActionsBuilder is QuarkBuilderBase {
8485
useQuotecall: useQuotecall,
8586
bridgeEnabled: true,
8687
autoWrapperEnabled: true,
87-
preferAcross: true
88+
preferAcross: repayIntent.preferAcross
8889
});
8990
}
9091

@@ -115,6 +116,7 @@ contract CometActionsBuilder is QuarkBuilderBase {
115116
uint256[] collateralAmounts;
116117
string[] collateralAssetSymbols;
117118
address comet;
119+
bool preferAcross;
118120
}
119121

120122
function cometBorrow(
@@ -162,7 +164,7 @@ contract CometActionsBuilder is QuarkBuilderBase {
162164
useQuotecall: useQuotecall,
163165
bridgeEnabled: true,
164166
autoWrapperEnabled: true,
165-
preferAcross: true
167+
preferAcross: borrowIntent.preferAcross
166168
});
167169
}
168170

@@ -191,6 +193,7 @@ contract CometActionsBuilder is QuarkBuilderBase {
191193
uint256 chainId;
192194
address comet;
193195
address sender;
196+
bool preferAcross;
194197
}
195198

196199
function cometSupply(
@@ -248,7 +251,7 @@ contract CometActionsBuilder is QuarkBuilderBase {
248251
useQuotecall: isMaxSupply,
249252
bridgeEnabled: true,
250253
autoWrapperEnabled: true,
251-
preferAcross: true
254+
preferAcross: cometSupplyIntent.preferAcross
252255
}),
253256
chainAccountsList: chainAccountsList,
254257
payment: payment,
@@ -273,6 +276,7 @@ contract CometActionsBuilder is QuarkBuilderBase {
273276
uint256 chainId;
274277
address comet;
275278
address withdrawer;
279+
bool preferAcross;
276280
}
277281

278282
function cometWithdraw(
@@ -334,7 +338,7 @@ contract CometActionsBuilder is QuarkBuilderBase {
334338
useQuotecall: useQuotecall,
335339
bridgeEnabled: true,
336340
autoWrapperEnabled: true,
337-
preferAcross: true
341+
preferAcross: cometWithdrawIntent.preferAcross
338342
}),
339343
chainAccountsList: chainAccountsList,
340344
payment: payment,

src/builder/actions/MorphoActionsBuilder.sol

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ contract MorphoActionsBuilder is QuarkBuilderBase {
2626
uint256 chainId;
2727
uint256 collateralAmount;
2828
string collateralAssetSymbol;
29+
bool preferAcross;
2930
}
3031

3132
function morphoBorrow(
@@ -72,7 +73,7 @@ contract MorphoActionsBuilder is QuarkBuilderBase {
7273
useQuotecall: useQuotecall,
7374
bridgeEnabled: true,
7475
autoWrapperEnabled: true,
75-
preferAcross: true
76+
preferAcross: borrowIntent.preferAcross
7677
});
7778
}
7879

@@ -102,6 +103,7 @@ contract MorphoActionsBuilder is QuarkBuilderBase {
102103
uint256 chainId;
103104
uint256 collateralAmount;
104105
string collateralAssetSymbol;
106+
bool preferAcross;
105107
}
106108

107109
function morphoRepay(
@@ -165,7 +167,7 @@ contract MorphoActionsBuilder is QuarkBuilderBase {
165167
useQuotecall: useQuotecall,
166168
bridgeEnabled: true,
167169
autoWrapperEnabled: true,
168-
preferAcross: true
170+
preferAcross: repayIntent.preferAcross
169171
}),
170172
chainAccountsList: chainAccountsList,
171173
payment: payment,
@@ -192,6 +194,7 @@ contract MorphoActionsBuilder is QuarkBuilderBase {
192194
address[] distributors;
193195
address[] rewards;
194196
bytes32[][] proofs;
197+
bool preferAcross;
195198
}
196199

197200
function morphoClaimRewards(
@@ -249,7 +252,7 @@ contract MorphoActionsBuilder is QuarkBuilderBase {
249252
useQuotecall: useQuotecall,
250253
bridgeEnabled: true,
251254
autoWrapperEnabled: true,
252-
preferAcross: true
255+
preferAcross: claimIntent.preferAcross
253256
});
254257
}
255258

src/builder/actions/MorphoVaultActionsBuilder.sol

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ contract MorphoVaultActionsBuilder is QuarkBuilderBase {
2424
uint256 blockTimestamp;
2525
address sender;
2626
uint256 chainId;
27+
bool preferAcross;
2728
}
2829

2930
function morphoVaultSupply(
@@ -81,7 +82,7 @@ contract MorphoVaultActionsBuilder is QuarkBuilderBase {
8182
useQuotecall: useQuotecall,
8283
bridgeEnabled: true,
8384
autoWrapperEnabled: true,
84-
preferAcross: true
85+
preferAcross: supplyIntent.preferAcross
8586
}),
8687
chainAccountsList: chainAccountsList,
8788
payment: payment,
@@ -105,6 +106,7 @@ contract MorphoVaultActionsBuilder is QuarkBuilderBase {
105106
uint256 blockTimestamp;
106107
uint256 chainId;
107108
address withdrawer;
109+
bool preferAcross;
108110
}
109111

110112
function morphoVaultWithdraw(
@@ -168,7 +170,7 @@ contract MorphoVaultActionsBuilder is QuarkBuilderBase {
168170
useQuotecall: useQuotecall,
169171
bridgeEnabled: true,
170172
autoWrapperEnabled: true,
171-
preferAcross: true
173+
preferAcross: withdrawIntent.preferAcross
172174
});
173175
}
174176

src/builder/actions/SwapActionsBuilder.sol

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ contract SwapActionsBuilder is QuarkBuilderBase {
3131
address sender;
3232
bool isExactOut;
3333
uint256 blockTimestamp;
34+
bool preferAcross;
3435
}
3536

3637
function swap(
@@ -112,7 +113,7 @@ contract SwapActionsBuilder is QuarkBuilderBase {
112113
useQuotecall: isMaxSwap,
113114
bridgeEnabled: true,
114115
autoWrapperEnabled: true,
115-
preferAcross: true
116+
preferAcross: swapIntent.preferAcross
116117
});
117118
}
118119

@@ -146,6 +147,7 @@ contract SwapActionsBuilder is QuarkBuilderBase {
146147
uint256 interval;
147148
address sender;
148149
uint256 blockTimestamp;
150+
bool preferAcross;
149151
}
150152

151153
// Note: We don't currently bridge the input token or the payment token for recurring swaps. Recurring swaps
@@ -207,7 +209,7 @@ contract SwapActionsBuilder is QuarkBuilderBase {
207209
useQuotecall: false,
208210
bridgeEnabled: false,
209211
autoWrapperEnabled: false,
210-
preferAcross: true
212+
preferAcross: swapIntent.preferAcross
211213
});
212214
}
213215

src/builder/actions/TransferActionsBuilder.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ contract TransferActionsBuilder is QuarkBuilderBase {
2525
address sender;
2626
address recipient;
2727
uint256 blockTimestamp;
28+
bool preferAcross;
2829
}
2930

3031
function transfer(
@@ -82,7 +83,7 @@ contract TransferActionsBuilder is QuarkBuilderBase {
8283
useQuotecall: useQuotecall,
8384
bridgeEnabled: true,
8485
autoWrapperEnabled: true,
85-
preferAcross: true
86+
preferAcross: transferIntent.preferAcross
8687
});
8788
}
8889

test/builder/BridgingLogic.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ contract BridgingLogicTest is Test, QuarkBuilderTest {
6161
amount: 1e18,
6262
sender: address(0xb0b),
6363
recipient: address(0xceecee),
64-
blockTimestamp: BLOCK_TIMESTAMP
64+
blockTimestamp: BLOCK_TIMESTAMP,
65+
preferAcross: false
6566
}), // transfer 1e18 WETH on chain 8453 to 0xceecee
6667
chainAccountsList,
6768
paymentUsd_()

test/builder/QuarkBuilderCometBorrow.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ contract QuarkBuilderCometBorrowTest is Test, QuarkBuilderTest {
3333
chainId: chainId,
3434
collateralAmounts: collateralAmounts,
3535
collateralAssetSymbols: collateralAssetSymbols,
36-
comet: cometUsdc_(1)
36+
comet: cometUsdc_(1),
37+
preferAcross: false
3738
});
3839
}
3940

test/builder/QuarkBuilderCometRepay.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ contract QuarkBuilderCometRepayTest is Test, QuarkBuilderTest {
3434
collateralAmounts: collateralAmounts,
3535
collateralAssetSymbols: collateralAssetSymbols,
3636
comet: comet,
37-
repayer: address(0xa11ce)
37+
repayer: address(0xa11ce),
38+
preferAcross: false
3839
});
3940
}
4041

test/builder/QuarkBuilderCometSupply.t.sol

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ contract QuarkBuilderCometSupplyTest is Test, QuarkBuilderTest {
3131
blockTimestamp: BLOCK_TIMESTAMP,
3232
chainId: chainId,
3333
comet: COMET_ETH,
34-
sender: address(0xa11ce)
34+
sender: address(0xa11ce),
35+
preferAcross: false
3536
});
3637
}
3738

@@ -54,7 +55,8 @@ contract QuarkBuilderCometSupplyTest is Test, QuarkBuilderTest {
5455
blockTimestamp: BLOCK_TIMESTAMP,
5556
chainId: chainId,
5657
comet: COMET,
57-
sender: sender
58+
sender: sender,
59+
preferAcross: false
5860
});
5961
}
6062

test/builder/QuarkBuilderCometWithdraw.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ contract QuarkBuilderCometWithdrawTest is Test, QuarkBuilderTest {
4141
blockTimestamp: BLOCK_TIMESTAMP,
4242
chainId: chainId,
4343
comet: comet,
44-
withdrawer: withdrawer
44+
withdrawer: withdrawer,
45+
preferAcross: false
4546
});
4647
}
4748

test/builder/QuarkBuilderMorphoBorrow.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ contract QuarkBuilderMorphoBorrowTest is Test, QuarkBuilderTest {
5252
borrower: borrower,
5353
chainId: chainId,
5454
collateralAmount: collateralAmount,
55-
collateralAssetSymbol: collateralAssetSymbol
55+
collateralAssetSymbol: collateralAssetSymbol,
56+
preferAcross: false
5657
});
5758
}
5859

test/builder/QuarkBuilderMorphoClaimRewards.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ contract QuarkBuilderMorphoClaimRewardsTest is Test, QuarkBuilderTest {
7272
claimables: claimables,
7373
distributors: distributors,
7474
rewards: rewards,
75-
proofs: proofs
75+
proofs: proofs,
76+
preferAcross: false
7677
});
7778
}
7879

test/builder/QuarkBuilderMorphoRepay.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ contract QuarkBuilderMorphoRepayTest is Test, QuarkBuilderTest {
5353
repayer: repayer,
5454
chainId: chainId,
5555
collateralAmount: collateralAmount,
56-
collateralAssetSymbol: collateralAssetSymbol
56+
collateralAssetSymbol: collateralAssetSymbol,
57+
preferAcross: false
5758
});
5859
}
5960

test/builder/QuarkBuilderMorphoVaultSupply.t.sol

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ contract QuarkBuilderMorphoVaultTest is Test, QuarkBuilderTest {
3939
assetSymbol: assetSymbol,
4040
blockTimestamp: BLOCK_TIMESTAMP,
4141
chainId: chainId,
42-
sender: sender
42+
sender: sender,
43+
preferAcross: false
4344
});
4445
}
4546

@@ -52,7 +53,8 @@ contract QuarkBuilderMorphoVaultTest is Test, QuarkBuilderTest {
5253
assetSymbol: "USDC",
5354
blockTimestamp: BLOCK_TIMESTAMP,
5455
sender: address(0xa11ce),
55-
chainId: 1
56+
chainId: 1,
57+
preferAcross: false
5658
}),
5759
chainAccountsList_(0e6), // but we are holding 0 USDC in total across 1, 8453
5860
paymentUsd_()
@@ -69,7 +71,8 @@ contract QuarkBuilderMorphoVaultTest is Test, QuarkBuilderTest {
6971
assetSymbol: "USDC",
7072
blockTimestamp: BLOCK_TIMESTAMP,
7173
sender: address(0xa11ce),
72-
chainId: 1
74+
chainId: 1,
75+
preferAcross: false
7376
}),
7477
chainAccountsList_(2e6), // holding 2 USDC in total across 1, 8453
7578
paymentUsdc_(maxCosts_(1, 1_000e6)) // but costs 1,000 USDC
@@ -112,7 +115,8 @@ contract QuarkBuilderMorphoVaultTest is Test, QuarkBuilderTest {
112115
assetSymbol: "USDC",
113116
blockTimestamp: BLOCK_TIMESTAMP,
114117
sender: address(0xa11ce),
115-
chainId: 1
118+
chainId: 1,
119+
preferAcross: false
116120
}),
117121
chainAccountsList,
118122
paymentUsd_()
@@ -127,7 +131,8 @@ contract QuarkBuilderMorphoVaultTest is Test, QuarkBuilderTest {
127131
assetSymbol: "USDC",
128132
blockTimestamp: BLOCK_TIMESTAMP,
129133
sender: address(0xa11ce),
130-
chainId: 1
134+
chainId: 1,
135+
preferAcross: false
131136
}),
132137
chainAccountsList_(3e6), // holding 3 USDC in total across chains 1, 8453
133138
paymentUsd_()
@@ -202,7 +207,8 @@ contract QuarkBuilderMorphoVaultTest is Test, QuarkBuilderTest {
202207
assetSymbol: "USDC",
203208
blockTimestamp: BLOCK_TIMESTAMP,
204209
sender: address(0xa11ce),
205-
chainId: 1
210+
chainId: 1,
211+
preferAcross: false
206212
}),
207213
chainAccountsList, // holding 3 USDC in total across chains 1, 8453
208214
paymentUsd_()

test/builder/QuarkBuilderMorphoVaultWithdraw.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ contract QuarkBuilderMorphoVaultWithdrawTest is Test, QuarkBuilderTest {
4040
assetSymbol: assetSymbol,
4141
blockTimestamp: BLOCK_TIMESTAMP,
4242
chainId: chainId,
43-
withdrawer: withdrawer
43+
withdrawer: withdrawer,
44+
preferAcross: false
4445
});
4546
}
4647

test/builder/QuarkBuilderRecurringSwap.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ contract QuarkBuilderRecurringSwapTest is Test, QuarkBuilderTest {
7272
path: path,
7373
interval: interval,
7474
sender: sender,
75-
blockTimestamp: blockTimestamp
75+
blockTimestamp: blockTimestamp,
76+
preferAcross: false
7677
});
7778
}
7879

test/builder/QuarkBuilderSwap.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ contract QuarkBuilderSwapTest is Test, QuarkBuilderTest {
9292
feeAmount: 10,
9393
sender: sender,
9494
isExactOut: false,
95-
blockTimestamp: blockTimestamp
95+
blockTimestamp: blockTimestamp,
96+
preferAcross: false
9697
});
9798
}
9899

0 commit comments

Comments
 (0)