@aztec/end-to-end 4.0.0-nightly.20260113 → 4.0.0-nightly.20260115
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 +12 -13
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +104 -134
- package/dest/bench/utils.d.ts +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +6 -7
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +98 -113
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +6 -7
- 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 +65 -62
- package/dest/e2e_deploy_contract/deploy_test.d.ts +4 -3
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +18 -13
- package/dest/e2e_epochs/epochs_test.js +1 -1
- package/dest/e2e_fees/bridging_race.notest.js +2 -4
- package/dest/e2e_fees/fees_test.d.ts +13 -13
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +122 -140
- package/dest/e2e_l1_publisher/write_json.d.ts +1 -1
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +1 -0
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -9
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +32 -40
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +3 -3
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +3 -3
- package/dest/e2e_p2p/p2p_network.d.ts +7 -6
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +106 -103
- package/dest/e2e_token_contract/token_contract_test.d.ts +16 -9
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +90 -92
- package/dest/fixtures/e2e_prover_test.d.ts +8 -14
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +82 -93
- package/dest/fixtures/setup.d.ts +216 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +683 -0
- package/dest/fixtures/utils.d.ts +5 -191
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -615
- package/dest/quality_of_service/prometheus_client.d.ts +38 -0
- package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
- package/dest/quality_of_service/prometheus_client.js +67 -0
- package/dest/shared/cross_chain_test_harness.d.ts +12 -1
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.d.ts +11 -1
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.d.ts +5 -1
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.d.ts +4 -1
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +21 -1
- package/dest/spartan/utils.d.ts +5 -1
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +25 -8
- package/package.json +39 -39
- package/src/bench/client_flows/client_flows_benchmark.ts +142 -195
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +107 -142
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +99 -106
- package/src/e2e_deploy_contract/deploy_test.ts +21 -14
- package/src/e2e_epochs/epochs_test.ts +1 -1
- package/src/e2e_fees/bridging_race.notest.ts +2 -5
- package/src/e2e_fees/fees_test.ts +171 -213
- package/src/e2e_l1_publisher/write_json.ts +1 -0
- package/src/e2e_nested_contract/nested_contract_test.ts +35 -56
- package/src/e2e_p2p/inactivity_slash_test.ts +5 -5
- package/src/e2e_p2p/p2p_network.ts +165 -167
- package/src/e2e_token_contract/token_contract_test.ts +105 -118
- package/src/fixtures/e2e_prover_test.ts +107 -136
- package/src/fixtures/setup.ts +1009 -0
- package/src/fixtures/utils.ts +27 -901
- package/src/quality_of_service/prometheus_client.ts +113 -0
- package/src/spartan/tx_metrics.ts +21 -1
- package/src/spartan/utils.ts +26 -8
- package/dest/fixtures/snapshot_manager.d.ts +0 -93
- package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
- package/dest/fixtures/snapshot_manager.js +0 -488
- package/src/fixtures/snapshot_manager.ts +0 -646
|
@@ -29,14 +29,9 @@ import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
|
29
29
|
import { TestWallet } from '@aztec/test-wallet/server';
|
|
30
30
|
|
|
31
31
|
import { MNEMONIC } from '../../fixtures/fixtures.js';
|
|
32
|
-
import {
|
|
33
|
-
type ISnapshotManager,
|
|
34
|
-
type SubsystemsContext,
|
|
35
|
-
createSnapshotManager,
|
|
36
|
-
deployAccounts,
|
|
37
|
-
} from '../../fixtures/snapshot_manager.js';
|
|
32
|
+
import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
|
|
38
33
|
import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
|
|
39
|
-
import {
|
|
34
|
+
import { setupSponsoredFPC } from '../../fixtures/utils.js';
|
|
40
35
|
import { CrossChainTestHarness } from '../../shared/cross_chain_test_harness.js';
|
|
41
36
|
import {
|
|
42
37
|
FeeJuicePortalTestingHarnessFactory,
|
|
@@ -45,19 +40,17 @@ import {
|
|
|
45
40
|
import { ProxyLogger } from './benchmark.js';
|
|
46
41
|
import { type ClientFlowsConfig, FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './config.js';
|
|
47
42
|
|
|
48
|
-
const {
|
|
43
|
+
const { BENCHMARK_CONFIG } = process.env;
|
|
49
44
|
|
|
50
45
|
export type AccountType = 'ecdsar1' | 'schnorr';
|
|
51
46
|
export type FeePaymentMethodGetter = (wallet: Wallet, sender: AztecAddress) => Promise<FeePaymentMethod | undefined>;
|
|
52
47
|
export type BenchmarkingFeePaymentMethod = 'bridged_fee_juice' | 'private_fpc' | 'sponsored_fpc' | 'fee_juice';
|
|
53
48
|
|
|
54
49
|
export class ClientFlowsBenchmark {
|
|
55
|
-
private snapshotManager: ISnapshotManager;
|
|
56
|
-
|
|
57
50
|
public logger: Logger;
|
|
58
51
|
public aztecNode!: AztecNode;
|
|
59
52
|
public cheatCodes!: CheatCodes;
|
|
60
|
-
public context!:
|
|
53
|
+
public context!: EndToEndContext;
|
|
61
54
|
public chainMonitor!: ChainMonitor;
|
|
62
55
|
public feeJuiceBridgeTestHarness!: GasBridgingTestHarness;
|
|
63
56
|
public adminWallet!: TestWallet;
|
|
@@ -125,33 +118,37 @@ export class ClientFlowsBenchmark {
|
|
|
125
118
|
public config: ClientFlowsConfig;
|
|
126
119
|
|
|
127
120
|
private proxyLogger: ProxyLogger;
|
|
121
|
+
private setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs>;
|
|
128
122
|
|
|
129
123
|
constructor(testName?: string, setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs> = {}) {
|
|
130
124
|
this.logger = createLogger(`bench:client_flows${testName ? `:${testName}` : ''}`);
|
|
131
|
-
this.
|
|
132
|
-
`bench_client_flows${testName ? `/${testName}` : ''}`,
|
|
133
|
-
dataPath,
|
|
134
|
-
{ startProverNode: true, ...setupOptions },
|
|
135
|
-
{ ...setupOptions },
|
|
136
|
-
);
|
|
125
|
+
this.setupOptions = { startProverNode: true, ...setupOptions };
|
|
137
126
|
this.config = BENCHMARK_CONFIG === 'key_flows' ? KEY_FLOWS_CONFIG : FULL_FLOWS_CONFIG;
|
|
138
127
|
ProxyLogger.create();
|
|
139
128
|
this.proxyLogger = ProxyLogger.getInstance();
|
|
140
129
|
}
|
|
141
130
|
|
|
142
131
|
async setup() {
|
|
143
|
-
|
|
144
|
-
await
|
|
132
|
+
this.logger.info('Setting up subsystems from fresh');
|
|
133
|
+
this.context = await setup(0, {
|
|
134
|
+
...this.setupOptions,
|
|
135
|
+
fundSponsoredFPC: true,
|
|
136
|
+
skipAccountDeployment: true,
|
|
137
|
+
l1ContractsArgs: this.setupOptions,
|
|
138
|
+
});
|
|
139
|
+
await this.applyBaseSetup();
|
|
145
140
|
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
await this.context.aztecNodeService!.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
|
|
142
|
+
|
|
143
|
+
const rollupContract = RollupContract.getFromConfig(this.context.config);
|
|
144
|
+
this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider!, this.logger, 200).start();
|
|
148
145
|
|
|
149
146
|
return this;
|
|
150
147
|
}
|
|
151
148
|
|
|
152
149
|
async teardown() {
|
|
153
150
|
await this.chainMonitor.stop();
|
|
154
|
-
await this.
|
|
151
|
+
await teardown(this.context);
|
|
155
152
|
}
|
|
156
153
|
|
|
157
154
|
async mintAndBridgeFeeJuice(address: AztecAddress) {
|
|
@@ -193,161 +190,124 @@ export class ClientFlowsBenchmark {
|
|
|
193
190
|
}
|
|
194
191
|
}
|
|
195
192
|
|
|
196
|
-
public async
|
|
197
|
-
await this.
|
|
198
|
-
await this.
|
|
193
|
+
public async applyBaseSetup() {
|
|
194
|
+
await this.applyInitialAccounts();
|
|
195
|
+
await this.applySetupFeeJuice();
|
|
199
196
|
}
|
|
200
197
|
|
|
201
|
-
async
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
198
|
+
async applyInitialAccounts() {
|
|
199
|
+
this.logger.info('Applying initial accounts setup');
|
|
200
|
+
const { deployedAccounts } = await deployAccounts(
|
|
201
|
+
2,
|
|
202
|
+
this.logger,
|
|
203
|
+
)({
|
|
204
|
+
wallet: this.context.wallet,
|
|
205
|
+
initialFundedAccounts: this.context.initialFundedAccounts,
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
const [{ address: adminAddress }, { address: sequencerAddress }] = deployedAccounts;
|
|
209
|
+
|
|
210
|
+
this.adminWallet = this.context.wallet;
|
|
211
|
+
this.aztecNode = this.context.aztecNodeService!;
|
|
212
|
+
this.cheatCodes = this.context.cheatCodes;
|
|
213
|
+
|
|
214
|
+
this.adminAddress = adminAddress;
|
|
215
|
+
this.sequencerAddress = sequencerAddress;
|
|
216
|
+
|
|
217
|
+
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
218
|
+
this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
|
|
219
|
+
this.coinbase = EthAddress.random();
|
|
220
|
+
|
|
221
|
+
const userPXEConfig = getPXEConfig();
|
|
222
|
+
const userPXEConfigWithContracts = {
|
|
223
|
+
...userPXEConfig,
|
|
224
|
+
proverEnabled: this.realProofs,
|
|
225
|
+
} as PXEConfig;
|
|
226
|
+
|
|
227
|
+
this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
|
|
228
|
+
loggers: {
|
|
229
|
+
prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
|
|
231
230
|
},
|
|
232
|
-
);
|
|
231
|
+
});
|
|
233
232
|
}
|
|
234
233
|
|
|
235
|
-
async
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
aztecNodeAdmin: context.aztecNode,
|
|
247
|
-
l1Client: context.deployL1ContractsValues.l1Client,
|
|
248
|
-
wallet: this.adminWallet,
|
|
249
|
-
logger: this.logger,
|
|
250
|
-
});
|
|
251
|
-
},
|
|
252
|
-
);
|
|
234
|
+
async applySetupFeeJuice() {
|
|
235
|
+
this.logger.info('Applying fee juice setup');
|
|
236
|
+
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
|
|
237
|
+
|
|
238
|
+
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
239
|
+
aztecNode: this.context.aztecNodeService!,
|
|
240
|
+
aztecNodeAdmin: this.context.aztecNodeService!,
|
|
241
|
+
l1Client: this.context.deployL1ContractsValues.l1Client,
|
|
242
|
+
wallet: this.adminWallet,
|
|
243
|
+
logger: this.logger,
|
|
244
|
+
});
|
|
253
245
|
}
|
|
254
246
|
|
|
255
|
-
async
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
return { bananaCoinAddress: bananaCoin.address, bananaCoinInstance };
|
|
270
|
-
},
|
|
271
|
-
({ bananaCoinAddress, bananaCoinInstance }) => {
|
|
272
|
-
this.bananaCoin = BananaCoin.at(bananaCoinAddress, this.adminWallet);
|
|
273
|
-
this.bananaCoinInstance = bananaCoinInstance;
|
|
274
|
-
return Promise.resolve();
|
|
275
|
-
},
|
|
276
|
-
);
|
|
247
|
+
async applyDeployBananaToken() {
|
|
248
|
+
this.logger.info('Applying banana token deployment');
|
|
249
|
+
const { contract: bananaCoin, instance: bananaCoinInstance } = await BananaCoin.deploy(
|
|
250
|
+
this.adminWallet,
|
|
251
|
+
this.adminAddress,
|
|
252
|
+
'BC',
|
|
253
|
+
'BC',
|
|
254
|
+
18n,
|
|
255
|
+
)
|
|
256
|
+
.send({ from: this.adminAddress })
|
|
257
|
+
.wait();
|
|
258
|
+
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
259
|
+
this.bananaCoin = bananaCoin;
|
|
260
|
+
this.bananaCoinInstance = bananaCoinInstance;
|
|
277
261
|
}
|
|
278
262
|
|
|
279
|
-
async
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
return { candyBarCoinAddress: candyBarCoin.address, candyBarCoinInstance };
|
|
294
|
-
},
|
|
295
|
-
({ candyBarCoinAddress, candyBarCoinInstance }) => {
|
|
296
|
-
this.candyBarCoin = TokenContract.at(candyBarCoinAddress, this.adminWallet);
|
|
297
|
-
this.candyBarCoinInstance = candyBarCoinInstance;
|
|
298
|
-
return Promise.resolve();
|
|
299
|
-
},
|
|
300
|
-
);
|
|
263
|
+
async applyDeployCandyBarToken() {
|
|
264
|
+
this.logger.info('Applying candy bar token deployment');
|
|
265
|
+
const { contract: candyBarCoin, instance: candyBarCoinInstance } = await TokenContract.deploy(
|
|
266
|
+
this.adminWallet,
|
|
267
|
+
this.adminAddress,
|
|
268
|
+
'CBC',
|
|
269
|
+
'CBC',
|
|
270
|
+
18n,
|
|
271
|
+
)
|
|
272
|
+
.send({ from: this.adminAddress })
|
|
273
|
+
.wait();
|
|
274
|
+
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
275
|
+
this.candyBarCoin = candyBarCoin;
|
|
276
|
+
this.candyBarCoinInstance = candyBarCoinInstance;
|
|
301
277
|
}
|
|
302
278
|
|
|
303
|
-
public async
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
308
|
-
expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
279
|
+
public async applyFPCSetup() {
|
|
280
|
+
this.logger.info('Applying FPC setup');
|
|
281
|
+
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
282
|
+
expect((await this.context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
309
283
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
284
|
+
const bananaCoin = this.bananaCoin;
|
|
285
|
+
const { contract: bananaFPC, instance: bananaFPCInstance } = await FPCContract.deploy(
|
|
286
|
+
this.adminWallet,
|
|
287
|
+
bananaCoin.address,
|
|
288
|
+
this.adminAddress,
|
|
289
|
+
)
|
|
290
|
+
.send({ from: this.adminAddress })
|
|
291
|
+
.wait();
|
|
318
292
|
|
|
319
|
-
|
|
293
|
+
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
320
294
|
|
|
321
|
-
|
|
295
|
+
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
|
|
322
296
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
data => {
|
|
326
|
-
this.bananaFPC = FPCContract.at(data.bananaFPCAddress, this.adminWallet);
|
|
327
|
-
this.bananaFPCInstance = data.bananaFPCInstance;
|
|
328
|
-
return Promise.resolve();
|
|
329
|
-
},
|
|
330
|
-
);
|
|
297
|
+
this.bananaFPC = bananaFPC;
|
|
298
|
+
this.bananaFPCInstance = bananaFPCInstance;
|
|
331
299
|
}
|
|
332
300
|
|
|
333
|
-
async
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
return { sponsoredFPCAddress: sponsoredFPCInstance.address, sponsoredFPCInstance };
|
|
340
|
-
},
|
|
341
|
-
({ sponsoredFPCAddress, sponsoredFPCInstance }) => {
|
|
342
|
-
this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCAddress, this.adminWallet);
|
|
343
|
-
this.sponsoredFPCInstance = sponsoredFPCInstance;
|
|
344
|
-
return Promise.resolve();
|
|
345
|
-
},
|
|
346
|
-
);
|
|
301
|
+
async applyDeploySponsoredFPC() {
|
|
302
|
+
this.logger.info('Applying sponsored FPC deployment');
|
|
303
|
+
const sponsoredFPCInstance = await setupSponsoredFPC(this.adminWallet);
|
|
304
|
+
this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
|
|
305
|
+
this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCInstance.address, this.adminWallet);
|
|
306
|
+
this.sponsoredFPCInstance = sponsoredFPCInstance;
|
|
347
307
|
}
|
|
348
308
|
|
|
349
309
|
public async createCrossChainTestHarness(owner: AztecAddress) {
|
|
350
|
-
const l1Client = createExtendedL1Client(this.context.
|
|
310
|
+
const l1Client = createExtendedL1Client(this.context.config.l1RpcUrls, MNEMONIC);
|
|
351
311
|
|
|
352
312
|
const underlyingERC20Address = await deployL1Contract(l1Client, TestERC20Abi, TestERC20Bytecode, [
|
|
353
313
|
'Underlying',
|
|
@@ -391,44 +351,31 @@ export class ClientFlowsBenchmark {
|
|
|
391
351
|
return accountManager.address;
|
|
392
352
|
}
|
|
393
353
|
|
|
394
|
-
public async
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
ammInstance,
|
|
420
|
-
liquidityTokenAddress: liquidityToken.address,
|
|
421
|
-
liquidityTokenInstance,
|
|
422
|
-
};
|
|
423
|
-
},
|
|
424
|
-
({ ammAddress, ammInstance, liquidityTokenAddress, liquidityTokenInstance }) => {
|
|
425
|
-
this.liquidityToken = TokenContract.at(liquidityTokenAddress, this.adminWallet);
|
|
426
|
-
this.liquidityTokenInstance = liquidityTokenInstance;
|
|
427
|
-
this.amm = AMMContract.at(ammAddress, this.adminWallet);
|
|
428
|
-
this.ammInstance = ammInstance;
|
|
429
|
-
return Promise.resolve();
|
|
430
|
-
},
|
|
431
|
-
);
|
|
354
|
+
public async applyDeployAmm() {
|
|
355
|
+
this.logger.info('Applying AMM deployment');
|
|
356
|
+
const { contract: liquidityToken, instance: liquidityTokenInstance } = await TokenContract.deploy(
|
|
357
|
+
this.adminWallet,
|
|
358
|
+
this.adminAddress,
|
|
359
|
+
'LPT',
|
|
360
|
+
'LPT',
|
|
361
|
+
18n,
|
|
362
|
+
)
|
|
363
|
+
.send({ from: this.adminAddress })
|
|
364
|
+
.wait();
|
|
365
|
+
const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
|
|
366
|
+
this.adminWallet,
|
|
367
|
+
this.bananaCoin.address,
|
|
368
|
+
this.candyBarCoin.address,
|
|
369
|
+
liquidityToken.address,
|
|
370
|
+
)
|
|
371
|
+
.send({ from: this.adminAddress })
|
|
372
|
+
.wait();
|
|
373
|
+
this.logger.info(`AMM deployed at ${amm.address}`);
|
|
374
|
+
await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
|
|
375
|
+
this.liquidityToken = liquidityToken;
|
|
376
|
+
this.liquidityTokenInstance = liquidityTokenInstance;
|
|
377
|
+
this.amm = amm;
|
|
378
|
+
this.ammInstance = ammInstance;
|
|
432
379
|
}
|
|
433
380
|
|
|
434
381
|
public async getBridgedFeeJuicePaymentMethodForWallet(_wallet: Wallet, sender: AztecAddress) {
|