@aztec/cli 0.79.0 → 0.81.0
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/contracts/inspect_contract.d.ts.map +1 -1
- package/dest/cmds/contracts/inspect_contract.js +9 -5
- package/dest/cmds/l1/governance_utils.js +1 -1
- package/dest/cmds/misc/generate_bootnode_enr.d.ts +1 -1
- package/dest/cmds/misc/generate_bootnode_enr.d.ts.map +1 -1
- package/dest/cmds/misc/generate_bootnode_enr.js +2 -2
- package/dest/cmds/misc/index.d.ts.map +1 -1
- package/dest/cmds/misc/index.js +2 -2
- package/dest/cmds/misc/update/github.d.ts +0 -1
- package/dest/cmds/misc/update/github.d.ts.map +1 -1
- package/dest/cmds/misc/update/github.js +0 -1
- package/dest/cmds/misc/update.d.ts.map +1 -1
- package/dest/cmds/misc/update.js +1 -2
- package/dest/utils/aztec.d.ts +2 -2
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +4 -5
- package/dest/utils/github.d.ts +0 -1
- package/dest/utils/github.d.ts.map +1 -1
- package/dest/utils/github.js +0 -1
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +2 -3
- package/package.json +20 -20
- package/src/cmds/contracts/inspect_contract.ts +16 -6
- package/src/cmds/l1/governance_utils.ts +1 -1
- package/src/cmds/misc/generate_bootnode_enr.ts +3 -2
- package/src/cmds/misc/index.ts +4 -3
- package/src/cmds/misc/update/github.ts +0 -1
- package/src/cmds/misc/update.ts +1 -6
- package/src/utils/aztec.ts +10 -5
- package/src/utils/github.ts +0 -1
- package/src/utils/inspect.ts +2 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/contracts/inspect_contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"inspect_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/contracts/inspect_contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAY3D,wBAAsB,eAAe,CAAC,oBAAoB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBA6BlG"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { sha256 } from '@aztec/foundation/crypto';
|
|
2
|
-
import { FunctionSelector, decodeFunctionSignature, decodeFunctionSignatureWithParameterNames } from '@aztec/stdlib/abi';
|
|
2
|
+
import { FunctionSelector, decodeFunctionSignature, decodeFunctionSignatureWithParameterNames, retainBytecode } from '@aztec/stdlib/abi';
|
|
3
3
|
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
4
4
|
import { getContractArtifact } from '../../utils/aztec.js';
|
|
5
5
|
export async function inspectContract(contractArtifactFile, debugLogger, log) {
|
|
6
6
|
const contractArtifact = await getContractArtifact(contractArtifactFile, log);
|
|
7
|
-
const contractFns = contractArtifact.functions;
|
|
7
|
+
const contractFns = contractArtifact.functions.concat(contractArtifact.nonDispatchPublicFunctions.map((f)=>f));
|
|
8
8
|
if (contractFns.length === 0) {
|
|
9
9
|
log(`No functions found for contract ${contractArtifact.name}`);
|
|
10
10
|
}
|
|
@@ -31,7 +31,11 @@ async function logFunction(fn, log) {
|
|
|
31
31
|
const signatureWithParameterNames = decodeFunctionSignatureWithParameterNames(fn.name, fn.parameters);
|
|
32
32
|
const signature = decodeFunctionSignature(fn.name, fn.parameters);
|
|
33
33
|
const selector = await FunctionSelector.fromSignature(signature);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
if (retainBytecode(fn)) {
|
|
35
|
+
const bytecodeSize = fn.bytecode.length;
|
|
36
|
+
const bytecodeHash = sha256(fn.bytecode).toString('hex');
|
|
37
|
+
log(`${fn.functionType} ${signatureWithParameterNames} \n\tfunction signature: ${signature}\n\tselector: ${selector}\n\tbytecode: ${bytecodeSize} bytes (sha256 ${bytecodeHash})`);
|
|
38
|
+
} else {
|
|
39
|
+
log(`${fn.functionType} ${signatureWithParameterNames} \n\tfunction signature: ${signature}\n\tselector: ${selector}`);
|
|
40
|
+
}
|
|
37
41
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
-
export declare function generateEncodedBootnodeENR(privateKey: string,
|
|
2
|
+
export declare function generateEncodedBootnodeENR(privateKey: string, p2pIp: string, p2pPort: number, l1ChainId: number, log: LogFn): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=generate_bootnode_enr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate_bootnode_enr.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/generate_bootnode_enr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,MAAM,EAClB,
|
|
1
|
+
{"version":3,"file":"generate_bootnode_enr.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/generate_bootnode_enr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,KAAK,iBAIX"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createBootnodeENRandPeerId } from '@aztec/p2p/enr';
|
|
2
|
-
export async function generateEncodedBootnodeENR(privateKey,
|
|
3
|
-
const { enr } = await createBootnodeENRandPeerId(privateKey,
|
|
2
|
+
export async function generateEncodedBootnodeENR(privateKey, p2pIp, p2pPort, l1ChainId, log) {
|
|
3
|
+
const { enr } = await createBootnodeENRandPeerId(privateKey, p2pIp, p2pPort, l1ChainId);
|
|
4
4
|
log(`ENR: ${enr.encodeTxt()}`);
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,WAqF1D"}
|
package/dest/cmds/misc/index.js
CHANGED
|
@@ -16,9 +16,9 @@ export function injectCommands(program, log) {
|
|
|
16
16
|
const { generateP2PPrivateKey } = await import('./generate_p2p_private_key.js');
|
|
17
17
|
await generateP2PPrivateKey(log);
|
|
18
18
|
});
|
|
19
|
-
program.command('generate-bootnode-enr').summary('Generates the encoded ENR record for a bootnode.').description('Generates the encoded ENR record for a bootnode.').argument('<privateKey>', 'The peer id private key of the bootnode').argument('<
|
|
19
|
+
program.command('generate-bootnode-enr').summary('Generates the encoded ENR record for a bootnode.').description('Generates the encoded ENR record for a bootnode.').argument('<privateKey>', 'The peer id private key of the bootnode').argument('<p2pIp>', 'The bootnode P2P IP address').argument('<p2pPort>', 'The bootnode P2P port').addOption(l1ChainIdOption).action(async (privateKey, p2pIp, p2pPort, options)=>{
|
|
20
20
|
const { generateEncodedBootnodeENR } = await import('./generate_bootnode_enr.js');
|
|
21
|
-
await generateEncodedBootnodeENR(privateKey,
|
|
21
|
+
await generateEncodedBootnodeENR(privateKey, p2pIp, p2pPort, options.l1ChainId, log);
|
|
22
22
|
});
|
|
23
23
|
program.command('decode-enr').summary('Decodes an ENR record').description('Decodes and ENR record').argument('<enr>', 'The encoded ENR string').action(async (enr)=>{
|
|
24
24
|
await printENR(enr, log);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../src/cmds/misc/update/github.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAC5C,eAAO,MAAM,WAAW,mBAAmB,CAAC
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../src/cmds/misc/update/github.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAC5C,eAAO,MAAM,WAAW,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/update.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/update.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAYnD,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EAAE,EACnB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,KAAK,GACT,OAAO,CAAC,IAAI,CAAC,CA2Cf"}
|
package/dest/cmds/misc/update.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable jsdoc/require-jsdoc */ import { relative, resolve } from 'path';
|
|
2
2
|
import { parse } from 'semver';
|
|
3
|
-
import { GITHUB_TAG_PREFIX } from './update/github.js';
|
|
4
3
|
import { updateAztecNr } from './update/noir.js';
|
|
5
4
|
import { getNewestVersion, updateAztecDeps, updateLockfile } from './update/npm.js';
|
|
6
5
|
const AZTECJS_PACKAGE = '@aztec/aztec.js';
|
|
@@ -26,7 +25,7 @@ export async function updateProject(projectPath, contracts, aztecVersion, log) {
|
|
|
26
25
|
}
|
|
27
26
|
for (const contract of contracts){
|
|
28
27
|
try {
|
|
29
|
-
projectDependencyChanges.push(await updateAztecNr(resolve(process.cwd(), projectPath, contract),
|
|
28
|
+
projectDependencyChanges.push(await updateAztecNr(resolve(process.cwd(), projectPath, contract), `v${targetAztecVersion.version}`, log));
|
|
30
29
|
} catch (err) {
|
|
31
30
|
if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {
|
|
32
31
|
log(`No Nargo.toml found in ${relative(process.cwd(), contract)}. Skipping...`);
|
package/dest/utils/aztec.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EthAddress, PXE } from '@aztec/aztec.js';
|
|
2
|
-
import { type ContractArtifact, type
|
|
2
|
+
import { type ContractArtifact, type FunctionAbi } from '@aztec/aztec.js/abi';
|
|
3
3
|
import type { DeployL1ContractsReturnType, L1ContractsConfig, RollupContract } from '@aztec/ethereum';
|
|
4
4
|
import type { Fr } from '@aztec/foundation/fields';
|
|
5
5
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
@@ -10,7 +10,7 @@ import type { NoirPackageConfig } from '@aztec/foundation/noir';
|
|
|
10
10
|
* @param fnName - Function name to be found.
|
|
11
11
|
* @returns The function's ABI.
|
|
12
12
|
*/
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function getFunctionAbi(artifact: ContractArtifact, fnName: string): FunctionAbi;
|
|
14
14
|
/**
|
|
15
15
|
* Function to execute the 'deployRollupContracts' command.
|
|
16
16
|
* @param rpcUrls - The RPC URL of the ethereum node.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec.d.ts","sourceRoot":"","sources":["../../src/utils/aztec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"aztec.d.ts","sourceRoot":"","sources":["../../src/utils/aztec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAIjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAShE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAMtF;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,iBAAiB,EAAE,UAAU,EAAE,EAC/B,kBAAkB,EAAE,EAAE,EACtB,gBAAgB,EAAE,EAAE,EACpB,0BAA0B,EAAE,OAAO,EACnC,MAAM,EAAE,iBAAiB,EACzB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,2BAA2B,CAAC,CA6BtC;AAED,wBAAsB,wBAAwB,CAC5C,eAAe,EAAE,UAAU,EAC3B,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,iBAAiB,EAAE,UAAU,EAAE,EAC/B,kBAAkB,EAAE,EAAE,EACtB,gBAAgB,EAAE,EAAE,EACpB,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,cAAc,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,CAAC,CA6BjE;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAKjE;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,6BA4BpE;AAED;;;;;;;GAOG;AACH,wBAAsB,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK;;;;GAO3G;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAS,MAAM,WAK1C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAUtE;AAKD;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,iBAyB9E"}
|
package/dest/utils/aztec.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { loadContractArtifact } from '@aztec/aztec.js/abi';
|
|
1
|
+
import { FunctionType, getAllFunctionAbis, loadContractArtifact } from '@aztec/aztec.js/abi';
|
|
2
2
|
import { ProtocolContractAddress, protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
3
|
-
import { FunctionType } from '@aztec/stdlib/abi';
|
|
4
3
|
import TOML from '@iarna/toml';
|
|
5
4
|
import { readFile } from 'fs/promises';
|
|
6
5
|
import { gtr, ltr, satisfies, valid } from 'semver';
|
|
@@ -10,8 +9,8 @@ import { encodeArgs } from './encoding.js';
|
|
|
10
9
|
* @param artifact - Contract's build artifact in JSON format.
|
|
11
10
|
* @param fnName - Function name to be found.
|
|
12
11
|
* @returns The function's ABI.
|
|
13
|
-
*/ export function
|
|
14
|
-
const fn = artifact.
|
|
12
|
+
*/ export function getFunctionAbi(artifact, fnName) {
|
|
13
|
+
const fn = getAllFunctionAbis(artifact).find(({ name })=>name === fnName);
|
|
15
14
|
if (!fn) {
|
|
16
15
|
throw Error(`Function ${fnName} not found in contract ABI.`);
|
|
17
16
|
}
|
|
@@ -116,7 +115,7 @@ export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId
|
|
|
116
115
|
* @returns Formatted contract address, function arguments and caller's aztec address.
|
|
117
116
|
*/ export async function prepTx(contractFile, functionName, _functionArgs, log) {
|
|
118
117
|
const contractArtifact = await getContractArtifact(contractFile, log);
|
|
119
|
-
const functionArtifact =
|
|
118
|
+
const functionArtifact = getFunctionAbi(contractArtifact, functionName);
|
|
120
119
|
const functionArgs = encodeArgs(_functionArgs, functionArtifact.parameters);
|
|
121
120
|
const isPrivate = functionArtifact.functionType === FunctionType.PRIVATE;
|
|
122
121
|
return {
|
package/dest/utils/github.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/utils/github.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAC5C,eAAO,MAAM,WAAW,mBAAmB,CAAC
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/utils/github.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAC5C,eAAO,MAAM,WAAW,mBAAmB,CAAC"}
|
package/dest/utils/github.js
CHANGED
|
@@ -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,iBAmGrE;
|
|
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,iBAmGrE;AAwCD,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
|
@@ -120,9 +120,8 @@ export async function inspectTx(pxe, txHash, log, opts = {}) {
|
|
|
120
120
|
function inspectNote(note, artifactMap, log, text = 'Note') {
|
|
121
121
|
const artifact = artifactMap[note.contractAddress.toString()];
|
|
122
122
|
const contract = artifact?.name ?? note.contractAddress.toString();
|
|
123
|
-
|
|
124
|
-
log(`
|
|
125
|
-
log(` Owner: ${toFriendlyAddress(note.owner, artifactMap)}`);
|
|
123
|
+
log(` ${text} at ${contract}`);
|
|
124
|
+
log(` Recipient: ${toFriendlyAddress(note.recipient, artifactMap)}`);
|
|
126
125
|
for (const field of note.note.items){
|
|
127
126
|
log(` ${field.toString()}`);
|
|
128
127
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.81.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./contracts": "./dest/cmds/contracts/index.js",
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/archiver": "0.
|
|
71
|
-
"@aztec/aztec.js": "0.
|
|
72
|
-
"@aztec/constants": "0.
|
|
73
|
-
"@aztec/foundation": "0.
|
|
74
|
-
"@aztec/l1-artifacts": "0.
|
|
75
|
-
"@aztec/p2p": "0.
|
|
76
|
-
"@aztec/stdlib": "0.
|
|
77
|
-
"@aztec/world-state": "0.
|
|
70
|
+
"@aztec/archiver": "0.81.0",
|
|
71
|
+
"@aztec/aztec.js": "0.81.0",
|
|
72
|
+
"@aztec/constants": "0.81.0",
|
|
73
|
+
"@aztec/foundation": "0.81.0",
|
|
74
|
+
"@aztec/l1-artifacts": "0.81.0",
|
|
75
|
+
"@aztec/p2p": "0.81.0",
|
|
76
|
+
"@aztec/stdlib": "0.81.0",
|
|
77
|
+
"@aztec/world-state": "0.81.0",
|
|
78
78
|
"@iarna/toml": "^2.2.5",
|
|
79
79
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
80
80
|
"commander": "^12.1.0",
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
"viem": "2.23.7"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@aztec/accounts": "0.
|
|
90
|
-
"@aztec/ethereum": "0.
|
|
91
|
-
"@aztec/protocol-contracts": "0.
|
|
89
|
+
"@aztec/accounts": "0.81.0",
|
|
90
|
+
"@aztec/ethereum": "0.81.0",
|
|
91
|
+
"@aztec/protocol-contracts": "0.81.0",
|
|
92
92
|
"@jest/globals": "^29.5.0",
|
|
93
93
|
"@types/jest": "^29.5.0",
|
|
94
94
|
"@types/lodash.chunk": "^4.2.9",
|
|
@@ -104,14 +104,14 @@
|
|
|
104
104
|
"typescript": "^5.0.4"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
|
-
"@aztec/accounts": "0.
|
|
108
|
-
"@aztec/bb-prover": "0.
|
|
109
|
-
"@aztec/ethereum": "0.
|
|
110
|
-
"@aztec/l1-artifacts": "0.
|
|
111
|
-
"@aztec/noir-contracts.js": "0.
|
|
112
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
113
|
-
"@aztec/protocol-contracts": "0.
|
|
114
|
-
"@aztec/stdlib": "0.
|
|
107
|
+
"@aztec/accounts": "0.81.0",
|
|
108
|
+
"@aztec/bb-prover": "0.81.0",
|
|
109
|
+
"@aztec/ethereum": "0.81.0",
|
|
110
|
+
"@aztec/l1-artifacts": "0.81.0",
|
|
111
|
+
"@aztec/noir-contracts.js": "0.81.0",
|
|
112
|
+
"@aztec/noir-protocol-circuits-types": "0.81.0",
|
|
113
|
+
"@aztec/protocol-contracts": "0.81.0",
|
|
114
|
+
"@aztec/stdlib": "0.81.0"
|
|
115
115
|
},
|
|
116
116
|
"files": [
|
|
117
117
|
"dest",
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
FunctionSelector,
|
|
6
6
|
decodeFunctionSignature,
|
|
7
7
|
decodeFunctionSignatureWithParameterNames,
|
|
8
|
+
retainBytecode,
|
|
8
9
|
} from '@aztec/stdlib/abi';
|
|
9
10
|
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
10
11
|
|
|
@@ -12,7 +13,9 @@ import { getContractArtifact } from '../../utils/aztec.js';
|
|
|
12
13
|
|
|
13
14
|
export async function inspectContract(contractArtifactFile: string, debugLogger: Logger, log: LogFn) {
|
|
14
15
|
const contractArtifact = await getContractArtifact(contractArtifactFile, log);
|
|
15
|
-
const contractFns = contractArtifact.functions
|
|
16
|
+
const contractFns = contractArtifact.functions.concat(
|
|
17
|
+
contractArtifact.nonDispatchPublicFunctions.map(f => f as FunctionArtifact),
|
|
18
|
+
);
|
|
16
19
|
if (contractFns.length === 0) {
|
|
17
20
|
log(`No functions found for contract ${contractArtifact.name}`);
|
|
18
21
|
}
|
|
@@ -43,9 +46,16 @@ async function logFunction(fn: FunctionArtifact, log: LogFn) {
|
|
|
43
46
|
const signatureWithParameterNames = decodeFunctionSignatureWithParameterNames(fn.name, fn.parameters);
|
|
44
47
|
const signature = decodeFunctionSignature(fn.name, fn.parameters);
|
|
45
48
|
const selector = await FunctionSelector.fromSignature(signature);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
|
|
50
|
+
if (retainBytecode(fn)) {
|
|
51
|
+
const bytecodeSize = fn.bytecode.length;
|
|
52
|
+
const bytecodeHash = sha256(fn.bytecode).toString('hex');
|
|
53
|
+
log(
|
|
54
|
+
`${fn.functionType} ${signatureWithParameterNames} \n\tfunction signature: ${signature}\n\tselector: ${selector}\n\tbytecode: ${bytecodeSize} bytes (sha256 ${bytecodeHash})`,
|
|
55
|
+
);
|
|
56
|
+
} else {
|
|
57
|
+
log(
|
|
58
|
+
`${fn.functionType} ${signatureWithParameterNames} \n\tfunction signature: ${signature}\n\tselector: ${selector}`,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
51
61
|
}
|
|
@@ -95,7 +95,7 @@ export async function proposeWithLock({
|
|
|
95
95
|
withdrawAddress: clients.walletClient.account.address,
|
|
96
96
|
});
|
|
97
97
|
if (json) {
|
|
98
|
-
log(JSON.stringify({ proposalId }, null, 2));
|
|
98
|
+
log(JSON.stringify({ proposalId: Number(proposalId) }, null, 2));
|
|
99
99
|
} else {
|
|
100
100
|
log(`Proposed with lock`);
|
|
101
101
|
log(`Proposal ID: ${proposalId}`);
|
|
@@ -3,10 +3,11 @@ import { createBootnodeENRandPeerId } from '@aztec/p2p/enr';
|
|
|
3
3
|
|
|
4
4
|
export async function generateEncodedBootnodeENR(
|
|
5
5
|
privateKey: string,
|
|
6
|
-
|
|
6
|
+
p2pIp: string,
|
|
7
|
+
p2pPort: number,
|
|
7
8
|
l1ChainId: number,
|
|
8
9
|
log: LogFn,
|
|
9
10
|
) {
|
|
10
|
-
const { enr } = await createBootnodeENRandPeerId(privateKey,
|
|
11
|
+
const { enr } = await createBootnodeENRandPeerId(privateKey, p2pIp, p2pPort, l1ChainId);
|
|
11
12
|
log(`ENR: ${enr.encodeTxt()}`);
|
|
12
13
|
}
|
package/src/cmds/misc/index.ts
CHANGED
|
@@ -35,11 +35,12 @@ export function injectCommands(program: Command, log: LogFn) {
|
|
|
35
35
|
.summary('Generates the encoded ENR record for a bootnode.')
|
|
36
36
|
.description('Generates the encoded ENR record for a bootnode.')
|
|
37
37
|
.argument('<privateKey>', 'The peer id private key of the bootnode')
|
|
38
|
-
.argument('<
|
|
38
|
+
.argument('<p2pIp>', 'The bootnode P2P IP address')
|
|
39
|
+
.argument('<p2pPort>', 'The bootnode P2P port')
|
|
39
40
|
.addOption(l1ChainIdOption)
|
|
40
|
-
.action(async (privateKey: string,
|
|
41
|
+
.action(async (privateKey: string, p2pIp: string, p2pPort: number, options) => {
|
|
41
42
|
const { generateEncodedBootnodeENR } = await import('./generate_bootnode_enr.js');
|
|
42
|
-
await generateEncodedBootnodeENR(privateKey,
|
|
43
|
+
await generateEncodedBootnodeENR(privateKey, p2pIp, p2pPort, options.l1ChainId, log);
|
|
43
44
|
});
|
|
44
45
|
|
|
45
46
|
program
|
package/src/cmds/misc/update.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { relative, resolve } from 'path';
|
|
|
5
5
|
import { parse } from 'semver';
|
|
6
6
|
|
|
7
7
|
import type { DependencyChanges } from './update/common.js';
|
|
8
|
-
import { GITHUB_TAG_PREFIX } from './update/github.js';
|
|
9
8
|
import { updateAztecNr } from './update/noir.js';
|
|
10
9
|
import { getNewestVersion, updateAztecDeps, updateLockfile } from './update/npm.js';
|
|
11
10
|
|
|
@@ -44,11 +43,7 @@ export async function updateProject(
|
|
|
44
43
|
for (const contract of contracts) {
|
|
45
44
|
try {
|
|
46
45
|
projectDependencyChanges.push(
|
|
47
|
-
await updateAztecNr(
|
|
48
|
-
resolve(process.cwd(), projectPath, contract),
|
|
49
|
-
`${GITHUB_TAG_PREFIX}-v${targetAztecVersion.version}`,
|
|
50
|
-
log,
|
|
51
|
-
),
|
|
46
|
+
await updateAztecNr(resolve(process.cwd(), projectPath, contract), `v${targetAztecVersion.version}`, log),
|
|
52
47
|
);
|
|
53
48
|
} catch (err) {
|
|
54
49
|
if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {
|
package/src/utils/aztec.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { EthAddress, PXE } from '@aztec/aztec.js';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
type ContractArtifact,
|
|
4
|
+
type FunctionAbi,
|
|
5
|
+
FunctionType,
|
|
6
|
+
getAllFunctionAbis,
|
|
7
|
+
loadContractArtifact,
|
|
8
|
+
} from '@aztec/aztec.js/abi';
|
|
3
9
|
import type { DeployL1ContractsReturnType, L1ContractsConfig, RollupContract } from '@aztec/ethereum';
|
|
4
10
|
import type { Fr } from '@aztec/foundation/fields';
|
|
5
11
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
6
12
|
import type { NoirPackageConfig } from '@aztec/foundation/noir';
|
|
7
13
|
import { ProtocolContractAddress, protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
8
|
-
import { FunctionType } from '@aztec/stdlib/abi';
|
|
9
14
|
|
|
10
15
|
import TOML from '@iarna/toml';
|
|
11
16
|
import { readFile } from 'fs/promises';
|
|
@@ -19,8 +24,8 @@ import { encodeArgs } from './encoding.js';
|
|
|
19
24
|
* @param fnName - Function name to be found.
|
|
20
25
|
* @returns The function's ABI.
|
|
21
26
|
*/
|
|
22
|
-
export function
|
|
23
|
-
const fn = artifact.
|
|
27
|
+
export function getFunctionAbi(artifact: ContractArtifact, fnName: string): FunctionAbi {
|
|
28
|
+
const fn = getAllFunctionAbis(artifact).find(({ name }) => name === fnName);
|
|
24
29
|
if (!fn) {
|
|
25
30
|
throw Error(`Function ${fnName} not found in contract ABI.`);
|
|
26
31
|
}
|
|
@@ -178,7 +183,7 @@ export async function getContractArtifact(fileDir: string, log: LogFn) {
|
|
|
178
183
|
*/
|
|
179
184
|
export async function prepTx(contractFile: string, functionName: string, _functionArgs: string[], log: LogFn) {
|
|
180
185
|
const contractArtifact = await getContractArtifact(contractFile, log);
|
|
181
|
-
const functionArtifact =
|
|
186
|
+
const functionArtifact = getFunctionAbi(contractArtifact, functionName);
|
|
182
187
|
const functionArgs = encodeArgs(_functionArgs, functionArtifact.parameters);
|
|
183
188
|
const isPrivate = functionArtifact.functionType === FunctionType.PRIVATE;
|
|
184
189
|
|
package/src/utils/github.ts
CHANGED
package/src/utils/inspect.ts
CHANGED
|
@@ -142,9 +142,8 @@ export async function inspectTx(
|
|
|
142
142
|
function inspectNote(note: ExtendedNote, artifactMap: ArtifactMap, log: LogFn, text = 'Note') {
|
|
143
143
|
const artifact = artifactMap[note.contractAddress.toString()];
|
|
144
144
|
const contract = artifact?.name ?? note.contractAddress.toString();
|
|
145
|
-
|
|
146
|
-
log(`
|
|
147
|
-
log(` Owner: ${toFriendlyAddress(note.owner, artifactMap)}`);
|
|
145
|
+
log(` ${text} at ${contract}`);
|
|
146
|
+
log(` Recipient: ${toFriendlyAddress(note.recipient, artifactMap)}`);
|
|
148
147
|
for (const field of note.note.items) {
|
|
149
148
|
log(` ${field.toString()}`);
|
|
150
149
|
}
|