@aztec/cli 1.0.0-nightly.20250709 → 1.0.0-nightly.20250711
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/cmds/pxe/get_contract_data.js +1 -1
- package/dest/cmds/pxe/get_node_info.js +4 -4
- package/dest/cmds/pxe/get_pxe_info.js +2 -2
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +12 -19
- package/dest/utils/setup_contracts.js +2 -2
- package/package.json +22 -22
- package/src/cmds/pxe/get_contract_data.ts +1 -1
- package/src/cmds/pxe/get_node_info.ts +4 -4
- package/src/cmds/pxe/get_pxe_info.ts +2 -2
- package/src/utils/inspect.ts +11 -16
- package/src/utils/setup_contracts.ts +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
2
|
export async function getContractData(rpcUrl, contractAddress, includeBytecode, debugLogger, log) {
|
|
3
3
|
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
4
|
-
const { contractInstance: instance, isContractInitialized: isInitialized,
|
|
4
|
+
const { contractInstance: instance, isContractInitialized: isInitialized, isContractPublished: isPubliclyDeployed } = await client.getContractMetadata(contractAddress);
|
|
5
5
|
const contractClass = includeBytecode && instance && (await client.getContractClassMetadata(instance?.currentContractClassId)).contractClass;
|
|
6
6
|
const isPrivatelyDeployed = !!instance;
|
|
7
7
|
const initStr = isInitialized ? 'initialized' : 'not initialized';
|
|
@@ -30,9 +30,9 @@ export async function getNodeInfo(rpcUrl, pxeRequest, debugLogger, json, log, lo
|
|
|
30
30
|
stakingAssetHandler: info.l1ContractAddresses.stakingAssetHandlerAddress?.toString()
|
|
31
31
|
},
|
|
32
32
|
protocolContractAddresses: {
|
|
33
|
-
|
|
33
|
+
classRegistry: info.protocolContractAddresses.classRegistry.toString(),
|
|
34
34
|
feeJuice: info.protocolContractAddresses.feeJuice.toString(),
|
|
35
|
-
|
|
35
|
+
instanceRegistry: info.protocolContractAddresses.instanceRegistry.toString(),
|
|
36
36
|
multiCallEntrypoint: info.protocolContractAddresses.multiCallEntrypoint.toString()
|
|
37
37
|
}
|
|
38
38
|
});
|
|
@@ -57,9 +57,9 @@ export async function getNodeInfo(rpcUrl, pxeRequest, debugLogger, json, log, lo
|
|
|
57
57
|
log(` FeeAssetHandler Address: ${info.l1ContractAddresses.feeAssetHandlerAddress?.toString()}`);
|
|
58
58
|
log(` StakingAssetHandler Address: ${info.l1ContractAddresses.stakingAssetHandlerAddress?.toString()}`);
|
|
59
59
|
log(`L2 Contract Addresses:`);
|
|
60
|
-
log(` Class
|
|
60
|
+
log(` Class Registry: ${info.protocolContractAddresses.classRegistry.toString()}`);
|
|
61
61
|
log(` Fee Juice: ${info.protocolContractAddresses.feeJuice.toString()}`);
|
|
62
|
-
log(` Instance Deployer: ${info.protocolContractAddresses.
|
|
62
|
+
log(` Instance Deployer: ${info.protocolContractAddresses.instanceRegistry.toString()}`);
|
|
63
63
|
log(` MultiCall: ${info.protocolContractAddresses.multiCallEntrypoint.toString()}`);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -4,8 +4,8 @@ export async function getPXEInfo(rpcUrl, debugLogger, log) {
|
|
|
4
4
|
const info = await client.getPXEInfo();
|
|
5
5
|
log(`PXE Version: ${info.pxeVersion}`);
|
|
6
6
|
log(`Protocol Contract Addresses:`);
|
|
7
|
-
log(` Class
|
|
7
|
+
log(` Class Registry: ${info.protocolContractAddresses.classRegistry.toString()}`);
|
|
8
8
|
log(` Fee Juice: ${info.protocolContractAddresses.feeJuice.toString()}`);
|
|
9
|
-
log(` Instance Deployer: ${info.protocolContractAddresses.
|
|
9
|
+
log(` Instance Deployer: ${info.protocolContractAddresses.instanceRegistry.toString()}`);
|
|
10
10
|
log(` Multi Call Entrypoint: ${info.protocolContractAddresses.multiCallEntrypoint.toString()}`);
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/utils/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,gBAAgB,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,iBA0B7G;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,EACV,IAAI,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,WAAW,CAAA;CAAO,
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/utils/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,gBAAgB,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,iBA0B7G;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,EACV,IAAI,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,WAAW,CAAA;CAAO,iBA8FrE;AAuCD,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;AAC/D,KAAK,2BAA2B,GAAG,gBAAgB,GAAG;IAAE,OAAO,EAAE,EAAE,CAAA;CAAE,CAAC"}
|
package/dest/utils/inspect.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
2
2
|
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
3
|
-
import { NoteStatus } from '@aztec/stdlib/note';
|
|
4
3
|
export async function inspectBlock(pxe, blockNumber, log, opts = {}) {
|
|
5
4
|
const block = await pxe.getBlock(blockNumber);
|
|
6
5
|
if (!block) {
|
|
@@ -29,13 +28,9 @@ export async function inspectBlock(pxe, blockNumber, log, opts = {}) {
|
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
export async function inspectTx(pxe, txHash, log, opts = {}) {
|
|
32
|
-
const [receipt, effectsInBlock
|
|
31
|
+
const [receipt, effectsInBlock] = await Promise.all([
|
|
33
32
|
pxe.getTxReceipt(txHash),
|
|
34
|
-
pxe.getTxEffect(txHash)
|
|
35
|
-
pxe.getNotes({
|
|
36
|
-
txHash,
|
|
37
|
-
status: NoteStatus.ACTIVE_OR_NULLIFIED
|
|
38
|
-
})
|
|
33
|
+
pxe.getTxEffect(txHash)
|
|
39
34
|
]);
|
|
40
35
|
// Base tx data
|
|
41
36
|
log(`Tx ${txHash.toString()}`);
|
|
@@ -74,12 +69,9 @@ export async function inspectTx(pxe, txHash, log, opts = {}) {
|
|
|
74
69
|
const notes = effects.noteHashes;
|
|
75
70
|
if (notes.length > 0) {
|
|
76
71
|
log(' Created notes:');
|
|
77
|
-
log(` Total: ${notes.length}
|
|
78
|
-
|
|
79
|
-
log(
|
|
80
|
-
for (const note of getNotes){
|
|
81
|
-
inspectNote(note, artifactMap, log);
|
|
82
|
-
}
|
|
72
|
+
log(` Total: ${notes.length}`);
|
|
73
|
+
for (const note of notes){
|
|
74
|
+
log(` Note hash: ${note.toShortString()}`);
|
|
83
75
|
}
|
|
84
76
|
}
|
|
85
77
|
// Nullifiers
|
|
@@ -88,10 +80,11 @@ export async function inspectTx(pxe, txHash, log, opts = {}) {
|
|
|
88
80
|
if (nullifierCount > 0) {
|
|
89
81
|
log(' Nullifiers:');
|
|
90
82
|
for (const nullifier of effects.nullifiers){
|
|
91
|
-
const [note] = await pxe.getNotes({
|
|
92
|
-
siloedNullifier: nullifier
|
|
93
|
-
});
|
|
94
83
|
const deployed = deployNullifiers[nullifier.toString()];
|
|
84
|
+
const note = deployed ? (await pxe.getNotes({
|
|
85
|
+
siloedNullifier: nullifier,
|
|
86
|
+
contractAddress: deployed
|
|
87
|
+
}))[0] : undefined;
|
|
95
88
|
const initialized = initNullifiers[nullifier.toString()];
|
|
96
89
|
const registered = classNullifiers[nullifier.toString()];
|
|
97
90
|
if (nullifier.toBuffer().equals(txHash.toBuffer())) {
|
|
@@ -135,8 +128,8 @@ function toFriendlyAddress(address, artifactMap) {
|
|
|
135
128
|
}
|
|
136
129
|
async function getKnownNullifiers(pxe, artifactMap) {
|
|
137
130
|
const knownContracts = await pxe.getContracts();
|
|
138
|
-
const deployerAddress = ProtocolContractAddress.
|
|
139
|
-
const
|
|
131
|
+
const deployerAddress = ProtocolContractAddress.ContractInstanceRegistry;
|
|
132
|
+
const classRegistryAddress = ProtocolContractAddress.ContractClassRegistry;
|
|
140
133
|
const initNullifiers = {};
|
|
141
134
|
const deployNullifiers = {};
|
|
142
135
|
const classNullifiers = {};
|
|
@@ -145,7 +138,7 @@ async function getKnownNullifiers(pxe, artifactMap) {
|
|
|
145
138
|
deployNullifiers[(await siloNullifier(deployerAddress, contract.toField())).toString()] = contract;
|
|
146
139
|
}
|
|
147
140
|
for (const artifact of Object.values(artifactMap)){
|
|
148
|
-
classNullifiers[(await siloNullifier(
|
|
141
|
+
classNullifiers[(await siloNullifier(classRegistryAddress, artifact.classId)).toString()] = `${artifact.name}Class<${artifact.classId}>`;
|
|
149
142
|
}
|
|
150
143
|
return {
|
|
151
144
|
initNullifiers,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultWaitOpts, Fr, SignerlessWallet, SponsoredFeePaymentMethod,
|
|
1
|
+
import { DefaultWaitOpts, Fr, SignerlessWallet, SponsoredFeePaymentMethod, getContractInstanceFromInstantiationParams, waitForProven } from '@aztec/aztec.js';
|
|
2
2
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
3
3
|
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
4
4
|
async function getSponsoredFPCContract() {
|
|
@@ -9,7 +9,7 @@ async function getSponsoredFPCContract() {
|
|
|
9
9
|
}
|
|
10
10
|
export async function getSponsoredFPCAddress() {
|
|
11
11
|
const SponsoredFPCContract = await getSponsoredFPCContract();
|
|
12
|
-
const sponsoredFPCInstance = await
|
|
12
|
+
const sponsoredFPCInstance = await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
|
|
13
13
|
salt: new Fr(SPONSORED_FPC_SALT)
|
|
14
14
|
});
|
|
15
15
|
return sponsoredFPCInstance.address;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250711",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./contracts": "./dest/cmds/contracts/index.js",
|
|
@@ -69,16 +69,16 @@
|
|
|
69
69
|
]
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@aztec/archiver": "1.0.0-nightly.
|
|
73
|
-
"@aztec/aztec.js": "1.0.0-nightly.
|
|
74
|
-
"@aztec/constants": "1.0.0-nightly.
|
|
75
|
-
"@aztec/entrypoints": "1.0.0-nightly.
|
|
76
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
77
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
78
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
79
|
-
"@aztec/p2p": "1.0.0-nightly.
|
|
80
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
81
|
-
"@aztec/world-state": "1.0.0-nightly.
|
|
72
|
+
"@aztec/archiver": "1.0.0-nightly.20250711",
|
|
73
|
+
"@aztec/aztec.js": "1.0.0-nightly.20250711",
|
|
74
|
+
"@aztec/constants": "1.0.0-nightly.20250711",
|
|
75
|
+
"@aztec/entrypoints": "1.0.0-nightly.20250711",
|
|
76
|
+
"@aztec/ethereum": "1.0.0-nightly.20250711",
|
|
77
|
+
"@aztec/foundation": "1.0.0-nightly.20250711",
|
|
78
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250711",
|
|
79
|
+
"@aztec/p2p": "1.0.0-nightly.20250711",
|
|
80
|
+
"@aztec/stdlib": "1.0.0-nightly.20250711",
|
|
81
|
+
"@aztec/world-state": "1.0.0-nightly.20250711",
|
|
82
82
|
"@iarna/toml": "^2.2.5",
|
|
83
83
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
84
84
|
"commander": "^12.1.0",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"viem": "2.23.7"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@aztec/accounts": "1.0.0-nightly.
|
|
94
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
93
|
+
"@aztec/accounts": "1.0.0-nightly.20250711",
|
|
94
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250711",
|
|
95
95
|
"@jest/globals": "^30.0.0",
|
|
96
96
|
"@types/jest": "^30.0.0",
|
|
97
97
|
"@types/lodash.chunk": "^4.2.9",
|
|
@@ -107,15 +107,15 @@
|
|
|
107
107
|
"typescript": "^5.3.3"
|
|
108
108
|
},
|
|
109
109
|
"peerDependencies": {
|
|
110
|
-
"@aztec/accounts": "1.0.0-nightly.
|
|
111
|
-
"@aztec/bb-prover": "1.0.0-nightly.
|
|
112
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
113
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
114
|
-
"@aztec/noir-contracts.js": "1.0.0-nightly.
|
|
115
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.
|
|
116
|
-
"@aztec/noir-test-contracts.js": "1.0.0-nightly.
|
|
117
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
118
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
110
|
+
"@aztec/accounts": "1.0.0-nightly.20250711",
|
|
111
|
+
"@aztec/bb-prover": "1.0.0-nightly.20250711",
|
|
112
|
+
"@aztec/ethereum": "1.0.0-nightly.20250711",
|
|
113
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250711",
|
|
114
|
+
"@aztec/noir-contracts.js": "1.0.0-nightly.20250711",
|
|
115
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250711",
|
|
116
|
+
"@aztec/noir-test-contracts.js": "1.0.0-nightly.20250711",
|
|
117
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250711",
|
|
118
|
+
"@aztec/stdlib": "1.0.0-nightly.20250711"
|
|
119
119
|
},
|
|
120
120
|
"files": [
|
|
121
121
|
"dest",
|
|
@@ -13,7 +13,7 @@ export async function getContractData(
|
|
|
13
13
|
const {
|
|
14
14
|
contractInstance: instance,
|
|
15
15
|
isContractInitialized: isInitialized,
|
|
16
|
-
|
|
16
|
+
isContractPublished: isPubliclyDeployed,
|
|
17
17
|
} = await client.getContractMetadata(contractAddress);
|
|
18
18
|
const contractClass =
|
|
19
19
|
includeBytecode &&
|
|
@@ -39,9 +39,9 @@ export async function getNodeInfo(
|
|
|
39
39
|
stakingAssetHandler: info.l1ContractAddresses.stakingAssetHandlerAddress?.toString(),
|
|
40
40
|
},
|
|
41
41
|
protocolContractAddresses: {
|
|
42
|
-
|
|
42
|
+
classRegistry: info.protocolContractAddresses.classRegistry.toString(),
|
|
43
43
|
feeJuice: info.protocolContractAddresses.feeJuice.toString(),
|
|
44
|
-
|
|
44
|
+
instanceRegistry: info.protocolContractAddresses.instanceRegistry.toString(),
|
|
45
45
|
multiCallEntrypoint: info.protocolContractAddresses.multiCallEntrypoint.toString(),
|
|
46
46
|
},
|
|
47
47
|
});
|
|
@@ -66,9 +66,9 @@ export async function getNodeInfo(
|
|
|
66
66
|
log(` FeeAssetHandler Address: ${info.l1ContractAddresses.feeAssetHandlerAddress?.toString()}`);
|
|
67
67
|
log(` StakingAssetHandler Address: ${info.l1ContractAddresses.stakingAssetHandlerAddress?.toString()}`);
|
|
68
68
|
log(`L2 Contract Addresses:`);
|
|
69
|
-
log(` Class
|
|
69
|
+
log(` Class Registry: ${info.protocolContractAddresses.classRegistry.toString()}`);
|
|
70
70
|
log(` Fee Juice: ${info.protocolContractAddresses.feeJuice.toString()}`);
|
|
71
|
-
log(` Instance Deployer: ${info.protocolContractAddresses.
|
|
71
|
+
log(` Instance Deployer: ${info.protocolContractAddresses.instanceRegistry.toString()}`);
|
|
72
72
|
log(` MultiCall: ${info.protocolContractAddresses.multiCallEntrypoint.toString()}`);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -6,8 +6,8 @@ export async function getPXEInfo(rpcUrl: string, debugLogger: Logger, log: LogFn
|
|
|
6
6
|
const info = await client.getPXEInfo();
|
|
7
7
|
log(`PXE Version: ${info.pxeVersion}`);
|
|
8
8
|
log(`Protocol Contract Addresses:`);
|
|
9
|
-
log(` Class
|
|
9
|
+
log(` Class Registry: ${info.protocolContractAddresses.classRegistry.toString()}`);
|
|
10
10
|
log(` Fee Juice: ${info.protocolContractAddresses.feeJuice.toString()}`);
|
|
11
|
-
log(` Instance Deployer: ${info.protocolContractAddresses.
|
|
11
|
+
log(` Instance Deployer: ${info.protocolContractAddresses.instanceRegistry.toString()}`);
|
|
12
12
|
log(` Multi Call Entrypoint: ${info.protocolContractAddresses.multiCallEntrypoint.toString()}`);
|
|
13
13
|
}
|
package/src/utils/inspect.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { LogFn } from '@aztec/foundation/log';
|
|
|
3
3
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
4
4
|
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
5
5
|
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
6
|
-
import {
|
|
6
|
+
import type { ExtendedNote } from '@aztec/stdlib/note';
|
|
7
7
|
import type { TxHash } from '@aztec/stdlib/tx';
|
|
8
8
|
|
|
9
9
|
export async function inspectBlock(pxe: PXE, blockNumber: number, log: LogFn, opts: { showTxs?: boolean } = {}) {
|
|
@@ -40,11 +40,7 @@ export async function inspectTx(
|
|
|
40
40
|
log: LogFn,
|
|
41
41
|
opts: { includeBlockInfo?: boolean; artifactMap?: ArtifactMap } = {},
|
|
42
42
|
) {
|
|
43
|
-
const [receipt, effectsInBlock
|
|
44
|
-
pxe.getTxReceipt(txHash),
|
|
45
|
-
pxe.getTxEffect(txHash),
|
|
46
|
-
pxe.getNotes({ txHash, status: NoteStatus.ACTIVE_OR_NULLIFIED }),
|
|
47
|
-
]);
|
|
43
|
+
const [receipt, effectsInBlock] = await Promise.all([pxe.getTxReceipt(txHash), pxe.getTxEffect(txHash)]);
|
|
48
44
|
// Base tx data
|
|
49
45
|
log(`Tx ${txHash.toString()}`);
|
|
50
46
|
log(` Status: ${receipt.status} ${effectsInBlock ? `(${effectsInBlock.data.revertCode.getDescription()})` : ''}`);
|
|
@@ -88,12 +84,9 @@ export async function inspectTx(
|
|
|
88
84
|
const notes = effects.noteHashes;
|
|
89
85
|
if (notes.length > 0) {
|
|
90
86
|
log(' Created notes:');
|
|
91
|
-
log(` Total: ${notes.length}
|
|
92
|
-
|
|
93
|
-
log(
|
|
94
|
-
for (const note of getNotes) {
|
|
95
|
-
inspectNote(note, artifactMap, log);
|
|
96
|
-
}
|
|
87
|
+
log(` Total: ${notes.length}`);
|
|
88
|
+
for (const note of notes) {
|
|
89
|
+
log(` Note hash: ${note.toShortString()}`);
|
|
97
90
|
}
|
|
98
91
|
}
|
|
99
92
|
|
|
@@ -103,8 +96,10 @@ export async function inspectTx(
|
|
|
103
96
|
if (nullifierCount > 0) {
|
|
104
97
|
log(' Nullifiers:');
|
|
105
98
|
for (const nullifier of effects.nullifiers) {
|
|
106
|
-
const [note] = await pxe.getNotes({ siloedNullifier: nullifier });
|
|
107
99
|
const deployed = deployNullifiers[nullifier.toString()];
|
|
100
|
+
const note = deployed
|
|
101
|
+
? (await pxe.getNotes({ siloedNullifier: nullifier, contractAddress: deployed }))[0]
|
|
102
|
+
: undefined;
|
|
108
103
|
const initialized = initNullifiers[nullifier.toString()];
|
|
109
104
|
const registered = classNullifiers[nullifier.toString()];
|
|
110
105
|
if (nullifier.toBuffer().equals(txHash.toBuffer())) {
|
|
@@ -160,8 +155,8 @@ function toFriendlyAddress(address: AztecAddress, artifactMap: ArtifactMap) {
|
|
|
160
155
|
|
|
161
156
|
async function getKnownNullifiers(pxe: PXE, artifactMap: ArtifactMap) {
|
|
162
157
|
const knownContracts = await pxe.getContracts();
|
|
163
|
-
const deployerAddress = ProtocolContractAddress.
|
|
164
|
-
const
|
|
158
|
+
const deployerAddress = ProtocolContractAddress.ContractInstanceRegistry;
|
|
159
|
+
const classRegistryAddress = ProtocolContractAddress.ContractClassRegistry;
|
|
165
160
|
const initNullifiers: Record<string, AztecAddress> = {};
|
|
166
161
|
const deployNullifiers: Record<string, AztecAddress> = {};
|
|
167
162
|
const classNullifiers: Record<string, string> = {};
|
|
@@ -170,7 +165,7 @@ async function getKnownNullifiers(pxe: PXE, artifactMap: ArtifactMap) {
|
|
|
170
165
|
deployNullifiers[(await siloNullifier(deployerAddress, contract.toField())).toString()] = contract;
|
|
171
166
|
}
|
|
172
167
|
for (const artifact of Object.values(artifactMap)) {
|
|
173
|
-
classNullifiers[(await siloNullifier(
|
|
168
|
+
classNullifiers[(await siloNullifier(classRegistryAddress, artifact.classId)).toString()] =
|
|
174
169
|
`${artifact.name}Class<${artifact.classId}>`;
|
|
175
170
|
}
|
|
176
171
|
return { initNullifiers, deployNullifiers, classNullifiers };
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
SignerlessWallet,
|
|
6
6
|
SponsoredFeePaymentMethod,
|
|
7
7
|
type WaitForProvenOpts,
|
|
8
|
-
|
|
8
|
+
getContractInstanceFromInstantiationParams,
|
|
9
9
|
waitForProven,
|
|
10
10
|
} from '@aztec/aztec.js';
|
|
11
11
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
@@ -21,7 +21,7 @@ async function getSponsoredFPCContract() {
|
|
|
21
21
|
|
|
22
22
|
export async function getSponsoredFPCAddress() {
|
|
23
23
|
const SponsoredFPCContract = await getSponsoredFPCContract();
|
|
24
|
-
const sponsoredFPCInstance = await
|
|
24
|
+
const sponsoredFPCInstance = await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
|
|
25
25
|
salt: new Fr(SPONSORED_FPC_SALT),
|
|
26
26
|
});
|
|
27
27
|
return sponsoredFPCInstance.address;
|