@aztec/end-to-end 0.85.0 → 0.86.0-nightly.20250425
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +6 -7
- package/dest/bench/client_flows/data_extractor.js +12 -7
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +2 -0
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +2 -2
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +11 -11
- package/dest/e2e_epochs/epochs_test.d.ts +3 -3
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +4 -2
- package/dest/e2e_fees/fees_test.d.ts +4 -0
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +22 -10
- package/dest/e2e_p2p/p2p_network.d.ts +67 -72
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +20 -61
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +1 -1
- package/dest/e2e_prover/e2e_prover_test.js +10 -9
- package/dest/fixtures/l1_to_l2_messaging.d.ts +2 -3
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +3 -3
- package/dest/fixtures/setup_l1_contracts.d.ts +1 -1
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +15 -13
- package/dest/fixtures/utils.d.ts +5 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +36 -29
- package/dest/shared/capture_private_execution_steps.d.ts.map +1 -1
- package/dest/shared/capture_private_execution_steps.js +3 -17
- package/dest/shared/cross_chain_test_harness.d.ts +7 -11
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +14 -16
- package/dest/shared/gas_portal_test_harness.d.ts +6 -11
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +8 -10
- package/dest/shared/uniswap_l1_l2.d.ts +3 -5
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +18 -19
- package/dest/spartan/setup_test_wallets.js +3 -3
- package/package.json +34 -35
- package/src/bench/client_flows/client_flows_benchmark.ts +6 -8
- package/src/bench/client_flows/data_extractor.ts +10 -6
- package/src/bench/utils.ts +2 -0
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +14 -18
- package/src/e2e_epochs/epochs_test.ts +9 -5
- package/src/e2e_fees/fees_test.ts +32 -10
- package/src/e2e_p2p/p2p_network.ts +28 -74
- package/src/e2e_prover/e2e_prover_test.ts +10 -14
- package/src/fixtures/l1_to_l2_messaging.ts +5 -14
- package/src/fixtures/setup_l1_contracts.ts +1 -2
- package/src/fixtures/snapshot_manager.ts +11 -13
- package/src/fixtures/utils.ts +38 -43
- package/src/shared/capture_private_execution_steps.ts +3 -19
- package/src/shared/cross_chain_test_harness.ts +14 -31
- package/src/shared/gas_portal_test_harness.ts +9 -14
- package/src/shared/uniswap_l1_l2.ts +25 -43
- package/src/spartan/setup_test_wallets.ts +3 -3
package/dest/fixtures/utils.js
CHANGED
|
@@ -8,9 +8,9 @@ import { SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee/testing';
|
|
|
8
8
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
9
9
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
10
10
|
import { createBlobSinkServer } from '@aztec/blob-sink/server';
|
|
11
|
-
import { GENESIS_ARCHIVE_ROOT,
|
|
11
|
+
import { GENESIS_ARCHIVE_ROOT, SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
12
12
|
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
13
|
-
import { ForwarderContract, NULL_KEY,
|
|
13
|
+
import { ForwarderContract, NULL_KEY, createExtendedL1Client, deployL1Contracts, getL1ContractsConfigEnvVars, isAnvilTestChain, l1Artifacts } from '@aztec/ethereum';
|
|
14
14
|
import { DelayedTxUtils, EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
15
15
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
16
16
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
@@ -71,7 +71,6 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
71
71
|
vkTreeRoot: getVKTreeRoot(),
|
|
72
72
|
protocolContractTreeRoot,
|
|
73
73
|
genesisArchiveRoot: args.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
|
|
74
|
-
genesisBlockHash: args.genesisBlockHash ?? new Fr(GENESIS_BLOCK_HASH),
|
|
75
74
|
salt: args.salt,
|
|
76
75
|
initialValidators: args.initialValidators,
|
|
77
76
|
...getL1ContractsConfigEnvVars(),
|
|
@@ -143,11 +142,10 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
143
142
|
logger.verbose('JSON RPC client connected to PXE');
|
|
144
143
|
logger.verbose(`Retrieving contract addresses from ${PXE_URL}`);
|
|
145
144
|
const l1Contracts = (await pxeClient.getNodeInfo()).l1ContractAddresses;
|
|
146
|
-
const
|
|
145
|
+
const l1Client = createExtendedL1Client(config.l1RpcUrls, account, foundry);
|
|
147
146
|
const deployL1ContractsValues = {
|
|
148
147
|
l1ContractAddresses: l1Contracts,
|
|
149
|
-
|
|
150
|
-
publicClient
|
|
148
|
+
l1Client
|
|
151
149
|
};
|
|
152
150
|
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxeClient);
|
|
153
151
|
const teardown = ()=>Promise.resolve();
|
|
@@ -255,11 +253,10 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
255
253
|
return await setupWithRemoteEnvironment(publisherHdAccount, config, logger, numberOfAccounts);
|
|
256
254
|
}
|
|
257
255
|
const initialFundedAccounts = opts.initialFundedAccounts ?? await generateSchnorrAccounts(opts.numberOfInitialFundedAccounts ?? numberOfAccounts);
|
|
258
|
-
const {
|
|
256
|
+
const { genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(initialFundedAccounts.map((a)=>a.address), opts.initialAccountFeeJuice, opts.genesisPublicData);
|
|
259
257
|
const deployL1ContractsValues = opts.deployL1ContractsValues ?? await setupL1Contracts(config.l1RpcUrls, publisherHdAccount, logger, {
|
|
260
258
|
...opts,
|
|
261
259
|
genesisArchiveRoot,
|
|
262
|
-
genesisBlockHash,
|
|
263
260
|
feeJuicePortalInitialBalance: fundingNeeded
|
|
264
261
|
}, chain);
|
|
265
262
|
config.l1Contracts = deployL1ContractsValues.l1ContractAddresses;
|
|
@@ -268,20 +265,20 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
268
265
|
const rewardDistributor = getContract({
|
|
269
266
|
address: deployL1ContractsValues.l1ContractAddresses.rewardDistributorAddress.toString(),
|
|
270
267
|
abi: l1Artifacts.rewardDistributor.contractAbi,
|
|
271
|
-
client: deployL1ContractsValues.
|
|
268
|
+
client: deployL1ContractsValues.l1Client
|
|
272
269
|
});
|
|
273
270
|
const blockReward = await rewardDistributor.read.BLOCK_REWARD();
|
|
274
271
|
const mintAmount = 10_000n * blockReward;
|
|
275
272
|
const feeJuice = getContract({
|
|
276
273
|
address: deployL1ContractsValues.l1ContractAddresses.feeJuiceAddress.toString(),
|
|
277
274
|
abi: l1Artifacts.feeAsset.contractAbi,
|
|
278
|
-
client: deployL1ContractsValues.
|
|
275
|
+
client: deployL1ContractsValues.l1Client
|
|
279
276
|
});
|
|
280
277
|
const rewardDistributorMintTxHash = await feeJuice.write.mint([
|
|
281
278
|
rewardDistributor.address,
|
|
282
279
|
mintAmount
|
|
283
280
|
], {});
|
|
284
|
-
await deployL1ContractsValues.
|
|
281
|
+
await deployL1ContractsValues.l1Client.waitForTransactionReceipt({
|
|
285
282
|
hash: rewardDistributorMintTxHash
|
|
286
283
|
});
|
|
287
284
|
logger.info(`Funding rewardDistributor in ${rewardDistributorMintTxHash}`);
|
|
@@ -292,7 +289,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
292
289
|
await ethCheatCodes.warp(opts.l2StartTime);
|
|
293
290
|
}
|
|
294
291
|
const dateProvider = new TestDateProvider();
|
|
295
|
-
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(config.l1RpcUrls), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.
|
|
292
|
+
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(config.l1RpcUrls), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.l1Client, dateProvider);
|
|
296
293
|
await watcher.start();
|
|
297
294
|
const telemetry = getTelemetryClient(opts.telemetryConfig);
|
|
298
295
|
// Blob sink service - blobs get posted here and served from here
|
|
@@ -319,7 +316,9 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
319
316
|
config.bbWorkingDirectory = bbConfig.bbWorkingDirectory;
|
|
320
317
|
}
|
|
321
318
|
config.l1PublishRetryIntervalMS = 100;
|
|
322
|
-
const blobSinkClient = createBlobSinkClient(config
|
|
319
|
+
const blobSinkClient = createBlobSinkClient(config, {
|
|
320
|
+
logger: createLogger('node:blob-sink:client')
|
|
321
|
+
});
|
|
323
322
|
const aztecNode = await AztecNodeService.createAndSync(config, {
|
|
324
323
|
dateProvider,
|
|
325
324
|
blobSinkClient,
|
|
@@ -337,7 +336,12 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
337
336
|
logger.verbose('Creating and syncing a simulated prover node...');
|
|
338
337
|
const proverNodePrivateKey = getPrivateKeyFromIndex(2);
|
|
339
338
|
const proverNodePrivateKeyHex = `0x${proverNodePrivateKey.toString('hex')}`;
|
|
340
|
-
|
|
339
|
+
const proverNodeDataDirectory = path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
340
|
+
const proverNodeConfig = {
|
|
341
|
+
...config.proverNodeConfig,
|
|
342
|
+
dataDirectory: proverNodeDataDirectory
|
|
343
|
+
};
|
|
344
|
+
proverNode = await createAndSyncProverNode(proverNodePrivateKeyHex, config, proverNodeConfig, aztecNode);
|
|
341
345
|
}
|
|
342
346
|
logger.verbose('Creating a pxe...');
|
|
343
347
|
const { pxe, teardown: pxeTeardown } = await setupPXEService(aztecNode, pxeOpts, logger);
|
|
@@ -513,19 +517,21 @@ export async function waitForProvenChain(node, targetBlock, timeoutSec = 60, int
|
|
|
513
517
|
targetBlock ??= await node.getBlockNumber();
|
|
514
518
|
await retryUntil(async ()=>await node.getProvenBlockNumber() >= targetBlock, 'proven chain status', timeoutSec, intervalSec);
|
|
515
519
|
}
|
|
516
|
-
export async function createAndSyncProverNode(proverNodePrivateKey, aztecNodeConfig,
|
|
520
|
+
export async function createAndSyncProverNode(proverNodePrivateKey, aztecNodeConfig, proverNodeConfig, aztecNode, prefilledPublicData = []) {
|
|
517
521
|
// Disable stopping the aztec node as the prover coordination test will kill it otherwise
|
|
518
522
|
// This is only required when stopping the prover node for testing
|
|
519
|
-
const
|
|
523
|
+
const aztecNodeTxProvider = {
|
|
520
524
|
getTxByHash: aztecNode.getTxByHash.bind(aztecNode),
|
|
521
525
|
getTxsByHash: aztecNode.getTxsByHash.bind(aztecNode),
|
|
522
526
|
stop: ()=>Promise.resolve()
|
|
523
527
|
};
|
|
524
|
-
const blobSinkClient = createBlobSinkClient(aztecNodeConfig
|
|
528
|
+
const blobSinkClient = createBlobSinkClient(aztecNodeConfig, {
|
|
529
|
+
logger: createLogger('prover-node:blob-sink:client')
|
|
530
|
+
});
|
|
525
531
|
// Creating temp store and archiver for simulated prover node
|
|
526
532
|
const archiverConfig = {
|
|
527
533
|
...aztecNodeConfig,
|
|
528
|
-
dataDirectory
|
|
534
|
+
dataDirectory: proverNodeConfig.dataDirectory
|
|
529
535
|
};
|
|
530
536
|
const archiver = await createArchiver(archiverConfig, blobSinkClient, {
|
|
531
537
|
blockUntilSync: true
|
|
@@ -533,41 +539,42 @@ export async function createAndSyncProverNode(proverNodePrivateKey, aztecNodeCon
|
|
|
533
539
|
// Prover node config is for simulated proofs
|
|
534
540
|
const proverConfig = {
|
|
535
541
|
...aztecNodeConfig,
|
|
536
|
-
|
|
537
|
-
dataDirectory: undefined,
|
|
542
|
+
proverCoordinationNodeUrls: [],
|
|
538
543
|
realProofs: false,
|
|
539
544
|
proverAgentCount: 2,
|
|
540
545
|
publisherPrivateKey: proverNodePrivateKey,
|
|
541
546
|
proverNodeMaxPendingJobs: 10,
|
|
542
547
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
543
548
|
proverNodePollingIntervalMs: 200,
|
|
544
|
-
txGatheringTimeoutMs: 60000,
|
|
545
549
|
txGatheringIntervalMs: 1000,
|
|
546
|
-
|
|
550
|
+
txGatheringBatchSize: 10,
|
|
551
|
+
txGatheringMaxParallelRequestsPerNode: 10,
|
|
552
|
+
proverNodeFailedEpochStore: undefined,
|
|
553
|
+
...proverNodeConfig
|
|
547
554
|
};
|
|
548
555
|
const l1TxUtils = createDelayedL1TxUtils(aztecNodeConfig, proverNodePrivateKey, 'prover-node');
|
|
549
556
|
const proverNode = await createProverNode(proverConfig, {
|
|
550
|
-
aztecNodeTxProvider
|
|
557
|
+
aztecNodeTxProvider,
|
|
551
558
|
archiver: archiver,
|
|
552
559
|
l1TxUtils
|
|
553
560
|
}, {
|
|
554
561
|
prefilledPublicData
|
|
555
562
|
});
|
|
556
563
|
getLogger().info(`Created and synced prover node`, {
|
|
557
|
-
publisherAddress: l1TxUtils.
|
|
564
|
+
publisherAddress: l1TxUtils.client.account.address
|
|
558
565
|
});
|
|
559
|
-
proverNode.start();
|
|
566
|
+
await proverNode.start();
|
|
560
567
|
return proverNode;
|
|
561
568
|
}
|
|
562
569
|
function createDelayedL1TxUtils(aztecNodeConfig, privateKey, logName) {
|
|
563
|
-
const
|
|
570
|
+
const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
|
|
564
571
|
const log = createLogger(logName);
|
|
565
|
-
const l1TxUtils = new DelayedTxUtils(
|
|
572
|
+
const l1TxUtils = new DelayedTxUtils(l1Client, log, aztecNodeConfig);
|
|
566
573
|
l1TxUtils.enableDelayer(aztecNodeConfig.ethereumSlotDuration);
|
|
567
574
|
return l1TxUtils;
|
|
568
575
|
}
|
|
569
576
|
export async function createForwarderContract(aztecNodeConfig, privateKey, rollupAddress) {
|
|
570
|
-
const
|
|
571
|
-
const forwarderContract = await ForwarderContract.create(
|
|
577
|
+
const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
|
|
578
|
+
const forwarderContract = await ForwarderContract.create(l1Client.account.address, l1Client, createLogger('forwarder'), rollupAddress);
|
|
572
579
|
return forwarderContract;
|
|
573
580
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture_private_execution_steps.d.ts","sourceRoot":"","sources":["../../src/shared/capture_private_execution_steps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,2BAA2B,EAC3B,YAAY,EACZ,aAAa,EACb,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"capture_private_execution_steps.d.ts","sourceRoot":"","sources":["../../src/shared/capture_private_execution_steps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,2BAA2B,EAC3B,YAAY,EACZ,aAAa,EACb,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AASnC,wBAAsB,oCAAoC,CACxD,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,2BAA2B,GAAG,YAAY,EACvD,IAAI,CAAC,EAAE,IAAI,CAAC,oBAAoB,GAAG,aAAa,EAAE,aAAa,CAAC,EAChE,aAAa,CAAC,EAAE,MAAM,iBAsCvB"}
|
|
@@ -2,25 +2,10 @@
|
|
|
2
2
|
* This module exposes the ability to capture the private exection steps that go into our "Client IVC" prover.
|
|
3
3
|
* These are used for debugging and benchmarking barretenberg (the prover component).
|
|
4
4
|
*/ import { createLogger } from '@aztec/foundation/log';
|
|
5
|
-
import {
|
|
6
|
-
import { encode } from '@msgpack/msgpack';
|
|
5
|
+
import { serializePrivateExecutionSteps } from '@aztec/stdlib/kernel';
|
|
7
6
|
import { promises as fs } from 'fs';
|
|
8
7
|
import path from 'path';
|
|
9
8
|
const logger = createLogger('e2e:capture-private-execution-steps');
|
|
10
|
-
// TODO(#7371): This is duplicated.
|
|
11
|
-
// Longer term we won't use this hacked together msgpack format
|
|
12
|
-
// Leaving duplicated as this eventually bb will provide a serialization
|
|
13
|
-
// helper for passing to a generic msgpack RPC endpoint.
|
|
14
|
-
async function _createClientIvcProofFiles(directory, executionSteps) {
|
|
15
|
-
const acirPath = path.join(directory, 'acir.msgpack');
|
|
16
|
-
const witnessPath = path.join(directory, 'witnesses.msgpack');
|
|
17
|
-
await fs.writeFile(acirPath, encode(executionSteps.map((map)=>map.bytecode)));
|
|
18
|
-
await fs.writeFile(witnessPath, encode(executionSteps.map((map)=>serializeWitness(map.witness))));
|
|
19
|
-
return {
|
|
20
|
-
acirPath,
|
|
21
|
-
witnessPath
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
9
|
export async function capturePrivateExecutionStepsIfEnvSet(label, interaction, opts, expectedSteps) {
|
|
25
10
|
// Not included in env_var.ts as internal to e2e tests.
|
|
26
11
|
const ivcFolder = process.env.CAPTURE_IVC_FOLDER;
|
|
@@ -45,7 +30,8 @@ export async function capturePrivateExecutionStepsIfEnvSet(label, interaction, o
|
|
|
45
30
|
recursive: true
|
|
46
31
|
});
|
|
47
32
|
// Write the client IVC files read by the prover.
|
|
48
|
-
|
|
33
|
+
const ivcInputsPath = path.join(resultsDirectory, 'ivc-inputs.msgpack');
|
|
34
|
+
await fs.writeFile(ivcInputsPath, serializePrivateExecutionSteps(result.executionSteps));
|
|
49
35
|
if (profileMode === 'full') {
|
|
50
36
|
// If we have gate counts, write the steps in human-readable format.
|
|
51
37
|
await fs.writeFile(path.join(resultsDirectory, 'steps.json'), JSON.stringify(result.executionSteps.map((step)=>({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AccountWallet, AuthWitness, type AztecAddress, type AztecNode, EthAddress, type FieldsOf, Fr, type L2AmountClaim, type L2AmountClaimWithRecipient, type Logger, type PXE, type SiblingPath, type TxReceipt, type Wallet } from '@aztec/aztec.js';
|
|
2
|
-
import { type
|
|
2
|
+
import { type ExtendedViemWalletClient, type L1ContractAddresses } from '@aztec/ethereum';
|
|
3
3
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
4
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
5
5
|
import { type Hex } from 'viem';
|
|
@@ -13,7 +13,7 @@ import { type Hex } from 'viem';
|
|
|
13
13
|
* @param underlyingERC20Address - address of the underlying ERC20 contract to use (if none supplied, it deploys one)
|
|
14
14
|
* @returns l2 contract instance, bridge contract instance, token portal instance, token portal address and the underlying ERC20 instance
|
|
15
15
|
*/
|
|
16
|
-
export declare function deployAndInitializeTokenAndBridgeContracts(wallet: Wallet,
|
|
16
|
+
export declare function deployAndInitializeTokenAndBridgeContracts(wallet: Wallet, l1Client: ExtendedViemWalletClient, rollupRegistryAddress: EthAddress, owner: AztecAddress, underlyingERC20Address: EthAddress): Promise<{
|
|
17
17
|
/**
|
|
18
18
|
* The L2 token contract instance.
|
|
19
19
|
*/
|
|
@@ -66,15 +66,13 @@ export declare class CrossChainTestHarness {
|
|
|
66
66
|
tokenPortalAddress: EthAddress;
|
|
67
67
|
/** Underlying token for portal tests. */
|
|
68
68
|
underlyingERC20Address: EthAddress;
|
|
69
|
-
/** Viem
|
|
70
|
-
|
|
71
|
-
/** Viem Wallet Client instance. */
|
|
72
|
-
walletClient: ViemWalletClient;
|
|
69
|
+
/** Viem Extended client instance. */
|
|
70
|
+
l1Client: ExtendedViemWalletClient;
|
|
73
71
|
/** Deployment addresses for all L1 contracts */
|
|
74
72
|
readonly l1ContractAddresses: L1ContractAddresses;
|
|
75
73
|
/** Wallet of the owner. */
|
|
76
74
|
readonly ownerWallet: AccountWallet;
|
|
77
|
-
static new(aztecNode: AztecNode, pxeService: PXE,
|
|
75
|
+
static new(aztecNode: AztecNode, pxeService: PXE, l1Client: ExtendedViemWalletClient, wallet: AccountWallet, logger: Logger, underlyingERC20Address: EthAddress): Promise<CrossChainTestHarness>;
|
|
78
76
|
private readonly l1TokenManager;
|
|
79
77
|
private readonly l1TokenPortalManager;
|
|
80
78
|
readonly ownerAddress: AztecAddress;
|
|
@@ -95,10 +93,8 @@ export declare class CrossChainTestHarness {
|
|
|
95
93
|
tokenPortalAddress: EthAddress,
|
|
96
94
|
/** Underlying token for portal tests. */
|
|
97
95
|
underlyingERC20Address: EthAddress,
|
|
98
|
-
/** Viem
|
|
99
|
-
|
|
100
|
-
/** Viem Wallet Client instance. */
|
|
101
|
-
walletClient: ViemWalletClient,
|
|
96
|
+
/** Viem Extended client instance. */
|
|
97
|
+
l1Client: ExtendedViemWalletClient,
|
|
102
98
|
/** Deployment addresses for all L1 contracts */
|
|
103
99
|
l1ContractAddresses: L1ContractAddresses,
|
|
104
100
|
/** Wallet of the owner. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross_chain_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/cross_chain_test_harness.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,UAAU,EACV,KAAK,QAAQ,EACb,EAAE,EAGF,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"cross_chain_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/cross_chain_test_harness.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,UAAU,EACV,KAAK,QAAQ,EACb,EAAE,EAGF,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,mBAAmB,EAAoB,MAAM,iBAAiB,CAAC;AAE5G,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO,EAAE,KAAK,GAAG,EAAe,MAAM,MAAM,CAAC;AAK7C;;;;;;;;;GASG;AACH,wBAAsB,0CAA0C,CAC9D,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,wBAAwB,EAClC,qBAAqB,EAAE,UAAU,EACjC,KAAK,EAAE,YAAY,EACnB,sBAAsB,EAAE,UAAU,GACjC,OAAO,CAAC;IACT;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC;IACrB;;OAEG;IACH,MAAM,EAAE,mBAAmB,CAAC;IAC5B;;OAEG;IACH,kBAAkB,EAAE,UAAU,CAAC;IAC/B;;OAEG;IACH,WAAW,EAAE,GAAG,CAAC;IACjB;;OAEG;IACH,eAAe,EAAE,GAAG,CAAC;CACtB,CAAC,CA0CD;AAGD,MAAM,MAAM,iBAA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AAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM;IAKpE,oBAAoB,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,GAAE,UAA4B,GAAG,OAAO,CAAC,EAAE,CAAC;IASzG,2BAA2B,CACzB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,EAC5B,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC;IAW5B,qBAAqB,CAAC,YAAY,EAAE,MAAM;IAK1C,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,KAAU;IAK1D;;;;;;OAMG;IACG,qBAAqB,CAAC,OAAO,EAAE,EAAE,GAAG,GAAG;IAS7C,mBAAmB,IAAI,iBAAiB;CAYzC"}
|
|
@@ -16,13 +16,13 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
16
16
|
* @param owner - owner of the L2 contract
|
|
17
17
|
* @param underlyingERC20Address - address of the underlying ERC20 contract to use (if none supplied, it deploys one)
|
|
18
18
|
* @returns l2 contract instance, bridge contract instance, token portal instance, token portal address and the underlying ERC20 instance
|
|
19
|
-
*/ export async function deployAndInitializeTokenAndBridgeContracts(wallet,
|
|
19
|
+
*/ export async function deployAndInitializeTokenAndBridgeContracts(wallet, l1Client, rollupRegistryAddress, owner, underlyingERC20Address) {
|
|
20
20
|
// deploy the token portal
|
|
21
|
-
const { address: tokenPortalAddress } = await deployL1Contract(
|
|
21
|
+
const { address: tokenPortalAddress } = await deployL1Contract(l1Client, TokenPortalAbi, TokenPortalBytecode);
|
|
22
22
|
const tokenPortal = getContract({
|
|
23
23
|
address: tokenPortalAddress.toString(),
|
|
24
24
|
abi: TokenPortalAbi,
|
|
25
|
-
client:
|
|
25
|
+
client: l1Client
|
|
26
26
|
});
|
|
27
27
|
// deploy l2 token
|
|
28
28
|
const token = await TokenContract.deploy(wallet, owner, 'TokenName', 'TokenSymbol', 18).send().deployed();
|
|
@@ -48,7 +48,7 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
48
48
|
const underlyingERC20 = getContract({
|
|
49
49
|
address: underlyingERC20Address.toString(),
|
|
50
50
|
abi: TestERC20Abi,
|
|
51
|
-
client:
|
|
51
|
+
client: l1Client
|
|
52
52
|
});
|
|
53
53
|
return {
|
|
54
54
|
token,
|
|
@@ -70,23 +70,22 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
70
70
|
ethAccount;
|
|
71
71
|
tokenPortalAddress;
|
|
72
72
|
underlyingERC20Address;
|
|
73
|
-
|
|
74
|
-
walletClient;
|
|
73
|
+
l1Client;
|
|
75
74
|
l1ContractAddresses;
|
|
76
75
|
ownerWallet;
|
|
77
|
-
static async new(aztecNode, pxeService,
|
|
78
|
-
const ethAccount = EthAddress.fromString((await
|
|
76
|
+
static async new(aztecNode, pxeService, l1Client, wallet, logger, underlyingERC20Address) {
|
|
77
|
+
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
79
78
|
const l1ContractAddresses = (await pxeService.getNodeInfo()).l1ContractAddresses;
|
|
80
79
|
// Deploy and initialize all required contracts
|
|
81
80
|
logger.info('Deploying and initializing token, portal and its bridge...');
|
|
82
|
-
const { token, bridge, tokenPortalAddress, underlyingERC20 } = await deployAndInitializeTokenAndBridgeContracts(wallet,
|
|
81
|
+
const { token, bridge, tokenPortalAddress, underlyingERC20 } = await deployAndInitializeTokenAndBridgeContracts(wallet, l1Client, l1ContractAddresses.registryAddress, wallet.getAddress(), underlyingERC20Address);
|
|
83
82
|
logger.info('Deployed and initialized token, portal and its bridge.');
|
|
84
|
-
return new CrossChainTestHarness(aztecNode, pxeService, logger, token, bridge, ethAccount, tokenPortalAddress, underlyingERC20.address,
|
|
83
|
+
return new CrossChainTestHarness(aztecNode, pxeService, logger, token, bridge, ethAccount, tokenPortalAddress, underlyingERC20.address, l1Client, l1ContractAddresses, wallet);
|
|
85
84
|
}
|
|
86
85
|
l1TokenManager;
|
|
87
86
|
l1TokenPortalManager;
|
|
88
87
|
ownerAddress;
|
|
89
|
-
constructor(/** Aztec node instance. */ aztecNode, /** Private eXecution Environment (PXE). */ pxeService, /** Logger. */ logger, /** L2 Token contract. */ l2Token, /** L2 Token bridge contract. */ l2Bridge, /** Eth account to interact with. */ ethAccount, /** Portal address. */ tokenPortalAddress, /** Underlying token for portal tests. */ underlyingERC20Address, /** Viem
|
|
88
|
+
constructor(/** Aztec node instance. */ aztecNode, /** Private eXecution Environment (PXE). */ pxeService, /** Logger. */ logger, /** L2 Token contract. */ l2Token, /** L2 Token bridge contract. */ l2Bridge, /** Eth account to interact with. */ ethAccount, /** Portal address. */ tokenPortalAddress, /** Underlying token for portal tests. */ underlyingERC20Address, /** Viem Extended client instance. */ l1Client, /** Deployment addresses for all L1 contracts */ l1ContractAddresses, /** Wallet of the owner. */ ownerWallet){
|
|
90
89
|
this.aztecNode = aztecNode;
|
|
91
90
|
this.pxeService = pxeService;
|
|
92
91
|
this.logger = logger;
|
|
@@ -95,11 +94,10 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
95
94
|
this.ethAccount = ethAccount;
|
|
96
95
|
this.tokenPortalAddress = tokenPortalAddress;
|
|
97
96
|
this.underlyingERC20Address = underlyingERC20Address;
|
|
98
|
-
this.
|
|
99
|
-
this.walletClient = walletClient;
|
|
97
|
+
this.l1Client = l1Client;
|
|
100
98
|
this.l1ContractAddresses = l1ContractAddresses;
|
|
101
99
|
this.ownerWallet = ownerWallet;
|
|
102
|
-
this.l1TokenPortalManager = new L1TokenPortalManager(this.tokenPortalAddress, this.underlyingERC20Address, this.l1ContractAddresses.feeAssetHandlerAddress, this.l1ContractAddresses.outboxAddress, this.
|
|
100
|
+
this.l1TokenPortalManager = new L1TokenPortalManager(this.tokenPortalAddress, this.underlyingERC20Address, this.l1ContractAddresses.feeAssetHandlerAddress, this.l1ContractAddresses.outboxAddress, this.l1Client, this.logger);
|
|
103
101
|
this.l1TokenManager = this.l1TokenPortalManager.getTokenManager();
|
|
104
102
|
this.ownerAddress = this.ownerWallet.getAddress();
|
|
105
103
|
}
|
|
@@ -107,14 +105,14 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
107
105
|
const contract = getContract({
|
|
108
106
|
abi: TestERC20Abi,
|
|
109
107
|
address: this.l1TokenManager.tokenAddress.toString(),
|
|
110
|
-
client: this.
|
|
108
|
+
client: this.l1Client
|
|
111
109
|
});
|
|
112
110
|
const balanceBefore = await this.l1TokenManager.getL1TokenBalance(this.ethAccount.toString());
|
|
113
111
|
const hash = await contract.write.mint([
|
|
114
112
|
this.ethAccount.toString(),
|
|
115
113
|
amount
|
|
116
114
|
]);
|
|
117
|
-
await this.
|
|
115
|
+
await this.l1Client.waitForTransactionReceipt({
|
|
118
116
|
hash
|
|
119
117
|
});
|
|
120
118
|
expect(await this.l1TokenManager.getL1TokenBalance(this.ethAccount.toString())).toEqual(balanceBefore + amount);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AztecAddress, type AztecNode, EthAddress, L1FeeJuicePortalManager, type L1TokenManager, type L2AmountClaim, type Logger, type PXE, type Wallet } from '@aztec/aztec.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
3
3
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
4
4
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
5
5
|
export interface IGasBridgingTestHarness {
|
|
@@ -13,8 +13,7 @@ export interface FeeJuicePortalTestingHarnessFactoryConfig {
|
|
|
13
13
|
aztecNode: AztecNode;
|
|
14
14
|
aztecNodeAdmin?: AztecNodeAdmin;
|
|
15
15
|
pxeService: PXE;
|
|
16
|
-
|
|
17
|
-
walletClient: ViemWalletClient;
|
|
16
|
+
l1Client: ExtendedViemWalletClient;
|
|
18
17
|
wallet: Wallet;
|
|
19
18
|
logger: Logger;
|
|
20
19
|
mockL1?: boolean;
|
|
@@ -48,10 +47,8 @@ export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
48
47
|
l1FeeJuiceAddress: EthAddress;
|
|
49
48
|
/** Fee asset handler address. */
|
|
50
49
|
feeAssetHandlerAddress: EthAddress;
|
|
51
|
-
/** Viem
|
|
52
|
-
|
|
53
|
-
/** Viem Wallet Client instance. */
|
|
54
|
-
walletClient: ViemWalletClient;
|
|
50
|
+
/** Viem Extended client instance. */
|
|
51
|
+
l1Client: ExtendedViemWalletClient;
|
|
55
52
|
readonly l1TokenManager: L1TokenManager;
|
|
56
53
|
readonly feeJuicePortalManager: L1FeeJuicePortalManager;
|
|
57
54
|
constructor(
|
|
@@ -73,10 +70,8 @@ export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
73
70
|
l1FeeJuiceAddress: EthAddress,
|
|
74
71
|
/** Fee asset handler address. */
|
|
75
72
|
feeAssetHandlerAddress: EthAddress,
|
|
76
|
-
/** Viem
|
|
77
|
-
|
|
78
|
-
/** Viem Wallet Client instance. */
|
|
79
|
-
walletClient: ViemWalletClient);
|
|
73
|
+
/** Viem Extended client instance. */
|
|
74
|
+
l1Client: ExtendedViemWalletClient);
|
|
80
75
|
mintTokensOnL1(amount: bigint, to?: EthAddress): Promise<void>;
|
|
81
76
|
getL1FeeJuiceBalance(address: EthAddress): Promise<bigint>;
|
|
82
77
|
sendTokensToPortalPublic(bridgeAmount: bigint, l2Address: AztecAddress): Promise<L2AmountClaim>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gas_portal_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/gas_portal_test_harness.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,UAAU,EAEV,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACz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AMhF,oBAAoB,CAAC,KAAK,EAAE,YAAY;IAIxC,uBAAuB,CAAC,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM;IAKpE,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY;IAc3D,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY;YAQlD,cAAc;CAK7B"}
|
|
@@ -9,8 +9,8 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
9
9
|
this.config = config;
|
|
10
10
|
}
|
|
11
11
|
async createReal() {
|
|
12
|
-
const { aztecNode, aztecNodeAdmin, pxeService,
|
|
13
|
-
const ethAccount = EthAddress.fromString((await
|
|
12
|
+
const { aztecNode, aztecNodeAdmin, pxeService, l1Client, wallet, logger } = this.config;
|
|
13
|
+
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
14
14
|
const l1ContractAddresses = (await pxeService.getNodeInfo()).l1ContractAddresses;
|
|
15
15
|
const feeJuiceAddress = l1ContractAddresses.feeJuiceAddress;
|
|
16
16
|
const feeJuicePortalAddress = l1ContractAddresses.feeJuicePortalAddress;
|
|
@@ -18,7 +18,7 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
18
18
|
throw new Error('Fee Juice portal not deployed on L1');
|
|
19
19
|
}
|
|
20
20
|
const gasL2 = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, wallet);
|
|
21
|
-
return new GasBridgingTestHarness(aztecNode, aztecNodeAdmin, pxeService, logger, gasL2, ethAccount, feeJuicePortalAddress, feeJuiceAddress, l1ContractAddresses.feeAssetHandlerAddress,
|
|
21
|
+
return new GasBridgingTestHarness(aztecNode, aztecNodeAdmin, pxeService, logger, gasL2, ethAccount, feeJuicePortalAddress, feeJuiceAddress, l1ContractAddresses.feeAssetHandlerAddress, l1Client);
|
|
22
22
|
}
|
|
23
23
|
static create(config) {
|
|
24
24
|
const factory = new FeeJuicePortalTestingHarnessFactory(config);
|
|
@@ -38,11 +38,10 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
38
38
|
feeJuicePortalAddress;
|
|
39
39
|
l1FeeJuiceAddress;
|
|
40
40
|
feeAssetHandlerAddress;
|
|
41
|
-
|
|
42
|
-
walletClient;
|
|
41
|
+
l1Client;
|
|
43
42
|
l1TokenManager;
|
|
44
43
|
feeJuicePortalManager;
|
|
45
|
-
constructor(/** Aztec node */ aztecNode, /** Aztec node admin interface */ aztecNodeAdmin, /** Private eXecution Environment (PXE). */ pxeService, /** Logger. */ logger, /** L2 Token/Bridge contract. */ feeJuice, /** Eth account to interact with. */ ethAccount, /** Portal address. */ feeJuicePortalAddress, /** Underlying token for portal tests. */ l1FeeJuiceAddress, /** Fee asset handler address. */ feeAssetHandlerAddress, /** Viem
|
|
44
|
+
constructor(/** Aztec node */ aztecNode, /** Aztec node admin interface */ aztecNodeAdmin, /** Private eXecution Environment (PXE). */ pxeService, /** Logger. */ logger, /** L2 Token/Bridge contract. */ feeJuice, /** Eth account to interact with. */ ethAccount, /** Portal address. */ feeJuicePortalAddress, /** Underlying token for portal tests. */ l1FeeJuiceAddress, /** Fee asset handler address. */ feeAssetHandlerAddress, /** Viem Extended client instance. */ l1Client){
|
|
46
45
|
this.aztecNode = aztecNode;
|
|
47
46
|
this.aztecNodeAdmin = aztecNodeAdmin;
|
|
48
47
|
this.pxeService = pxeService;
|
|
@@ -52,9 +51,8 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
52
51
|
this.feeJuicePortalAddress = feeJuicePortalAddress;
|
|
53
52
|
this.l1FeeJuiceAddress = l1FeeJuiceAddress;
|
|
54
53
|
this.feeAssetHandlerAddress = feeAssetHandlerAddress;
|
|
55
|
-
this.
|
|
56
|
-
this.
|
|
57
|
-
this.feeJuicePortalManager = new L1FeeJuicePortalManager(this.feeJuicePortalAddress, this.l1FeeJuiceAddress, this.feeAssetHandlerAddress, this.publicClient, this.walletClient, this.logger);
|
|
54
|
+
this.l1Client = l1Client;
|
|
55
|
+
this.feeJuicePortalManager = new L1FeeJuicePortalManager(this.feeJuicePortalAddress, this.l1FeeJuiceAddress, this.feeAssetHandlerAddress, this.l1Client, this.logger);
|
|
58
56
|
this.l1TokenManager = this.feeJuicePortalManager.getTokenManager();
|
|
59
57
|
}
|
|
60
58
|
async mintTokensOnL1(amount, to = this.ethAccount) {
|
|
@@ -63,7 +61,7 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
63
61
|
const feeAssetL1 = getContract({
|
|
64
62
|
address: this.l1FeeJuiceAddress.toString(),
|
|
65
63
|
abi: TestERC20Abi,
|
|
66
|
-
client: this.
|
|
64
|
+
client: this.l1Client
|
|
67
65
|
});
|
|
68
66
|
await feeAssetL1.write.mint([
|
|
69
67
|
to.toString(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AccountWallet, type AztecNode, type Logger, type PXE } from '@aztec/aztec.js';
|
|
2
2
|
import { CheatCodes } from '@aztec/aztec.js/testing';
|
|
3
|
-
import { type DeployL1ContractsReturnType, type
|
|
3
|
+
import { type DeployL1ContractsReturnType, type ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
4
4
|
/** Objects to be returned by the uniswap setup function */
|
|
5
5
|
export type UniswapSetupContext = {
|
|
6
6
|
/** Aztec Node instance */
|
|
@@ -9,10 +9,8 @@ export type UniswapSetupContext = {
|
|
|
9
9
|
pxe: PXE;
|
|
10
10
|
/** Logger instance named as the current test. */
|
|
11
11
|
logger: Logger;
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
/** Viem Wallet Client instance. */
|
|
15
|
-
walletClient: ViemWalletClient;
|
|
12
|
+
/** The L1 wallet client, extended with public actions. */
|
|
13
|
+
l1Client: ExtendedViemWalletClient;
|
|
16
14
|
/** The owner wallet. */
|
|
17
15
|
ownerWallet: AccountWallet;
|
|
18
16
|
/** The sponsor wallet. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,SAAS,EAGd,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACL,KAAK,2BAA2B,
|
|
1
|
+
{"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,SAAS,EAGd,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAI9B,MAAM,iBAAiB,CAAC;AAqBzB,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,+CAA+C;IAC/C,GAAG,EAAE,GAAG,CAAC;IACT,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,EAAE,wBAAwB,CAAC;IACnC,wBAAwB;IACxB,WAAW,EAAE,aAAa,CAAC;IAC3B,0BAA0B;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO;IACP,uBAAuB,EAAE,2BAA2B,CAAC;IACrD,4BAA4B;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAGF,eAAO,MAAM,oBAAoB,UACxB,MAAM,QAAQ,mBAAmB,CAAC,WAChC,MAAM,QAAQ,IAAI,CAAC,2CA88B7B,CAAC"}
|