@aztec/end-to-end 3.0.0-nightly.20251118 → 3.0.0-nightly.20251119
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 +7 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +53 -30
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +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 +4 -3
- package/dest/e2e_deploy_contract/deploy_test.d.ts +1 -1
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +11 -8
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +4 -3
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +3 -2
- package/dest/e2e_p2p/shared.js +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +2 -2
- package/dest/fixtures/e2e_prover_test.d.ts +2 -0
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +10 -7
- package/dest/fixtures/token_utils.d.ts +4 -1
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +7 -4
- package/dest/fixtures/utils.js +2 -8
- package/dest/shared/gas_portal_test_harness.js +1 -1
- package/dest/spartan/setup_test_wallets.js +6 -6
- package/package.json +38 -38
- package/src/bench/client_flows/client_flows_benchmark.ts +75 -30
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +2 -2
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +4 -3
- package/src/e2e_deploy_contract/deploy_test.ts +1 -1
- package/src/e2e_fees/fees_test.ts +11 -8
- package/src/e2e_nested_contract/nested_contract_test.ts +4 -3
- package/src/e2e_p2p/p2p_network.ts +3 -2
- package/src/e2e_p2p/shared.ts +1 -1
- package/src/e2e_token_contract/token_contract_test.ts +2 -2
- package/src/fixtures/e2e_prover_test.ts +10 -7
- package/src/fixtures/token_utils.ts +4 -4
- package/src/fixtures/utils.ts +2 -2
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/spartan/setup_test_wallets.ts +8 -8
|
@@ -22,7 +22,7 @@ export async function setupTestAccountsWithTokens(nodeUrl, mintAmount, logger) {
|
|
|
22
22
|
const [recipientAccount, ...accounts] = (await registerInitialLocalNetworkAccountsInWallet(wallet)).slice(0, ACCOUNT_COUNT + 1);
|
|
23
23
|
const tokenAdmin = accounts[0];
|
|
24
24
|
const tokenAddress = await deployTokenAndMint(wallet, accounts, tokenAdmin, mintAmount, undefined, logger);
|
|
25
|
-
const tokenContract =
|
|
25
|
+
const tokenContract = TokenContract.at(tokenAddress, wallet);
|
|
26
26
|
return {
|
|
27
27
|
aztecNode,
|
|
28
28
|
accounts,
|
|
@@ -63,7 +63,7 @@ export async function deploySponsoredTestAccounts(wallet, aztecNode, mintAmount,
|
|
|
63
63
|
}));
|
|
64
64
|
const tokenAdmin = fundedAccounts[0];
|
|
65
65
|
const tokenAddress = await deployTokenAndMint(wallet, fundedAccounts.map((acc)=>acc.address), tokenAdmin.address, mintAmount, new SponsoredFeePaymentMethod(await getSponsoredFPCAddress()), logger);
|
|
66
|
-
const tokenContract =
|
|
66
|
+
const tokenContract = TokenContract.at(tokenAddress, wallet);
|
|
67
67
|
return {
|
|
68
68
|
aztecNode,
|
|
69
69
|
wallet,
|
|
@@ -99,7 +99,7 @@ export async function deployTestAccountsWithTokens(nodeUrl, l1RpcUrls, mnemonicO
|
|
|
99
99
|
}));
|
|
100
100
|
const tokenAdmin = fundedAccounts[0];
|
|
101
101
|
const tokenAddress = await deployTokenAndMint(wallet, fundedAccounts.map((acc)=>acc.address), tokenAdmin.address, mintAmount, undefined, logger);
|
|
102
|
-
const tokenContract =
|
|
102
|
+
const tokenContract = TokenContract.at(tokenAddress, wallet);
|
|
103
103
|
return {
|
|
104
104
|
aztecNode,
|
|
105
105
|
wallet,
|
|
@@ -150,7 +150,7 @@ async function deployTokenAndMint(wallet, accounts, admin, mintAmount, paymentMe
|
|
|
150
150
|
});
|
|
151
151
|
const tokenAddress = tokenContract.address;
|
|
152
152
|
logger.verbose(`Minting ${mintAmount} public assets to the ${accounts.length} accounts...`);
|
|
153
|
-
await Promise.all(accounts.map(
|
|
153
|
+
await Promise.all(accounts.map((acc)=>TokenContract.at(tokenAddress, wallet).methods.mint_to_public(acc, mintAmount).send({
|
|
154
154
|
from: admin,
|
|
155
155
|
fee: {
|
|
156
156
|
paymentMethod
|
|
@@ -166,8 +166,8 @@ export async function performTransfers({ wallet, testAccounts, rounds, transferA
|
|
|
166
166
|
// Default to sponsored fee payment if no fee method is provided
|
|
167
167
|
const defaultFeePaymentMethod = feePaymentMethod || new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
|
|
168
168
|
for(let i = 0; i < rounds; i++){
|
|
169
|
-
const txs = testAccounts.accounts.map(
|
|
170
|
-
const token =
|
|
169
|
+
const txs = testAccounts.accounts.map((acc)=>{
|
|
170
|
+
const token = TokenContract.at(testAccounts.tokenAddress, testAccounts.wallet);
|
|
171
171
|
return proveInteraction(wallet, token.methods.transfer_in_public(acc, recipient, transferAmount, 0), {
|
|
172
172
|
from: acc,
|
|
173
173
|
fee: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251119",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,43 +25,43 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "3.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "3.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
34
|
-
"@aztec/bb.js": "3.0.0-nightly.
|
|
35
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
36
|
-
"@aztec/blob-sink": "3.0.0-nightly.
|
|
37
|
-
"@aztec/bot": "3.0.0-nightly.
|
|
38
|
-
"@aztec/cli": "3.0.0-nightly.
|
|
39
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
40
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
41
|
-
"@aztec/epoch-cache": "3.0.0-nightly.
|
|
42
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
43
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
44
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
45
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
46
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
47
|
-
"@aztec/node-keystore": "3.0.0-nightly.
|
|
48
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
49
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
50
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
51
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
52
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
53
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
54
|
-
"@aztec/prover-client": "3.0.0-nightly.
|
|
55
|
-
"@aztec/prover-node": "3.0.0-nightly.
|
|
56
|
-
"@aztec/pxe": "3.0.0-nightly.
|
|
57
|
-
"@aztec/sequencer-client": "3.0.0-nightly.
|
|
58
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
59
|
-
"@aztec/slasher": "3.0.0-nightly.
|
|
60
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
61
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
62
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
63
|
-
"@aztec/validator-client": "3.0.0-nightly.
|
|
64
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "3.0.0-nightly.20251119",
|
|
29
|
+
"@aztec/archiver": "3.0.0-nightly.20251119",
|
|
30
|
+
"@aztec/aztec": "3.0.0-nightly.20251119",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-nightly.20251119",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-nightly.20251119",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-nightly.20251119",
|
|
34
|
+
"@aztec/bb.js": "3.0.0-nightly.20251119",
|
|
35
|
+
"@aztec/blob-lib": "3.0.0-nightly.20251119",
|
|
36
|
+
"@aztec/blob-sink": "3.0.0-nightly.20251119",
|
|
37
|
+
"@aztec/bot": "3.0.0-nightly.20251119",
|
|
38
|
+
"@aztec/cli": "3.0.0-nightly.20251119",
|
|
39
|
+
"@aztec/constants": "3.0.0-nightly.20251119",
|
|
40
|
+
"@aztec/entrypoints": "3.0.0-nightly.20251119",
|
|
41
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20251119",
|
|
42
|
+
"@aztec/ethereum": "3.0.0-nightly.20251119",
|
|
43
|
+
"@aztec/foundation": "3.0.0-nightly.20251119",
|
|
44
|
+
"@aztec/kv-store": "3.0.0-nightly.20251119",
|
|
45
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20251119",
|
|
46
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20251119",
|
|
47
|
+
"@aztec/node-keystore": "3.0.0-nightly.20251119",
|
|
48
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20251119",
|
|
49
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20251119",
|
|
50
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251119",
|
|
51
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20251119",
|
|
52
|
+
"@aztec/p2p": "3.0.0-nightly.20251119",
|
|
53
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251119",
|
|
54
|
+
"@aztec/prover-client": "3.0.0-nightly.20251119",
|
|
55
|
+
"@aztec/prover-node": "3.0.0-nightly.20251119",
|
|
56
|
+
"@aztec/pxe": "3.0.0-nightly.20251119",
|
|
57
|
+
"@aztec/sequencer-client": "3.0.0-nightly.20251119",
|
|
58
|
+
"@aztec/simulator": "3.0.0-nightly.20251119",
|
|
59
|
+
"@aztec/slasher": "3.0.0-nightly.20251119",
|
|
60
|
+
"@aztec/stdlib": "3.0.0-nightly.20251119",
|
|
61
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20251119",
|
|
62
|
+
"@aztec/test-wallet": "3.0.0-nightly.20251119",
|
|
63
|
+
"@aztec/validator-client": "3.0.0-nightly.20251119",
|
|
64
|
+
"@aztec/world-state": "3.0.0-nightly.20251119",
|
|
65
65
|
"@iarna/toml": "^2.2.5",
|
|
66
66
|
"@jest/globals": "^30.0.0",
|
|
67
67
|
"@noble/curves": "=1.0.0",
|
|
@@ -20,6 +20,7 @@ import { TokenContract as BananaCoin, TokenContract } from '@aztec/noir-contract
|
|
|
20
20
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
21
21
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
22
22
|
import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
|
|
23
|
+
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
23
24
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
24
25
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
25
26
|
import { TestWallet } from '@aztec/test-wallet/server';
|
|
@@ -69,15 +70,21 @@ export class ClientFlowsBenchmark {
|
|
|
69
70
|
public feeJuiceContract!: FeeJuiceContract;
|
|
70
71
|
// Asset in which fees are paid via FPC
|
|
71
72
|
public bananaCoin!: BananaCoin;
|
|
73
|
+
public bananaCoinInstance!: ContractInstanceWithAddress;
|
|
72
74
|
public bananaFPC!: FPCContract;
|
|
75
|
+
public bananaFPCInstance!: ContractInstanceWithAddress;
|
|
73
76
|
// Random asset we want to trade
|
|
74
77
|
public candyBarCoin!: TokenContract;
|
|
78
|
+
public candyBarCoinInstance!: ContractInstanceWithAddress;
|
|
75
79
|
// AMM contract
|
|
76
80
|
public amm!: AMMContract;
|
|
81
|
+
public ammInstance!: ContractInstanceWithAddress;
|
|
77
82
|
// Liquidity token for AMM
|
|
78
83
|
public liquidityToken!: TokenContract;
|
|
84
|
+
public liquidityTokenInstance!: ContractInstanceWithAddress;
|
|
79
85
|
// Sponsored FPC contract
|
|
80
86
|
public sponsoredFPC!: SponsoredFPCContract;
|
|
87
|
+
public sponsoredFPCInstance!: ContractInstanceWithAddress;
|
|
81
88
|
|
|
82
89
|
// PXE and Wallet used by the benchmarking user. It can be set up with client-side proving enabled
|
|
83
90
|
public userWallet!: TestWallet;
|
|
@@ -204,7 +211,7 @@ export class ClientFlowsBenchmark {
|
|
|
204
211
|
this.sequencerAddress = sequencerAddress;
|
|
205
212
|
|
|
206
213
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
207
|
-
this.feeJuiceContract =
|
|
214
|
+
this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
|
|
208
215
|
this.coinbase = EthAddress.random();
|
|
209
216
|
|
|
210
217
|
const userPXEConfig = getPXEConfig();
|
|
@@ -229,7 +236,7 @@ export class ClientFlowsBenchmark {
|
|
|
229
236
|
async (_data, context) => {
|
|
230
237
|
this.context = context;
|
|
231
238
|
|
|
232
|
-
this.feeJuiceContract =
|
|
239
|
+
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
|
|
233
240
|
|
|
234
241
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
235
242
|
aztecNode: context.aztecNode,
|
|
@@ -246,14 +253,22 @@ export class ClientFlowsBenchmark {
|
|
|
246
253
|
await this.snapshotManager.snapshot(
|
|
247
254
|
'deploy_banana_token',
|
|
248
255
|
async () => {
|
|
249
|
-
const bananaCoin = await BananaCoin.deploy(
|
|
256
|
+
const { contract: bananaCoin, instance: bananaCoinInstance } = await BananaCoin.deploy(
|
|
257
|
+
this.adminWallet,
|
|
258
|
+
this.adminAddress,
|
|
259
|
+
'BC',
|
|
260
|
+
'BC',
|
|
261
|
+
18n,
|
|
262
|
+
)
|
|
250
263
|
.send({ from: this.adminAddress })
|
|
251
|
-
.
|
|
264
|
+
.wait();
|
|
252
265
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
253
|
-
return { bananaCoinAddress: bananaCoin.address };
|
|
266
|
+
return { bananaCoinAddress: bananaCoin.address, bananaCoinInstance };
|
|
254
267
|
},
|
|
255
|
-
|
|
256
|
-
this.bananaCoin =
|
|
268
|
+
({ bananaCoinAddress, bananaCoinInstance }) => {
|
|
269
|
+
this.bananaCoin = BananaCoin.at(bananaCoinAddress, this.adminWallet);
|
|
270
|
+
this.bananaCoinInstance = bananaCoinInstance;
|
|
271
|
+
return Promise.resolve();
|
|
257
272
|
},
|
|
258
273
|
);
|
|
259
274
|
}
|
|
@@ -262,14 +277,22 @@ export class ClientFlowsBenchmark {
|
|
|
262
277
|
await this.snapshotManager.snapshot(
|
|
263
278
|
'deploy_candy_bar_token',
|
|
264
279
|
async () => {
|
|
265
|
-
const candyBarCoin = await TokenContract.deploy(
|
|
280
|
+
const { contract: candyBarCoin, instance: candyBarCoinInstance } = await TokenContract.deploy(
|
|
281
|
+
this.adminWallet,
|
|
282
|
+
this.adminAddress,
|
|
283
|
+
'CBC',
|
|
284
|
+
'CBC',
|
|
285
|
+
18n,
|
|
286
|
+
)
|
|
266
287
|
.send({ from: this.adminAddress })
|
|
267
|
-
.
|
|
288
|
+
.wait();
|
|
268
289
|
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
269
|
-
return { candyBarCoinAddress: candyBarCoin.address };
|
|
290
|
+
return { candyBarCoinAddress: candyBarCoin.address, candyBarCoinInstance };
|
|
270
291
|
},
|
|
271
|
-
|
|
272
|
-
this.candyBarCoin =
|
|
292
|
+
({ candyBarCoinAddress, candyBarCoinInstance }) => {
|
|
293
|
+
this.candyBarCoin = TokenContract.at(candyBarCoinAddress, this.adminWallet);
|
|
294
|
+
this.candyBarCoinInstance = candyBarCoinInstance;
|
|
295
|
+
return Promise.resolve();
|
|
273
296
|
},
|
|
274
297
|
);
|
|
275
298
|
}
|
|
@@ -282,18 +305,24 @@ export class ClientFlowsBenchmark {
|
|
|
282
305
|
expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
283
306
|
|
|
284
307
|
const bananaCoin = this.bananaCoin;
|
|
285
|
-
const bananaFPC = await FPCContract.deploy(
|
|
308
|
+
const { contract: bananaFPC, instance: bananaFPCInstance } = await FPCContract.deploy(
|
|
309
|
+
this.adminWallet,
|
|
310
|
+
bananaCoin.address,
|
|
311
|
+
this.adminAddress,
|
|
312
|
+
)
|
|
286
313
|
.send({ from: this.adminAddress })
|
|
287
|
-
.
|
|
314
|
+
.wait();
|
|
288
315
|
|
|
289
316
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
290
317
|
|
|
291
318
|
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
|
|
292
319
|
|
|
293
|
-
return { bananaFPCAddress: bananaFPC.address };
|
|
320
|
+
return { bananaFPCAddress: bananaFPC.address, bananaFPCInstance };
|
|
294
321
|
},
|
|
295
|
-
|
|
296
|
-
this.bananaFPC =
|
|
322
|
+
data => {
|
|
323
|
+
this.bananaFPC = FPCContract.at(data.bananaFPCAddress, this.adminWallet);
|
|
324
|
+
this.bananaFPCInstance = data.bananaFPCInstance;
|
|
325
|
+
return Promise.resolve();
|
|
297
326
|
},
|
|
298
327
|
);
|
|
299
328
|
}
|
|
@@ -302,12 +331,14 @@ export class ClientFlowsBenchmark {
|
|
|
302
331
|
await this.snapshotManager.snapshot(
|
|
303
332
|
'deploy_sponsored_fpc',
|
|
304
333
|
async () => {
|
|
305
|
-
const
|
|
306
|
-
this.logger.info(`SponsoredFPC at ${
|
|
307
|
-
return { sponsoredFPCAddress:
|
|
334
|
+
const sponsoredFPCInstance = await setupSponsoredFPC(this.adminWallet);
|
|
335
|
+
this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
|
|
336
|
+
return { sponsoredFPCAddress: sponsoredFPCInstance.address, sponsoredFPCInstance };
|
|
308
337
|
},
|
|
309
|
-
|
|
310
|
-
this.sponsoredFPC =
|
|
338
|
+
({ sponsoredFPCAddress, sponsoredFPCInstance }) => {
|
|
339
|
+
this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCAddress, this.adminWallet);
|
|
340
|
+
this.sponsoredFPCInstance = sponsoredFPCInstance;
|
|
341
|
+
return Promise.resolve();
|
|
311
342
|
},
|
|
312
343
|
);
|
|
313
344
|
}
|
|
@@ -361,24 +392,38 @@ export class ClientFlowsBenchmark {
|
|
|
361
392
|
await this.snapshotManager.snapshot(
|
|
362
393
|
'deploy_amm',
|
|
363
394
|
async () => {
|
|
364
|
-
const liquidityToken = await TokenContract.deploy(
|
|
395
|
+
const { contract: liquidityToken, instance: liquidityTokenInstance } = await TokenContract.deploy(
|
|
396
|
+
this.adminWallet,
|
|
397
|
+
this.adminAddress,
|
|
398
|
+
'LPT',
|
|
399
|
+
'LPT',
|
|
400
|
+
18n,
|
|
401
|
+
)
|
|
365
402
|
.send({ from: this.adminAddress })
|
|
366
|
-
.
|
|
367
|
-
const amm = await AMMContract.deploy(
|
|
403
|
+
.wait();
|
|
404
|
+
const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
|
|
368
405
|
this.adminWallet,
|
|
369
406
|
this.bananaCoin.address,
|
|
370
407
|
this.candyBarCoin.address,
|
|
371
408
|
liquidityToken.address,
|
|
372
409
|
)
|
|
373
410
|
.send({ from: this.adminAddress })
|
|
374
|
-
.
|
|
411
|
+
.wait();
|
|
375
412
|
this.logger.info(`AMM deployed at ${amm.address}`);
|
|
376
413
|
await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
|
|
377
|
-
return {
|
|
414
|
+
return {
|
|
415
|
+
ammAddress: amm.address,
|
|
416
|
+
ammInstance,
|
|
417
|
+
liquidityTokenAddress: liquidityToken.address,
|
|
418
|
+
liquidityTokenInstance,
|
|
419
|
+
};
|
|
378
420
|
},
|
|
379
|
-
|
|
380
|
-
this.liquidityToken =
|
|
381
|
-
this.
|
|
421
|
+
({ ammAddress, ammInstance, liquidityTokenAddress, liquidityTokenInstance }) => {
|
|
422
|
+
this.liquidityToken = TokenContract.at(liquidityTokenAddress, this.adminWallet);
|
|
423
|
+
this.liquidityTokenInstance = liquidityTokenInstance;
|
|
424
|
+
this.amm = AMMContract.at(ammAddress, this.adminWallet);
|
|
425
|
+
this.ammInstance = ammInstance;
|
|
426
|
+
return Promise.resolve();
|
|
382
427
|
},
|
|
383
428
|
);
|
|
384
429
|
}
|
|
@@ -130,7 +130,7 @@ export class BlacklistTokenContractTest {
|
|
|
130
130
|
},
|
|
131
131
|
async ({ tokenContractAddress, badAccountAddress }) => {
|
|
132
132
|
// Restore the token contract state.
|
|
133
|
-
this.asset =
|
|
133
|
+
this.asset = TokenBlacklistContract.at(tokenContractAddress, this.wallet);
|
|
134
134
|
this.logger.verbose(`Token contract address: ${this.asset.address}`);
|
|
135
135
|
|
|
136
136
|
this.tokenSim = new TokenSimulator(
|
|
@@ -141,7 +141,7 @@ export class BlacklistTokenContractTest {
|
|
|
141
141
|
[this.adminAddress, this.otherAddress, this.blacklistedAddress],
|
|
142
142
|
);
|
|
143
143
|
|
|
144
|
-
this.badAccount =
|
|
144
|
+
this.badAccount = InvalidAccountContract.at(badAccountAddress, this.wallet);
|
|
145
145
|
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
146
146
|
|
|
147
147
|
expect(await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).toEqual(
|
|
@@ -134,9 +134,9 @@ export class CrossChainMessagingTest {
|
|
|
134
134
|
|
|
135
135
|
return this.crossChainTestHarness.toCrossChainContext();
|
|
136
136
|
},
|
|
137
|
-
|
|
138
|
-
this.l2Token =
|
|
139
|
-
this.l2Bridge =
|
|
137
|
+
crossChainContext => {
|
|
138
|
+
this.l2Token = TokenContract.at(crossChainContext.l2Token, this.wallet);
|
|
139
|
+
this.l2Bridge = TokenBridgeContract.at(crossChainContext.l2Bridge, this.wallet);
|
|
140
140
|
|
|
141
141
|
// There is an issue with the reviver so we are getting strings sometimes. Working around it here.
|
|
142
142
|
this.ethAccount = EthAddress.fromString(crossChainContext.ethAccount.toString());
|
|
@@ -172,6 +172,7 @@ export class CrossChainMessagingTest {
|
|
|
172
172
|
this.l1Client = l1Client;
|
|
173
173
|
this.inbox = inbox;
|
|
174
174
|
this.outbox = outbox;
|
|
175
|
+
return Promise.resolve();
|
|
175
176
|
},
|
|
176
177
|
);
|
|
177
178
|
}
|
|
@@ -73,6 +73,6 @@ export class DeployTest {
|
|
|
73
73
|
export type StatefulContractCtorArgs = Parameters<StatefulTestContract['methods']['constructor']>;
|
|
74
74
|
|
|
75
75
|
export type ContractArtifactClass<T extends ContractBase> = {
|
|
76
|
-
at(address: AztecAddress, wallet: Wallet):
|
|
76
|
+
at(address: AztecAddress, wallet: Wallet): T;
|
|
77
77
|
artifact: ContractArtifact;
|
|
78
78
|
};
|
|
@@ -197,7 +197,7 @@ export class FeesTest {
|
|
|
197
197
|
this.fpcAdmin = this.aliceAddress;
|
|
198
198
|
|
|
199
199
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
200
|
-
this.feeJuiceContract =
|
|
200
|
+
this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.wallet);
|
|
201
201
|
},
|
|
202
202
|
);
|
|
203
203
|
}
|
|
@@ -215,7 +215,7 @@ export class FeesTest {
|
|
|
215
215
|
async (_data, context) => {
|
|
216
216
|
this.context = context;
|
|
217
217
|
|
|
218
|
-
this.feeJuiceContract =
|
|
218
|
+
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.wallet);
|
|
219
219
|
|
|
220
220
|
this.getGasBalanceFn = getBalancesFn(
|
|
221
221
|
'⛽',
|
|
@@ -245,8 +245,8 @@ export class FeesTest {
|
|
|
245
245
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
246
246
|
return { bananaCoinAddress: bananaCoin.address };
|
|
247
247
|
},
|
|
248
|
-
|
|
249
|
-
this.bananaCoin =
|
|
248
|
+
({ bananaCoinAddress }) => {
|
|
249
|
+
this.bananaCoin = BananaCoin.at(bananaCoinAddress, this.wallet);
|
|
250
250
|
const logger = this.logger;
|
|
251
251
|
this.getBananaPublicBalanceFn = getBalancesFn(
|
|
252
252
|
'🍌.public',
|
|
@@ -260,6 +260,7 @@ export class FeesTest {
|
|
|
260
260
|
this.aliceAddress,
|
|
261
261
|
logger,
|
|
262
262
|
);
|
|
263
|
+
return Promise.resolve();
|
|
263
264
|
},
|
|
264
265
|
);
|
|
265
266
|
}
|
|
@@ -287,8 +288,8 @@ export class FeesTest {
|
|
|
287
288
|
rollupAddress: context.deployL1ContractsValues.l1ContractAddresses.rollupAddress,
|
|
288
289
|
};
|
|
289
290
|
},
|
|
290
|
-
|
|
291
|
-
const bananaFPC =
|
|
291
|
+
(data, context) => {
|
|
292
|
+
const bananaFPC = FPCContract.at(data.bananaFPCAddress, this.wallet);
|
|
292
293
|
this.bananaFPC = bananaFPC;
|
|
293
294
|
|
|
294
295
|
this.getCoinbaseBalance = async () => {
|
|
@@ -328,6 +329,7 @@ export class FeesTest {
|
|
|
328
329
|
const mana = block!.header.totalManaUsed.toBigInt();
|
|
329
330
|
return mulDiv(mana * proverCost, price, 10n ** 9n);
|
|
330
331
|
};
|
|
332
|
+
return Promise.resolve();
|
|
331
333
|
},
|
|
332
334
|
);
|
|
333
335
|
}
|
|
@@ -346,8 +348,9 @@ export class FeesTest {
|
|
|
346
348
|
sponsoredFPCAddress: sponsoredFPC.address,
|
|
347
349
|
};
|
|
348
350
|
},
|
|
349
|
-
|
|
350
|
-
this.sponsoredFPC =
|
|
351
|
+
data => {
|
|
352
|
+
this.sponsoredFPC = SponsoredFPCContract.at(data.sponsoredFPCAddress, this.wallet);
|
|
353
|
+
return Promise.resolve();
|
|
351
354
|
},
|
|
352
355
|
);
|
|
353
356
|
}
|
|
@@ -86,9 +86,10 @@ export class NestedContractTest {
|
|
|
86
86
|
.deployed();
|
|
87
87
|
return { parentContractAddress: parentContract.address, childContractAddress: childContract.address };
|
|
88
88
|
},
|
|
89
|
-
|
|
90
|
-
this.parentContract =
|
|
91
|
-
this.childContract =
|
|
89
|
+
({ parentContractAddress, childContractAddress }) => {
|
|
90
|
+
this.parentContract = ParentContract.at(parentContractAddress, this.wallet);
|
|
91
|
+
this.childContract = ChildContract.at(childContractAddress, this.wallet);
|
|
92
|
+
return Promise.resolve();
|
|
92
93
|
},
|
|
93
94
|
);
|
|
94
95
|
}
|
|
@@ -326,11 +326,12 @@ export class P2PNetworkTest {
|
|
|
326
326
|
.deployed();
|
|
327
327
|
return { contractAddress: spamContract.address };
|
|
328
328
|
},
|
|
329
|
-
|
|
329
|
+
({ contractAddress }) => {
|
|
330
330
|
if (!this.wallet) {
|
|
331
331
|
throw new Error('Call snapshot t.setupAccount before deploying account contract');
|
|
332
332
|
}
|
|
333
|
-
this.spamContract =
|
|
333
|
+
this.spamContract = SpamContract.at(contractAddress, this.wallet);
|
|
334
|
+
return Promise.resolve();
|
|
334
335
|
},
|
|
335
336
|
);
|
|
336
337
|
}
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -80,7 +80,7 @@ export async function prepareTransactions(
|
|
|
80
80
|
salt: Fr.random(),
|
|
81
81
|
});
|
|
82
82
|
await wallet.registerContract(testContractInstance, TestContractArtifact);
|
|
83
|
-
const contract =
|
|
83
|
+
const contract = TestContract.at(testContractInstance.address, wallet);
|
|
84
84
|
|
|
85
85
|
return timesAsync(numTxs, async () => {
|
|
86
86
|
const tx = await proveInteraction(wallet, contract.methods.emit_nullifier(Fr.random()), {
|
|
@@ -90,7 +90,7 @@ export class TokenContractTest {
|
|
|
90
90
|
},
|
|
91
91
|
async ({ tokenContractAddress, badAccountAddress }) => {
|
|
92
92
|
// Restore the token contract state.
|
|
93
|
-
this.asset =
|
|
93
|
+
this.asset = TokenContract.at(tokenContractAddress, this.wallet);
|
|
94
94
|
this.logger.verbose(`Token contract address: ${this.asset.address}`);
|
|
95
95
|
|
|
96
96
|
this.tokenSim = new TokenSimulator(this.asset, this.wallet, this.adminAddress, this.logger, [
|
|
@@ -98,7 +98,7 @@ export class TokenContractTest {
|
|
|
98
98
|
this.account1Address,
|
|
99
99
|
]);
|
|
100
100
|
|
|
101
|
-
this.badAccount =
|
|
101
|
+
this.badAccount = InvalidAccountContract.at(badAccountAddress, this.wallet);
|
|
102
102
|
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
103
103
|
|
|
104
104
|
expect(await this.asset.methods.get_admin().simulate({ from: this.adminAddress })).toBe(
|
|
@@ -19,6 +19,7 @@ import { SecretValue } from '@aztec/foundation/config';
|
|
|
19
19
|
import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
20
20
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
21
21
|
import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
|
|
22
|
+
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
22
23
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
23
24
|
import { TestWallet } from '@aztec/test-wallet/server';
|
|
24
25
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
@@ -63,6 +64,7 @@ export class FullProverTest {
|
|
|
63
64
|
accounts: AztecAddress[] = [];
|
|
64
65
|
deployedAccounts!: InitialAccountData[];
|
|
65
66
|
fakeProofsAsset!: TokenContract;
|
|
67
|
+
fakeProofsAssetInstance!: ContractInstanceWithAddress;
|
|
66
68
|
tokenSim!: TokenSimulator;
|
|
67
69
|
aztecNode!: AztecNode;
|
|
68
70
|
aztecNodeAdmin!: AztecNodeAdmin;
|
|
@@ -122,7 +124,7 @@ export class FullProverTest {
|
|
|
122
124
|
await publicDeployAccounts(this.wallet, this.accounts.slice(0, 2));
|
|
123
125
|
|
|
124
126
|
this.logger.verbose(`Deploying TokenContract...`);
|
|
125
|
-
const asset = await TokenContract.deploy(
|
|
127
|
+
const { contract: asset, instance } = await TokenContract.deploy(
|
|
126
128
|
this.wallet,
|
|
127
129
|
this.accounts[0],
|
|
128
130
|
FullProverTest.TOKEN_NAME,
|
|
@@ -130,14 +132,15 @@ export class FullProverTest {
|
|
|
130
132
|
FullProverTest.TOKEN_DECIMALS,
|
|
131
133
|
)
|
|
132
134
|
.send({ from: this.accounts[0] })
|
|
133
|
-
.
|
|
135
|
+
.wait();
|
|
134
136
|
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
135
137
|
|
|
136
|
-
return { tokenContractAddress: asset.address };
|
|
138
|
+
return { tokenContractAddress: asset.address, tokenContractInstance: instance };
|
|
137
139
|
},
|
|
138
|
-
async ({ tokenContractAddress }) => {
|
|
140
|
+
async ({ tokenContractAddress, tokenContractInstance }) => {
|
|
139
141
|
// Restore the token contract state.
|
|
140
|
-
this.fakeProofsAsset =
|
|
142
|
+
this.fakeProofsAsset = TokenContract.at(tokenContractAddress, this.wallet);
|
|
143
|
+
this.fakeProofsAssetInstance = tokenContractInstance;
|
|
141
144
|
this.logger.verbose(`Token contract address: ${this.fakeProofsAsset.address}`);
|
|
142
145
|
|
|
143
146
|
this.tokenSim = new TokenSimulator(
|
|
@@ -216,14 +219,14 @@ export class FullProverTest {
|
|
|
216
219
|
true,
|
|
217
220
|
);
|
|
218
221
|
this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
|
|
219
|
-
await provenWallet.registerContract(this.
|
|
222
|
+
await provenWallet.registerContract(this.fakeProofsAssetInstance, TokenContract.artifact);
|
|
220
223
|
|
|
221
224
|
for (let i = 0; i < 2; i++) {
|
|
222
225
|
await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
223
226
|
await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
224
227
|
}
|
|
225
228
|
|
|
226
|
-
const asset =
|
|
229
|
+
const asset = TokenContract.at(this.fakeProofsAsset.address, provenWallet);
|
|
227
230
|
this.provenComponents.push({
|
|
228
231
|
wallet: provenWallet,
|
|
229
232
|
teardown: provenTeardown,
|
|
@@ -6,9 +6,9 @@ import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
|
6
6
|
|
|
7
7
|
export async function deployToken(wallet: Wallet, admin: AztecAddress, initialAdminBalance: bigint, logger: Logger) {
|
|
8
8
|
logger.info(`Deploying Token contract...`);
|
|
9
|
-
const contract = await TokenContract.deploy(wallet, admin, 'TokenName', 'TokenSymbol', 18)
|
|
9
|
+
const { contract, instance } = await TokenContract.deploy(wallet, admin, 'TokenName', 'TokenSymbol', 18)
|
|
10
10
|
.send({ from: admin })
|
|
11
|
-
.
|
|
11
|
+
.wait();
|
|
12
12
|
|
|
13
13
|
if (initialAdminBalance > 0n) {
|
|
14
14
|
await mintTokensToPrivate(contract, admin, admin, initialAdminBalance);
|
|
@@ -16,7 +16,7 @@ export async function deployToken(wallet: Wallet, admin: AztecAddress, initialAd
|
|
|
16
16
|
|
|
17
17
|
logger.info('L2 contract deployed');
|
|
18
18
|
|
|
19
|
-
return contract;
|
|
19
|
+
return { contract, instance };
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export async function mintTokensToPrivate(
|
|
@@ -36,7 +36,7 @@ export async function expectTokenBalance(
|
|
|
36
36
|
logger: Logger,
|
|
37
37
|
) {
|
|
38
38
|
// Then check the balance
|
|
39
|
-
const contractWithWallet =
|
|
39
|
+
const contractWithWallet = TokenContract.at(token.address, wallet);
|
|
40
40
|
const balance = await contractWithWallet.methods.balance_of_private(owner).simulate({ from: owner });
|
|
41
41
|
logger.info(`Account ${owner} balance: ${balance}`);
|
|
42
42
|
expect(balance).toBe(expectedBalance);
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -858,7 +858,7 @@ export async function setupSponsoredFPC(wallet: Wallet) {
|
|
|
858
858
|
salt: new Fr(SPONSORED_FPC_SALT),
|
|
859
859
|
});
|
|
860
860
|
|
|
861
|
-
await wallet.registerContract(
|
|
861
|
+
await wallet.registerContract(instance, SponsoredFPCContract.artifact);
|
|
862
862
|
getLogger().info(`SponsoredFPC: ${instance.address}`);
|
|
863
863
|
return instance;
|
|
864
864
|
}
|
|
@@ -868,7 +868,7 @@ export async function setupSponsoredFPC(wallet: Wallet) {
|
|
|
868
868
|
* @param wallet - The wallet
|
|
869
869
|
*/
|
|
870
870
|
export async function registerSponsoredFPC(wallet: Wallet): Promise<void> {
|
|
871
|
-
await wallet.registerContract(
|
|
871
|
+
await wallet.registerContract(await getSponsoredFPCInstance(), SponsoredFPCContract.artifact);
|
|
872
872
|
}
|
|
873
873
|
|
|
874
874
|
export async function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec = 60, intervalSec = 1) {
|
|
@@ -43,7 +43,7 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
43
43
|
throw new Error('Fee Juice portal not deployed on L1');
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
const gasL2 =
|
|
46
|
+
const gasL2 = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, wallet);
|
|
47
47
|
|
|
48
48
|
return new GasBridgingTestHarness(
|
|
49
49
|
aztecNode,
|