@aztec/cli 0.0.1-commit.e6bd8901 → 0.0.1-commit.ee80a48

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.
@@ -0,0 +1,4 @@
1
+ import type { LogFn } from '@aztec/foundation/log';
2
+ /** Computes and prints genesis values needed for L1 contract deployment. */
3
+ export declare function computeGenesisValuesCmd(testAccounts: boolean, sponsoredFPC: boolean, log: LogFn): Promise<void>;
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZV9nZW5lc2lzX3ZhbHVlcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NtZHMvbDEvY29tcHV0ZV9nZW5lc2lzX3ZhbHVlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQU1uRCw0RUFBNEU7QUFDNUUsd0JBQXNCLHVCQUF1QixDQUFDLFlBQVksRUFBRSxPQUFPLEVBQUUsWUFBWSxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxpQkFvQnJHIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute_genesis_values.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/compute_genesis_values.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAMnD,4EAA4E;AAC5E,wBAAsB,uBAAuB,CAAC,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,iBAoBrG"}
@@ -0,0 +1,17 @@
1
+ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
+ import { protocolContractsHash } from '@aztec/protocol-contracts';
3
+ import { getGenesisValues } from '@aztec/world-state/testing';
4
+ import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
5
+ /** Computes and prints genesis values needed for L1 contract deployment. */ export async function computeGenesisValuesCmd(testAccounts, sponsoredFPC, log) {
6
+ const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
7
+ const sponsoredFPCAddresses = sponsoredFPC ? await getSponsoredFPCAddress() : [];
8
+ const initialFundedAccounts = initialAccounts.map((a)=>a.address).concat(sponsoredFPCAddresses);
9
+ const { genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts);
10
+ const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
11
+ const vkTreeRoot = getVKTreeRoot();
12
+ log(JSON.stringify({
13
+ vkTreeRoot: vkTreeRoot.toString(),
14
+ protocolContractsHash: protocolContractsHash.toString(),
15
+ genesisArchiveRoot: genesisArchiveRoot.toString()
16
+ }, null, 2));
17
+ }
@@ -1,4 +1,4 @@
1
1
  import type { LogFn, Logger } from '@aztec/foundation/log';
2
2
  import { type Command } from 'commander';
3
3
  export declare function injectCommands(program: Command, log: LogFn, debugLogger: Logger): Command;
4
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbWRzL2wxL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUUzRCxPQUFPLEVBQUUsS0FBSyxPQUFPLEVBQVUsTUFBTSxXQUFXLENBQUM7QUF3QmpELHdCQUFnQixjQUFjLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLFdBNmUvRSJ9
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbWRzL2wxL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUUzRCxPQUFPLEVBQUUsS0FBSyxPQUFPLEVBQVUsTUFBTSxXQUFXLENBQUM7QUF3QmpELHdCQUFnQixjQUFjLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLFdBdWYvRSJ9
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAwBjD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WA6e/E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAwBjD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAuf/E"}
@@ -17,6 +17,10 @@ export function injectCommands(program, log, debugLogger) {
17
17
  const initialValidators = options.validators?.split(',').map((validator)=>EthAddress.fromString(validator)) || [];
18
18
  await deployNewRollup(options.registryAddress, options.l1RpcUrls, options.l1ChainId, options.privateKey, options.mnemonic, options.mnemonicIndex, options.testAccounts, options.sponsoredFpc, options.json, initialValidators, options.realVerifier, log);
19
19
  });
20
+ program.command('compute-genesis-values').description('Computes genesis values (VK tree root, protocol contracts hash, genesis archive root).').addOption(new Option('--test-accounts', 'Include initial test accounts in genesis state').env('TEST_ACCOUNTS')).addOption(new Option('--sponsored-fpc', 'Include sponsored FPC contract in genesis state').env('SPONSORED_FPC')).action(async (options)=>{
21
+ const { computeGenesisValuesCmd } = await import('./compute_genesis_values.js');
22
+ await computeGenesisValuesCmd(options.testAccounts, options.sponsoredFpc, log);
23
+ });
20
24
  program.command('deposit-governance-tokens').description('Deposits governance tokens to the governance contract.').requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress).requiredOption('--recipient <string>', 'The recipient of the tokens', parseEthereumAddress).requiredOption('-a, --amount <string>', 'The amount of tokens to deposit', parseBigint).option('--mint', 'Mint the tokens on L1', false).addOption(l1RpcUrlsOption).addOption(l1ChainIdOption).option('-p, --private-key <string>', 'The private key to use to deposit', PRIVATE_KEY).option('-m, --mnemonic <string>', 'The mnemonic to use to deposit', 'test test test test test test test test test test test junk').option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use to deposit', (arg)=>parseInt(arg), 0).action(async (options)=>{
