@aztec/cli 0.78.1 → 0.80.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/devnet/bootstrap_network.js +2 -2
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +2 -1
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
- package/dest/cmds/l1/assume_proven_through.js +2 -1
- package/dest/cmds/l1/governance_utils.js +1 -1
- 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 +6 -7
- 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/package.json +21 -21
- package/src/cmds/contracts/inspect_contract.ts +16 -6
- package/src/cmds/devnet/bootstrap_network.ts +2 -2
- package/src/cmds/l1/advance_epoch.ts +2 -1
- package/src/cmds/l1/assume_proven_through.ts +2 -1
- package/src/cmds/l1/governance_utils.ts +1 -1
- package/src/cmds/misc/update/github.ts +0 -1
- package/src/cmds/misc/update.ts +1 -6
- package/src/utils/aztec.ts +12 -7
- package/src/utils/github.ts +0 -1
|
@@ -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
|
}
|
|
@@ -104,8 +104,8 @@ export async function bootstrapNetwork(pxeUrl, l1Urls, l1ChainId, l1PrivateKey,
|
|
|
104
104
|
universalDeploy: true
|
|
105
105
|
}).deployed(waitOpts);
|
|
106
106
|
await new BatchCall(wallet, [
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
devCoin.methods.set_minter(bridge.address, true),
|
|
108
|
+
devCoin.methods.set_admin(bridge.address)
|
|
109
109
|
]).send().wait(waitOpts);
|
|
110
110
|
return {
|
|
111
111
|
token: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advance_epoch.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/advance_epoch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"advance_epoch.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/advance_epoch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAQjF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createPXEClient, makeFetch } from '@aztec/aztec.js';
|
|
2
|
+
import { CheatCodes } from '@aztec/aztec.js/testing';
|
|
2
3
|
export async function advanceEpoch(l1RpcUrls, rpcUrl, log) {
|
|
3
4
|
const pxe = createPXEClient(rpcUrl, {}, makeFetch([], true));
|
|
4
5
|
const rollupAddress = await pxe.getNodeInfo().then((i)=>i.l1ContractAddresses.rollupAddress);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assume_proven_through.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/assume_proven_through.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assume_proven_through.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/assume_proven_through.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,wBAAsB,mBAAmB,CACvC,mBAAmB,EAAE,MAAM,GAAG,SAAS,EACvC,SAAS,EAAE,MAAM,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,iBAWX"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createPXEClient, makeFetch } from '@aztec/aztec.js';
|
|
2
|
+
import { EthCheatCodes, RollupCheatCodes } from '@aztec/aztec.js/testing';
|
|
2
3
|
export async function assumeProvenThrough(blockNumberOrLatest, l1RpcUrls, rpcUrl, log) {
|
|
3
4
|
const pxe = createPXEClient(rpcUrl, {}, makeFetch([], true));
|
|
4
5
|
const rollupAddress = await pxe.getNodeInfo().then((i)=>i.l1ContractAddresses.rollupAddress);
|
|
@@ -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
|
}
|
|
@@ -44,7 +43,7 @@ import { encodeArgs } from './encoding.js';
|
|
|
44
43
|
}, config);
|
|
45
44
|
}
|
|
46
45
|
export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, genesisBlockHash, config, logger) {
|
|
47
|
-
const { createEthereumChain,
|
|
46
|
+
const { createEthereumChain, deployRollupForUpgrade, createL1Clients } = await import('@aztec/ethereum');
|
|
48
47
|
const { mnemonicToAccount, privateKeyToAccount } = await import('viem/accounts');
|
|
49
48
|
const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
|
|
50
49
|
const account = !privateKey ? mnemonicToAccount(mnemonic, {
|
|
@@ -52,7 +51,7 @@ export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId
|
|
|
52
51
|
}) : privateKeyToAccount(`${privateKey.startsWith('0x') ? '' : '0x'}${privateKey}`);
|
|
53
52
|
const chain = createEthereumChain(rpcUrls, chainId);
|
|
54
53
|
const clients = createL1Clients(rpcUrls, account, chain.chainInfo, mnemonicIndex);
|
|
55
|
-
const { payloadAddress, rollup } = await
|
|
54
|
+
const { payloadAddress, rollup } = await deployRollupForUpgrade(clients, {
|
|
56
55
|
salt,
|
|
57
56
|
vkTreeRoot: getVKTreeRoot(),
|
|
58
57
|
protocolContractTreeRoot,
|
|
@@ -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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.80.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.80.0",
|
|
71
|
+
"@aztec/aztec.js": "0.80.0",
|
|
72
|
+
"@aztec/constants": "0.80.0",
|
|
73
|
+
"@aztec/foundation": "0.80.0",
|
|
74
|
+
"@aztec/l1-artifacts": "0.80.0",
|
|
75
|
+
"@aztec/p2p": "0.80.0",
|
|
76
|
+
"@aztec/stdlib": "0.80.0",
|
|
77
|
+
"@aztec/world-state": "0.80.0",
|
|
78
78
|
"@iarna/toml": "^2.2.5",
|
|
79
79
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
80
80
|
"commander": "^12.1.0",
|
|
@@ -83,12 +83,12 @@
|
|
|
83
83
|
"semver": "^7.5.4",
|
|
84
84
|
"source-map-support": "^0.5.21",
|
|
85
85
|
"tslib": "^2.4.0",
|
|
86
|
-
"viem": "2.
|
|
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.80.0",
|
|
90
|
+
"@aztec/ethereum": "0.80.0",
|
|
91
|
+
"@aztec/protocol-contracts": "0.80.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.80.0",
|
|
108
|
+
"@aztec/bb-prover": "0.80.0",
|
|
109
|
+
"@aztec/ethereum": "0.80.0",
|
|
110
|
+
"@aztec/l1-artifacts": "0.80.0",
|
|
111
|
+
"@aztec/noir-contracts.js": "0.80.0",
|
|
112
|
+
"@aztec/noir-protocol-circuits-types": "0.80.0",
|
|
113
|
+
"@aztec/protocol-contracts": "0.80.0",
|
|
114
|
+
"@aztec/stdlib": "0.80.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
|
}
|
|
@@ -179,8 +179,8 @@ async function deployToken(
|
|
|
179
179
|
.deployed(waitOpts);
|
|
180
180
|
|
|
181
181
|
await new BatchCall(wallet, [
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
devCoin.methods.set_minter(bridge.address, true),
|
|
183
|
+
devCoin.methods.set_admin(bridge.address),
|
|
184
184
|
])
|
|
185
185
|
.send()
|
|
186
186
|
.wait(waitOpts);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createPXEClient, makeFetch } from '@aztec/aztec.js';
|
|
2
|
+
import { CheatCodes } from '@aztec/aztec.js/testing';
|
|
2
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
4
|
|
|
4
5
|
export async function advanceEpoch(l1RpcUrls: string[], rpcUrl: string, log: LogFn) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createPXEClient, makeFetch } from '@aztec/aztec.js';
|
|
2
|
+
import { EthCheatCodes, RollupCheatCodes } from '@aztec/aztec.js/testing';
|
|
2
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
4
|
|
|
4
5
|
export async function assumeProvenThrough(
|
|
@@ -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}`);
|
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
|
}
|
|
@@ -92,7 +97,7 @@ export async function deployNewRollupContracts(
|
|
|
92
97
|
config: L1ContractsConfig,
|
|
93
98
|
logger: Logger,
|
|
94
99
|
): Promise<{ payloadAddress: EthAddress; rollup: RollupContract }> {
|
|
95
|
-
const { createEthereumChain,
|
|
100
|
+
const { createEthereumChain, deployRollupForUpgrade, createL1Clients } = await import('@aztec/ethereum');
|
|
96
101
|
const { mnemonicToAccount, privateKeyToAccount } = await import('viem/accounts');
|
|
97
102
|
const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
|
|
98
103
|
|
|
@@ -102,7 +107,7 @@ export async function deployNewRollupContracts(
|
|
|
102
107
|
const chain = createEthereumChain(rpcUrls, chainId);
|
|
103
108
|
const clients = createL1Clients(rpcUrls, account, chain.chainInfo, mnemonicIndex);
|
|
104
109
|
|
|
105
|
-
const { payloadAddress, rollup } = await
|
|
110
|
+
const { payloadAddress, rollup } = await deployRollupForUpgrade(
|
|
106
111
|
clients,
|
|
107
112
|
{
|
|
108
113
|
salt,
|
|
@@ -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