21
25
  const { depositGovernanceTokens } = await import('./governance_utils.js');
22
26
  await depositGovernanceTokens({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/cli",
3
- "version": "0.0.1-commit.e6bd8901",
3
+ "version": "0.0.1-commit.ee80a48",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./contracts": "./dest/cmds/contracts/index.js",
@@ -77,23 +77,23 @@
77
77
  ]
78
78
  },
79
79
  "dependencies": {
80
- "@aztec/accounts": "0.0.1-commit.e6bd8901",
81
- "@aztec/archiver": "0.0.1-commit.e6bd8901",
82
- "@aztec/aztec.js": "0.0.1-commit.e6bd8901",
83
- "@aztec/constants": "0.0.1-commit.e6bd8901",
84
- "@aztec/entrypoints": "0.0.1-commit.e6bd8901",
85
- "@aztec/ethereum": "0.0.1-commit.e6bd8901",
86
- "@aztec/foundation": "0.0.1-commit.e6bd8901",
87
- "@aztec/l1-artifacts": "0.0.1-commit.e6bd8901",
88
- "@aztec/node-keystore": "0.0.1-commit.e6bd8901",
89
- "@aztec/node-lib": "0.0.1-commit.e6bd8901",
90
- "@aztec/p2p": "0.0.1-commit.e6bd8901",
91
- "@aztec/protocol-contracts": "0.0.1-commit.e6bd8901",
92
- "@aztec/sequencer-client": "0.0.1-commit.e6bd8901",
93
- "@aztec/slasher": "0.0.1-commit.e6bd8901",
94
- "@aztec/stdlib": "0.0.1-commit.e6bd8901",
95
- "@aztec/test-wallet": "0.0.1-commit.e6bd8901",
96
- "@aztec/world-state": "0.0.1-commit.e6bd8901",
80
+ "@aztec/accounts": "0.0.1-commit.ee80a48",
81
+ "@aztec/archiver": "0.0.1-commit.ee80a48",
82
+ "@aztec/aztec.js": "0.0.1-commit.ee80a48",
83
+ "@aztec/constants": "0.0.1-commit.ee80a48",
84
+ "@aztec/entrypoints": "0.0.1-commit.ee80a48",
85
+ "@aztec/ethereum": "0.0.1-commit.ee80a48",
86
+ "@aztec/foundation": "0.0.1-commit.ee80a48",
87
+ "@aztec/l1-artifacts": "0.0.1-commit.ee80a48",
88
+ "@aztec/node-keystore": "0.0.1-commit.ee80a48",
89
+ "@aztec/node-lib": "0.0.1-commit.ee80a48",
90
+ "@aztec/p2p": "0.0.1-commit.ee80a48",
91
+ "@aztec/protocol-contracts": "0.0.1-commit.ee80a48",
92
+ "@aztec/sequencer-client": "0.0.1-commit.ee80a48",
93
+ "@aztec/slasher": "0.0.1-commit.ee80a48",
94
+ "@aztec/stdlib": "0.0.1-commit.ee80a48",
95
+ "@aztec/test-wallet": "0.0.1-commit.ee80a48",
96
+ "@aztec/world-state": "0.0.1-commit.ee80a48",
97
97
  "@ethersproject/wallet": "^5.8.0",
98
98
  "@iarna/toml": "^2.2.5",
99
99
  "@libp2p/peer-id-factory": "^3.0.4",
@@ -107,9 +107,9 @@
107
107
  "viem": "npm:@aztec/viem@2.38.2"
108
108
  },
109
109
  "devDependencies": {
110
- "@aztec/aztec-node": "0.0.1-commit.e6bd8901",
111
- "@aztec/kv-store": "0.0.1-commit.e6bd8901",
112
- "@aztec/telemetry-client": "0.0.1-commit.e6bd8901",
110
+ "@aztec/aztec-node": "0.0.1-commit.ee80a48",
111
+ "@aztec/kv-store": "0.0.1-commit.ee80a48",
112
+ "@aztec/telemetry-client": "0.0.1-commit.ee80a48",
113
113
  "@jest/globals": "^30.0.0",
114
114
  "@types/jest": "^30.0.0",
115
115
  "@types/lodash.chunk": "^4.2.9",
@@ -126,15 +126,15 @@
126
126
  "typescript": "^5.3.3"
127
127
  },
128
128
  "peerDependencies": {
129
- "@aztec/accounts": "0.0.1-commit.e6bd8901",
130
- "@aztec/bb-prover": "0.0.1-commit.e6bd8901",
131
- "@aztec/ethereum": "0.0.1-commit.e6bd8901",
132
- "@aztec/l1-artifacts": "0.0.1-commit.e6bd8901",
133
- "@aztec/noir-contracts.js": "0.0.1-commit.e6bd8901",
134
- "@aztec/noir-protocol-circuits-types": "0.0.1-commit.e6bd8901",
135
- "@aztec/noir-test-contracts.js": "0.0.1-commit.e6bd8901",
136
- "@aztec/protocol-contracts": "0.0.1-commit.e6bd8901",
137
- "@aztec/stdlib": "0.0.1-commit.e6bd8901"
129
+ "@aztec/accounts": "0.0.1-commit.ee80a48",
130
+ "@aztec/bb-prover": "0.0.1-commit.ee80a48",
131
+ "@aztec/ethereum": "0.0.1-commit.ee80a48",
132
+ "@aztec/l1-artifacts": "0.0.1-commit.ee80a48",
133
+ "@aztec/noir-contracts.js": "0.0.1-commit.ee80a48",
134
+ "@aztec/noir-protocol-circuits-types": "0.0.1-commit.ee80a48",
135
+ "@aztec/noir-test-contracts.js": "0.0.1-commit.ee80a48",
136
+ "@aztec/protocol-contracts": "0.0.1-commit.ee80a48",
137
+ "@aztec/stdlib": "0.0.1-commit.ee80a48"
138
138
  },
139
139
  "files": [
140
140
  "dest",
@@ -0,0 +1,29 @@
1
+ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
+ import type { LogFn } from '@aztec/foundation/log';
3
+ import { protocolContractsHash } from '@aztec/protocol-contracts';
4
+ import { getGenesisValues } from '@aztec/world-state/testing';
5
+
6
+ import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
7
+
8
+ /** Computes and prints genesis values needed for L1 contract deployment. */
9
+ export async function computeGenesisValuesCmd(testAccounts: boolean, sponsoredFPC: boolean, log: LogFn) {
10
+ const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
11
+ const sponsoredFPCAddresses = sponsoredFPC ? await getSponsoredFPCAddress() : [];
12
+ const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddresses);
13
+ const { genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts);
14
+
15
+ const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
16
+ const vkTreeRoot = getVKTreeRoot();
17
+
18
+ log(
19
+ JSON.stringify(
20
+ {
21
+ vkTreeRoot: vkTreeRoot.toString(),
22
+ protocolContractsHash: protocolContractsHash.toString(),
23
+ genesisArchiveRoot: genesisArchiveRoot.toString(),
24
+ },
25
+ null,
26
+ 2,
27
+ ),
28
+ );
29
+ }
@@ -106,6 +106,16 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
106
106
  );
107
107
  });
108
108
 
109
+ program
110
+ .command('compute-genesis-values')
111
+ .description('Computes genesis values (VK tree root, protocol contracts hash, genesis archive root).')
112
+ .addOption(new Option('--test-accounts', 'Include initial test accounts in genesis state').env('TEST_ACCOUNTS'))
113
+ .addOption(new Option('--sponsored-fpc', 'Include sponsored FPC contract in genesis state').env('SPONSORED_FPC'))
114
+ .action(async options => {
115
+ const { computeGenesisValuesCmd } = await import('./compute_genesis_values.js');
116
+ await computeGenesisValuesCmd(options.testAccounts, options.sponsoredFpc, log);
117
+ });
118
+
109
119
  program
110
120
  .command('deposit-governance-tokens')
111
121
  .description('Deposits governance tokens to the governance contract.')