@aztec/cli 0.0.0-test.1 → 0.0.1-fake-ceab37513c

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.
Files changed (146) hide show
  1. package/dest/cmds/contracts/inspect_contract.d.ts.map +1 -1
  2. package/dest/cmds/contracts/inspect_contract.js +9 -5
  3. package/dest/cmds/infrastructure/index.d.ts.map +1 -1
  4. package/dest/cmds/infrastructure/index.js +3 -3
  5. package/dest/cmds/infrastructure/sequencers.d.ts +2 -1
  6. package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
  7. package/dest/cmds/infrastructure/sequencers.js +27 -15
  8. package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
  9. package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
  10. package/dest/cmds/infrastructure/setup_l2_contract.js +14 -12
  11. package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
  12. package/dest/cmds/l1/advance_epoch.js +3 -2
  13. package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
  14. package/dest/cmds/l1/assume_proven_through.js +3 -3
  15. package/dest/cmds/l1/bridge_erc20.d.ts +1 -1
  16. package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
  17. package/dest/cmds/l1/bridge_erc20.js +4 -4
  18. package/dest/cmds/l1/deploy_l1_contracts.d.ts +2 -2
  19. package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +1 -1
  20. package/dest/cmds/l1/deploy_l1_contracts.js +22 -5
  21. package/dest/cmds/l1/deploy_new_rollup.d.ts +2 -1
  22. package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
  23. package/dest/cmds/l1/deploy_new_rollup.js +16 -7
  24. package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
  25. package/dest/cmds/l1/governance_utils.js +17 -17
  26. package/dest/cmds/l1/index.d.ts +1 -0
  27. package/dest/cmds/l1/index.d.ts.map +1 -1
  28. package/dest/cmds/l1/index.js +29 -39
  29. package/dest/cmds/l1/trigger_seed_snapshot.d.ts +6 -0
  30. package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -0
  31. package/dest/cmds/l1/trigger_seed_snapshot.js +19 -0
  32. package/dest/cmds/l1/update_l1_validators.d.ts +17 -2
  33. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  34. package/dest/cmds/l1/update_l1_validators.js +156 -101
  35. package/dest/cmds/misc/generate_bootnode_enr.d.ts +1 -1
  36. package/dest/cmds/misc/generate_bootnode_enr.d.ts.map +1 -1
  37. package/dest/cmds/misc/generate_bootnode_enr.js +2 -2
  38. package/dest/cmds/misc/generate_secret_and_hash.d.ts +1 -1
  39. package/dest/cmds/misc/generate_secret_and_hash.d.ts.map +1 -1
  40. package/dest/cmds/misc/generate_secret_and_hash.js +2 -2
  41. package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts +3 -0
  42. package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts.map +1 -0
  43. package/dest/cmds/misc/get_canonical_sponsored_fpc_address.js +4 -0
  44. package/dest/cmds/misc/index.d.ts.map +1 -1
  45. package/dest/cmds/misc/index.js +7 -3
  46. package/dest/cmds/misc/update/github.d.ts +0 -1
  47. package/dest/cmds/misc/update/github.d.ts.map +1 -1
  48. package/dest/cmds/misc/update/github.js +0 -1
  49. package/dest/cmds/misc/update.d.ts.map +1 -1
  50. package/dest/cmds/misc/update.js +2 -3
  51. package/dest/cmds/pxe/get_contract_data.js +1 -1
  52. package/dest/cmds/pxe/get_node_info.d.ts.map +1 -1
  53. package/dest/cmds/pxe/get_node_info.js +11 -7
  54. package/dest/cmds/pxe/get_pxe_info.js +2 -2
  55. package/dest/config/cached_fetch.d.ts +18 -0
  56. package/dest/config/cached_fetch.d.ts.map +1 -0
  57. package/dest/config/cached_fetch.js +54 -0
  58. package/dest/config/chain_l2_config.d.ts +38 -0
  59. package/dest/config/chain_l2_config.d.ts.map +1 -0
  60. package/dest/config/chain_l2_config.js +376 -0
  61. package/dest/config/enrich_env.d.ts +4 -0
  62. package/dest/config/enrich_env.d.ts.map +1 -0
  63. package/dest/config/enrich_env.js +12 -0
  64. package/dest/config/get_l1_config.d.ts +8 -0
  65. package/dest/config/get_l1_config.d.ts.map +1 -0
  66. package/dest/config/get_l1_config.js +22 -0
  67. package/dest/config/index.d.ts +5 -0
  68. package/dest/config/index.d.ts.map +1 -0
  69. package/dest/config/index.js +4 -0
  70. package/dest/config/network_config.d.ts +19 -0
  71. package/dest/config/network_config.d.ts.map +1 -0
  72. package/dest/config/network_config.js +79 -0
  73. package/dest/utils/aztec.d.ts +12 -11
  74. package/dest/utils/aztec.d.ts.map +1 -1
  75. package/dest/utils/aztec.js +52 -22
  76. package/dest/utils/commands.d.ts +1 -1
  77. package/dest/utils/commands.d.ts.map +1 -1
  78. package/dest/utils/commands.js +5 -5
  79. package/dest/utils/encoding.js +1 -1
  80. package/dest/utils/github.d.ts +0 -1
  81. package/dest/utils/github.d.ts.map +1 -1
  82. package/dest/utils/github.js +0 -1
  83. package/dest/utils/index.d.ts +1 -0
  84. package/dest/utils/index.d.ts.map +1 -1
  85. package/dest/utils/index.js +1 -0
  86. package/dest/utils/inspect.d.ts.map +1 -1
  87. package/dest/utils/inspect.js +18 -26
  88. package/dest/utils/setup_contracts.d.ts +5 -0
  89. package/dest/utils/setup_contracts.d.ts.map +1 -0
  90. package/dest/utils/setup_contracts.js +36 -0
  91. package/package.json +38 -32
  92. package/src/cmds/contracts/inspect_contract.ts +16 -6
  93. package/src/cmds/infrastructure/index.ts +10 -2
  94. package/src/cmds/infrastructure/sequencers.ts +32 -15
  95. package/src/cmds/infrastructure/setup_l2_contract.ts +16 -11
  96. package/src/cmds/l1/advance_epoch.ts +3 -2
  97. package/src/cmds/l1/assume_proven_through.ts +3 -3
  98. package/src/cmds/l1/bridge_erc20.ts +4 -3
  99. package/src/cmds/l1/deploy_l1_contracts.ts +30 -6
  100. package/src/cmds/l1/deploy_new_rollup.ts +22 -8
  101. package/src/cmds/l1/governance_utils.ts +18 -17
  102. package/src/cmds/l1/index.ts +69 -96
  103. package/src/cmds/l1/trigger_seed_snapshot.ts +31 -0
  104. package/src/cmds/l1/update_l1_validators.ts +191 -92
  105. package/src/cmds/misc/generate_bootnode_enr.ts +3 -2
  106. package/src/cmds/misc/generate_secret_and_hash.ts +2 -2
  107. package/src/cmds/misc/get_canonical_sponsored_fpc_address.ts +7 -0
  108. package/src/cmds/misc/index.ts +13 -4
  109. package/src/cmds/misc/update/github.ts +0 -1
  110. package/src/cmds/misc/update.ts +1 -7
  111. package/src/cmds/pxe/get_contract_data.ts +1 -1
  112. package/src/cmds/pxe/get_node_info.ts +10 -7
  113. package/src/cmds/pxe/get_pxe_info.ts +2 -2
  114. package/src/config/cached_fetch.ts +67 -0
  115. package/src/config/chain_l2_config.ts +493 -0
  116. package/src/config/enrich_env.ts +15 -0
  117. package/src/config/get_l1_config.ts +28 -0
  118. package/src/config/index.ts +4 -0
  119. package/src/config/network_config.ts +102 -0
  120. package/src/utils/aztec.ts +76 -27
  121. package/src/utils/commands.ts +5 -5
  122. package/src/utils/encoding.ts +1 -1
  123. package/src/utils/github.ts +0 -1
  124. package/src/utils/index.ts +1 -0
  125. package/src/utils/inspect.ts +18 -25
  126. package/src/utils/setup_contracts.ts +58 -0
  127. package/dest/cmds/devnet/bootstrap_network.d.ts +0 -3
  128. package/dest/cmds/devnet/bootstrap_network.d.ts.map +0 -1
  129. package/dest/cmds/devnet/bootstrap_network.js +0 -196
  130. package/dest/cmds/devnet/faucet.d.ts +0 -4
  131. package/dest/cmds/devnet/faucet.d.ts.map +0 -1
  132. package/dest/cmds/devnet/faucet.js +0 -26
  133. package/dest/cmds/devnet/index.d.ts +0 -4
  134. package/dest/cmds/devnet/index.d.ts.map +0 -1
  135. package/dest/cmds/devnet/index.js +0 -14
  136. package/dest/cmds/l1/deploy_l1_verifier.d.ts +0 -5
  137. package/dest/cmds/l1/deploy_l1_verifier.d.ts.map +0 -1
  138. package/dest/cmds/l1/deploy_l1_verifier.js +0 -54
  139. package/dest/cmds/misc/setup_contracts.d.ts +0 -7
  140. package/dest/cmds/misc/setup_contracts.d.ts.map +0 -1
  141. package/dest/cmds/misc/setup_contracts.js +0 -27
  142. package/src/cmds/devnet/bootstrap_network.ts +0 -318
  143. package/src/cmds/devnet/faucet.ts +0 -33
  144. package/src/cmds/devnet/index.ts +0 -60
  145. package/src/cmds/l1/deploy_l1_verifier.ts +0 -105
  146. package/src/cmds/misc/setup_contracts.ts +0 -40
@@ -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;AAW3D,wBAAsB,eAAe,CAAC,oBAAoB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBA2BlG"}
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
- const bytecodeSize = fn.bytecode.length;
35
- const bytecodeHash = sha256(fn.bytecode).toString('hex');
36
- log(`${fn.functionType} ${signatureWithParameterNames} \n\tfunction signature: ${signature}\n\tselector: ${selector}\n\tbytecode: ${bytecodeSize} bytes (sha256 ${bytecodeHash})`);
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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAgD/E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAwD/E"}
@@ -1,8 +1,8 @@
1
1
  import { ETHEREUM_HOSTS, l1ChainIdOption, parseOptionalInteger, pxeOption } from '../../utils/commands.js';
2
2
  export function injectCommands(program, log, debugLogger) {
3
- program.command('setup-protocol-contracts').description('Bootstrap the blockchain by initializing all the protocol contracts').addOption(pxeOption).option('--testAccounts', 'Deploy funded test accounts.').option('--json', 'Output the contract addresses in JSON format').option('--skipProofWait', "Don't wait for proofs to land.").action(async (options)=>{
3
+ program.command('setup-protocol-contracts').description('Bootstrap the blockchain by initializing all the protocol contracts').addOption(pxeOption).option('--testAccounts', 'Deploy funded test accounts.').option('--sponsoredFPC', 'Deploy a sponsored FPC.').option('--json', 'Output the contract addresses in JSON format').option('--skipProofWait', "Don't wait for proofs to land.").action(async (options)=>{
4
4
  const { setupL2Contracts } = await import('./setup_l2_contract.js');
5
- await setupL2Contracts(options.rpcUrl, options.testAccounts, options.json, options.skipProofWait, log);
5
+ await setupL2Contracts(options.rpcUrl, options.testAccounts, options.sponsoredFPC, options.json, options.skipProofWait, log);
6
6
  });
7
7
  program.command('sequencers').argument('<command>', 'Command to run: list, add, remove, who-next').argument('[who]', 'Who to add/remove').description('Manages or queries registered sequencers on the L1 rollup contract.').requiredOption('--l1-rpc-urls <string>', 'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)', (arg)=>arg.split(','), [
8
8
  ETHEREUM_HOSTS
@@ -13,7 +13,7 @@ export function injectCommands(program, log, debugLogger) {
13
13
  who,
14
14
  mnemonic: options.mnemonic,
15
15
  rpcUrl: options.rpcUrl,
16
- l1RpcUrls: options.l1RpcUrls.split(','),
16
+ l1RpcUrls: options.l1RpcUrls,
17
17
  chainId: options.l1ChainId,
18
18
  blockNumber: options.blockNumber,
19
19
  log,
@@ -1,8 +1,9 @@
1
1
  import type { LogFn, Logger } from '@aztec/foundation/log';
2
2
  export declare function sequencers(opts: {
3
- command: 'list' | 'add' | 'remove' | 'who-next';
3
+ command: 'list' | 'add' | 'remove' | 'who-next' | 'flush';
4
4
  who?: string;
5
5
  mnemonic?: string;
6
+ bn254SecretKey?: bigint;
6
7
  rpcUrl: string;
7
8
  l1RpcUrls: string[];
8
9
  chainId: number;
@@ -1 +1 @@
1
- {"version":3,"file":"sequencers.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/sequencers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM3D,wBAAsB,UAAU,CAAC,IAAI,EAAE;IACrC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,CAAC;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,KAAK,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,iBAoFA"}
1
+ {"version":3,"file":"sequencers.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/sequencers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM3D,wBAAsB,UAAU,CAAC,IAAI,EAAE;IACrC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,KAAK,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,iBAoGA"}
@@ -1,10 +1,10 @@
1
- import { createCompatibleClient } from '@aztec/aztec.js';
2
- import { createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
1
+ import { Fr, createCompatibleClient } from '@aztec/aztec.js';
2
+ import { GSEContract, RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
3
3
  import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
4
4
  import { createPublicClient, createWalletClient, fallback, getContract, http } from 'viem';
5
5
  import { mnemonicToAccount } from 'viem/accounts';
6
6
  export async function sequencers(opts) {
7
- const { command, who: maybeWho, mnemonic, rpcUrl, l1RpcUrls, chainId, log, debugLogger } = opts;
7
+ const { command, who: maybeWho, mnemonic, bn254SecretKey, rpcUrl, l1RpcUrls, chainId, log, debugLogger } = opts;
8
8
  const client = await createCompatibleClient(rpcUrl, debugLogger);
9
9
  const { l1ContractAddresses } = await client.getNodeInfo();
10
10
  const chain = createEthereumChain(l1RpcUrls, chainId);
@@ -17,11 +17,7 @@ export async function sequencers(opts) {
17
17
  chain: chain.chainInfo,
18
18
  transport: fallback(l1RpcUrls.map((url)=>http(url)))
19
19
  }) : undefined;
20
- const rollup = getContract({
21
- address: l1ContractAddresses.rollupAddress.toString(),
22
- abi: RollupAbi,
23
- client: publicClient
24
- });
20
+ const rollup = new RollupContract(publicClient, l1ContractAddresses.rollupAddress);
25
21
  const writeableRollup = walletClient ? getContract({
26
22
  address: l1ContractAddresses.rollupAddress.toString(),
27
23
  abi: RollupAbi,
@@ -29,7 +25,7 @@ export async function sequencers(opts) {
29
25
  }) : undefined;
30
26
  const who = maybeWho ?? walletClient?.account.address.toString();
31
27
  if (command === 'list') {
32
- const sequencers = await rollup.read.getAttesters();
28
+ const sequencers = await rollup.getAttesters();
33
29
  if (sequencers.length === 0) {
34
30
  log(`No sequencers registered on rollup`);
35
31
  } else {
@@ -44,19 +40,23 @@ export async function sequencers(opts) {
44
40
  }
45
41
  log(`Adding ${who} as sequencer`);
46
42
  const stakingAsset = getContract({
47
- address: await rollup.read.getStakingAsset(),
43
+ address: await rollup.getStakingAsset(),
48
44
  abi: TestERC20Abi,
49
45
  client: walletClient
50
46
  });
51
47
  const config = getL1ContractsConfigEnvVars();
48
+ const bn254SecretKeyFieldElement = bn254SecretKey ? new Fr(bn254SecretKey) : Fr.random();
49
+ const gseAddress = await rollup.getGSE();
50
+ const gseContract = new GSEContract(publicClient, gseAddress);
51
+ const registrationTuple = await gseContract.makeRegistrationTuple(bn254SecretKeyFieldElement.toBigInt());
52
52
  await Promise.all([
53
53
  await stakingAsset.write.mint([
54
54
  walletClient.account.address,
55
- config.minimumStake
55
+ config.activationThreshold
56
56
  ], {}),
57
57
  await stakingAsset.write.approve([
58
58
  rollup.address,
59
- config.minimumStake
59
+ config.activationThreshold
60
60
  ], {})
61
61
  ].map((txHash)=>publicClient.waitForTransactionReceipt({
62
62
  hash: txHash
@@ -64,13 +64,25 @@ export async function sequencers(opts) {
64
64
  const hash = await writeableRollup.write.deposit([
65
65
  who,
66
66
  who,
67
- who,
68
- config.minimumStake
67
+ registrationTuple.publicKeyInG1,
68
+ registrationTuple.publicKeyInG2,
69
+ registrationTuple.proofOfPossession,
70
+ true
69
71
  ]);
70
72
  await publicClient.waitForTransactionReceipt({
71
73
  hash
72
74
  });
73
75
  log(`Added in tx ${hash}`);
76
+ } else if (command === 'flush') {
77
+ if (!writeableRollup) {
78
+ throw new Error(`Missing sequencer address`);
79
+ }
80
+ log(`Flushing staking entry queue`);
81
+ const hash = await writeableRollup.write.flushEntryQueue();
82
+ await publicClient.waitForTransactionReceipt({
83
+ hash
84
+ });
85
+ log(`Flushed staking entry queue in tx ${hash}`);
74
86
  } else if (command === 'remove') {
75
87
  if (!who || !writeableRollup) {
76
88
  throw new Error(`Missing sequencer address`);
@@ -85,7 +97,7 @@ export async function sequencers(opts) {
85
97
  });
86
98
  log(`Removed in tx ${hash}`);
87
99
  } else if (command === 'who-next') {
88
- const next = await rollup.read.getCurrentProposer();
100
+ const next = await rollup.getCurrentProposer();
89
101
  log(`Sequencer expected to build is ${next}`);
90
102
  } else {
91
103
  throw new Error(`Unknown command ${command}`);
@@ -1,3 +1,3 @@
1
1
  import type { LogFn } from '@aztec/foundation/log';
2
- export declare function setupL2Contracts(rpcUrl: string, testAccounts: boolean, json: boolean, skipProofWait: boolean, log: LogFn): Promise<void>;
2
+ export declare function setupL2Contracts(rpcUrl: string, testAccounts: boolean, sponsoredFPC: boolean, json: boolean, skipProofWait: boolean, log: LogFn): Promise<void>;
3
3
  //# sourceMappingURL=setup_l2_contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup_l2_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/setup_l2_contract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAKnD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,IAAI,EAAE,OAAO,EACb,aAAa,EAAE,OAAO,EACtB,GAAG,EAAE,KAAK,iBAiCX"}
1
+ {"version":3,"file":"setup_l2_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/setup_l2_contract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAKnD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,IAAI,EAAE,OAAO,EACb,aAAa,EAAE,OAAO,EACtB,GAAG,EAAE,KAAK,iBAqCX"}
@@ -1,16 +1,20 @@
1
1
  import { deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/accounts/testing';
2
- import { SignerlessWallet, createPXEClient, makeFetch } from '@aztec/aztec.js';
2
+ import { createPXEClient, makeFetch } from '@aztec/aztec.js';
3
3
  import { jsonStringify } from '@aztec/foundation/json-rpc';
4
4
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
5
- import { setupCanonicalL2FeeJuice } from '../misc/setup_contracts.js';
6
- export async function setupL2Contracts(rpcUrl, testAccounts, json, skipProofWait, log) {
5
+ import { setupSponsoredFPC } from '../../utils/setup_contracts.js';
6
+ export async function setupL2Contracts(rpcUrl, testAccounts, sponsoredFPC, json, skipProofWait, log) {
7
7
  const waitOpts = {
8
8
  timeout: 180,
9
- interval: 1,
10
- proven: !skipProofWait,
11
- provenTimeout: 600
9
+ interval: 1
12
10
  };
11
+ const waitForProvenOptions = !skipProofWait ? {
12
+ provenTimeout: 600
13
+ } : undefined;
13
14
  log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
15
+ if (waitForProvenOptions) {
16
+ log('setupL2Contracts: Wait for proven options' + jsonStringify(waitForProvenOptions));
17
+ }
14
18
  log('setupL2Contracts: Creating PXE client...');
15
19
  const pxe = createPXEClient(rpcUrl, {}, makeFetch([
16
20
  1,
@@ -19,18 +23,16 @@ export async function setupL2Contracts(rpcUrl, testAccounts, json, skipProofWait
19
23
  1,
20
24
  1
21
25
  ], false));
22
- const wallet = new SignerlessWallet(pxe);
23
- log('setupL2Contracts: Getting fee juice portal address...');
24
- // Deploy Fee Juice
25
- const feeJuicePortalAddress = (await wallet.getNodeInfo()).l1ContractAddresses.feeJuicePortalAddress;
26
- log('setupL2Contracts: Setting up fee juice portal...');
27
- await setupCanonicalL2FeeJuice(wallet, feeJuicePortalAddress, waitOpts, log);
28
26
  let deployedAccounts = [];
29
27
  if (testAccounts) {
30
28
  log('setupL2Contracts: Deploying test accounts...');
31
29
  deployedAccounts = await getInitialTestAccounts();
32
30
  await deployFundedSchnorrAccounts(pxe, deployedAccounts, waitOpts);
33
31
  }
32
+ if (sponsoredFPC) {
33
+ log('setupL2Contracts: Setting up sponsored FPC...');
34
+ await setupSponsoredFPC(pxe, log, waitOpts, waitForProvenOptions);
35
+ }
34
36
  if (json) {
35
37
  const toPrint = {
36
38
  ...ProtocolContractAddress
@@ -1 +1 @@
1
- {"version":3,"file":"advance_epoch.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/advance_epoch.ts"],"names":[],"mappings":"AACA,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
+ {"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,8 +1,9 @@
1
- import { CheatCodes, createPXEClient, makeFetch } from '@aztec/aztec.js';
1
+ import { createPXEClient, makeFetch } from '@aztec/aztec.js';
2
+ import { RollupCheatCodes } from '@aztec/ethereum/test';
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);
5
- const cheat = CheatCodes.createRollup(l1RpcUrls, {
6
+ const cheat = RollupCheatCodes.create(l1RpcUrls, {
6
7
  rollupAddress
7
8
  });
8
9
  await cheat.advanceToNextEpoch();
@@ -1 +1 @@
1
- {"version":3,"file":"assume_proven_through.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/assume_proven_through.ts"],"names":[],"mappings":"AACA,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
+ {"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,iBAUX"}
@@ -1,10 +1,10 @@
1
- import { EthCheatCodes, RollupCheatCodes, createPXEClient, makeFetch } from '@aztec/aztec.js';
1
+ import { createPXEClient, makeFetch } from '@aztec/aztec.js';
2
+ import { RollupCheatCodes } from '@aztec/ethereum/test';
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);
5
6
  const blockNumber = blockNumberOrLatest ?? await pxe.getBlockNumber();
6
- const ethCheatCode = new EthCheatCodes(l1RpcUrls);
7
- const rollupCheatCodes = new RollupCheatCodes(ethCheatCode, {
7
+ const rollupCheatCodes = RollupCheatCodes.create(l1RpcUrls, {
8
8
  rollupAddress
9
9
  });
10
10
  await rollupCheatCodes.markAsProven(blockNumber);
@@ -1,4 +1,4 @@
1
1
  import { type AztecAddress, type EthAddress } from '@aztec/aztec.js';
2
2
  import type { LogFn, Logger } from '@aztec/foundation/log';
3
- export declare function bridgeERC20(amount: bigint, recipient: AztecAddress, l1RpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, tokenAddress: EthAddress, portalAddress: EthAddress, privateTransfer: boolean, mint: boolean, json: boolean, log: LogFn, debugLogger: Logger): Promise<void>;
3
+ export declare function bridgeERC20(amount: bigint, recipient: AztecAddress, l1RpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, tokenAddress: EthAddress, handlerAddress: EthAddress | undefined, portalAddress: EthAddress, privateTransfer: boolean, mint: boolean, json: boolean, log: LogFn, debugLogger: Logger): Promise<void>;
4
4
  //# sourceMappingURL=bridge_erc20.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bridge_erc20.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/bridge_erc20.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAqC,MAAM,iBAAiB,CAAC;AAExG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,UAAU,EACxB,aAAa,EAAE,UAAU,EACzB,eAAe,EAAE,OAAO,EACxB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBAgCpB"}
1
+ {"version":3,"file":"bridge_erc20.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/bridge_erc20.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAqC,MAAM,iBAAiB,CAAC;AAExG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,UAAU,EACxB,cAAc,EAAE,UAAU,GAAG,SAAS,EACtC,aAAa,EAAE,UAAU,EACzB,eAAe,EAAE,OAAO,EACxB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBAgCpB"}
@@ -1,12 +1,12 @@
1
1
  import { L1ToL2TokenPortalManager } from '@aztec/aztec.js';
2
- import { createEthereumChain, createL1Clients } from '@aztec/ethereum';
2
+ import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
3
3
  import { prettyPrintJSON } from '../../utils/commands.js';
4
- export async function bridgeERC20(amount, recipient, l1RpcUrls, chainId, privateKey, mnemonic, tokenAddress, portalAddress, privateTransfer, mint, json, log, debugLogger) {
4
+ export async function bridgeERC20(amount, recipient, l1RpcUrls, chainId, privateKey, mnemonic, tokenAddress, handlerAddress, portalAddress, privateTransfer, mint, json, log, debugLogger) {
5
5
  // Prepare L1 client
6
6
  const chain = createEthereumChain(l1RpcUrls, chainId);
7
- const { publicClient, walletClient } = createL1Clients(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
7
+ const l1Client = createExtendedL1Client(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
8
8
  // Setup portal manager
9
- const manager = new L1ToL2TokenPortalManager(portalAddress, tokenAddress, publicClient, walletClient, debugLogger);
9
+ const manager = new L1ToL2TokenPortalManager(portalAddress, tokenAddress, handlerAddress, l1Client, debugLogger);
10
10
  let claimSecret;
11
11
  let messageHash;
12
12
  if (privateTransfer) {
@@ -1,4 +1,4 @@
1
- import type { EthAddress } from '@aztec/foundation/eth-address';
1
+ import { type EthAddress } from '@aztec/aztec.js';
2
2
  import type { LogFn, Logger } from '@aztec/foundation/log';
3
- export declare function deployL1Contracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, testAccounts: boolean, acceleratedTestDeployments: boolean, json: boolean, initialValidators: EthAddress[], log: LogFn, debugLogger: Logger): Promise<void>;
3
+ export declare function deployL1Contracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, testAccounts: boolean, sponsoredFPC: boolean, acceleratedTestDeployments: boolean, json: boolean, createVerificationJson: string | false, initialValidators: EthAddress[], realVerifier: boolean, existingToken: EthAddress | undefined, log: LogFn, debugLogger: Logger): Promise<void>;
4
4
  //# sourceMappingURL=deploy_l1_contracts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deploy_l1_contracts.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/deploy_l1_contracts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAK3D,wBAAsB,iBAAiB,CACrC,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,YAAY,EAAE,OAAO,EACrB,0BAA0B,EAAE,OAAO,EACnC,IAAI,EAAE,OAAO,EACb,iBAAiB,EAAE,UAAU,EAAE,EAC/B,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBA4CpB"}
1
+ {"version":3,"file":"deploy_l1_contracts.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/deploy_l1_contracts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAM,MAAM,iBAAiB,CAAC;AAGtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM3D,wBAAsB,iBAAiB,CACrC,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,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,0BAA0B,EAAE,OAAO,EACnC,IAAI,EAAE,OAAO,EACb,sBAAsB,EAAE,MAAM,GAAG,KAAK,EACtC,iBAAiB,EAAE,UAAU,EAAE,EAC/B,YAAY,EAAE,OAAO,EACrB,aAAa,EAAE,UAAU,GAAG,SAAS,EACrC,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBA8DpB"}
@@ -1,20 +1,31 @@
1
1
  import { getInitialTestAccounts } from '@aztec/accounts/testing';
2
+ import { Fr } from '@aztec/aztec.js';
2
3
  import { getL1ContractsConfigEnvVars } from '@aztec/ethereum';
4
+ import { SecretValue } from '@aztec/foundation/config';
3
5
  import { getGenesisValues } from '@aztec/world-state/testing';
4
6
  import { deployAztecContracts } from '../../utils/aztec.js';
5
- export async function deployL1Contracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, testAccounts, acceleratedTestDeployments, json, initialValidators, log, debugLogger) {
7
+ import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
8
+ export async function deployL1Contracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, testAccounts, sponsoredFPC, acceleratedTestDeployments, json, createVerificationJson, initialValidators, realVerifier, existingToken, log, debugLogger) {
6
9
  const config = getL1ContractsConfigEnvVars();
7
- const initialFundedAccounts = testAccounts ? await getInitialTestAccounts() : [];
8
- const { genesisBlockHash, genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts.map((a)=>a.address));
9
- const { l1ContractAddresses } = await deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, genesisBlockHash, acceleratedTestDeployments, config, debugLogger);
10
+ const initialAccounts = testAccounts ? await getInitialTestAccounts() : [];
11
+ const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : [];
12
+ const initialFundedAccounts = initialAccounts.map((a)=>a.address).concat(sponsoredFPCAddress);
13
+ const { genesisArchiveRoot, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
14
+ const initialValidatorOperators = initialValidators.map((a)=>({
15
+ attester: a,
16
+ withdrawer: a,
17
+ bn254SecretKey: new SecretValue(Fr.random().toBigInt())
18
+ }));
19
+ const { l1ContractAddresses } = await deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidatorOperators, genesisArchiveRoot, fundingNeeded, acceleratedTestDeployments, config, existingToken, realVerifier, createVerificationJson, debugLogger);
10
20
  if (json) {
11
21
  log(JSON.stringify(Object.fromEntries(Object.entries(l1ContractAddresses).map(([k, v])=>[
12
22
  k,
13
- v.toString()
23
+ v?.toString() ?? 'Not deployed'
14
24
  ])), null, 2));
15
25
  } else {
16
26
  log(`Rollup Address: ${l1ContractAddresses.rollupAddress.toString()}`);
17
27
  log(`Registry Address: ${l1ContractAddresses.registryAddress.toString()}`);
28
+ log(`GSE Address: ${l1ContractAddresses.gseAddress?.toString()}`);
18
29
  log(`L1 -> L2 Inbox Address: ${l1ContractAddresses.inboxAddress.toString()}`);
19
30
  log(`L2 -> L1 Outbox Address: ${l1ContractAddresses.outboxAddress.toString()}`);
20
31
  log(`Fee Juice Address: ${l1ContractAddresses.feeJuiceAddress.toString()}`);
@@ -25,5 +36,11 @@ export async function deployL1Contracts(rpcUrls, chainId, privateKey, mnemonic,
25
36
  log(`GovernanceProposer Address: ${l1ContractAddresses.governanceProposerAddress.toString()}`);
26
37
  log(`Governance Address: ${l1ContractAddresses.governanceAddress.toString()}`);
27
38
  log(`SlashFactory Address: ${l1ContractAddresses.slashFactoryAddress?.toString()}`);
39
+ log(`FeeAssetHandler Address: ${l1ContractAddresses.feeAssetHandlerAddress?.toString()}`);
40
+ log(`StakingAssetHandler Address: ${l1ContractAddresses.stakingAssetHandlerAddress?.toString()}`);
41
+ log(`ZK Passport Verifier Address: ${l1ContractAddresses.zkPassportVerifierAddress?.toString()}`);
42
+ log(`Initial funded accounts: ${initialFundedAccounts.map((a)=>a.toString()).join(', ')}`);
43
+ log(`Initial validators: ${initialValidators.map((a)=>a.toString()).join(', ')}`);
44
+ log(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
28
45
  }
29
46
  }
@@ -1,4 +1,5 @@
1
+ import { type Operator } from '@aztec/ethereum';
1
2
  import type { EthAddress } from '@aztec/foundation/eth-address';
2
3
  import type { LogFn, Logger } from '@aztec/foundation/log';
3
- export declare function deployNewRollup(registryAddress: EthAddress, rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, testAccounts: boolean, json: boolean, initialValidators: EthAddress[], log: LogFn, debugLogger: Logger): Promise<void>;
4
+ export declare function deployNewRollup(registryAddress: EthAddress, rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, testAccounts: boolean, sponsoredFPC: boolean, json: boolean, initialValidators: Operator[], realVerifier: boolean, createVerificationJson: string | false, log: LogFn, debugLogger: Logger): Promise<void>;
4
5
  //# sourceMappingURL=deploy_new_rollup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deploy_new_rollup.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/deploy_new_rollup.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAK3D,wBAAsB,eAAe,CACnC,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,YAAY,EAAE,OAAO,EACrB,IAAI,EAAE,OAAO,EACb,iBAAiB,EAAE,UAAU,EAAE,EAC/B,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBAqCpB"}
1
+ {"version":3,"file":"deploy_new_rollup.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/deploy_new_rollup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAA+B,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM3D,wBAAsB,eAAe,CACnC,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,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,IAAI,EAAE,OAAO,EACb,iBAAiB,EAAE,QAAQ,EAAE,EAC7B,YAAY,EAAE,OAAO,EACrB,sBAAsB,EAAE,MAAM,GAAG,KAAK,EACtC,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBA+CpB"}
@@ -2,18 +2,27 @@ import { getInitialTestAccounts } from '@aztec/accounts/testing';
2
2
  import { getL1ContractsConfigEnvVars } from '@aztec/ethereum';
3
3
  import { getGenesisValues } from '@aztec/world-state/testing';
4
4
  import { deployNewRollupContracts } from '../../utils/aztec.js';
5
- export async function deployNewRollup(registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, testAccounts, json, initialValidators, log, debugLogger) {
5
+ import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
6
+ export async function deployNewRollup(registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, testAccounts, sponsoredFPC, json, initialValidators, realVerifier, createVerificationJson, log, debugLogger) {
6
7
  const config = getL1ContractsConfigEnvVars();
7
- const initialFundedAccounts = testAccounts ? await getInitialTestAccounts() : [];
8
- const { genesisBlockHash, genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts.map((a)=>a.address));
9
- const { payloadAddress, rollup } = await deployNewRollupContracts(registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, genesisBlockHash, config, debugLogger);
8
+ const initialAccounts = testAccounts ? await getInitialTestAccounts() : [];
9
+ const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : [];
10
+ const initialFundedAccounts = initialAccounts.map((a)=>a.address).concat(sponsoredFPCAddress);
11
+ const { genesisArchiveRoot, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
12
+ const { rollup, slashFactoryAddress } = await deployNewRollupContracts(registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, fundingNeeded, config, realVerifier, createVerificationJson, debugLogger);
10
13
  if (json) {
11
14
  log(JSON.stringify({
12
- payloadAddress: payloadAddress.toString(),
13
- rollupAddress: rollup.address
15
+ rollupAddress: rollup.address,
16
+ initialFundedAccounts: initialFundedAccounts.map((a)=>a.toString()),
17
+ initialValidators: initialValidators.map((a)=>a.attester.toString()),
18
+ genesisArchiveRoot: genesisArchiveRoot.toString(),
19
+ slashFactoryAddress: slashFactoryAddress.toString()
14
20
  }, null, 2));
15
21
  } else {
16
- log(`Payload Address: ${payloadAddress.toString()}`);
17
22
  log(`Rollup Address: ${rollup.address}`);
23
+ log(`Initial funded accounts: ${initialFundedAccounts.map((a)=>a.toString()).join(', ')}`);
24
+ log(`Initial validators: ${initialValidators.map((a)=>a.attester.toString()).join(', ')}`);
25
+ log(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
26
+ log(`Slash Factory Address: ${slashFactoryAddress.toString()}`);
18
27
  }
19
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"governance_utils.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/governance_utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,uBAAuB,CAAC,EAC5C,eAAe,EACf,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACT,MAAM,EACN,WAAW,EACX,IAAI,GACL,EAAE;IACD,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,iBA0BA;AAED,wBAAsB,eAAe,CAAC,EACpC,cAAc,EACd,eAAe,EACf,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,WAAW,EACX,GAAG,GACJ,EAAE;IACD,cAAc,EAAE,KAAK,MAAM,EAAE,CAAC;IAC9B,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,KAAK,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;CACf,iBAoBA;AAED,wBAAsB,wBAAwB,CAAC,EAC7C,UAAU,EACV,UAAU,EACV,OAAO,EACP,aAAa,EACb,eAAe,EACf,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,WAAW,GACZ,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,iBAmBA;AAED,wBAAsB,yBAAyB,CAAC,EAC9C,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,WAAW,GACZ,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,iBAiBA"}
1
+ {"version":3,"file":"governance_utils.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/governance_utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,uBAAuB,CAAC,EAC5C,eAAe,EACf,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACT,MAAM,EACN,WAAW,EACX,IAAI,GACL,EAAE;IACD,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,iBA2BA;AAED,wBAAsB,eAAe,CAAC,EACpC,cAAc,EACd,eAAe,EACf,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,WAAW,EACX,GAAG,GACJ,EAAE;IACD,cAAc,EAAE,KAAK,MAAM,EAAE,CAAC;IAC9B,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,KAAK,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;CACf,iBAoBA;AAED,wBAAsB,wBAAwB,CAAC,EAC7C,UAAU,EACV,UAAU,EACV,OAAO,EACP,aAAa,EACb,eAAe,EACf,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,WAAW,GACZ,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,iBAmBA;AAED,wBAAsB,yBAAyB,CAAC,EAC9C,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,WAAW,GACZ,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,iBAiBA"}
@@ -1,13 +1,13 @@
1
- import { FeeJuiceContract, GovernanceContract, ProposalState, RegistryContract, createEthereumChain, createL1Clients } from '@aztec/ethereum';
1
+ import { FeeJuiceContract, GovernanceContract, ProposalState, RegistryContract, createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
2
2
  export async function depositGovernanceTokens({ registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, recipient, amount, debugLogger, mint }) {
3
3
  debugLogger.info(`Depositing ${amount} governance tokens to ${recipient}`);
4
4
  const chain = createEthereumChain(rpcUrls, chainId);
5
- const { publicClient, walletClient } = createL1Clients(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, mnemonicIndex);
6
- const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress, 'canonical');
5
+ const extendedClient = createExtendedL1Client(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, undefined, mnemonicIndex);
6
+ const addresses = await RegistryContract.collectAddresses(extendedClient, registryAddress, 'canonical');
7
7
  const governanceAddress = addresses.governanceAddress.toString();
8
- const tokenAddress = addresses.feeJuiceAddress.toString();
9
- const feeJuice = new FeeJuiceContract(tokenAddress, publicClient, walletClient);
10
- const governance = new GovernanceContract(governanceAddress, publicClient, walletClient);
8
+ const tokenAddress = addresses.stakingAssetAddress.toString();
9
+ const feeJuice = new FeeJuiceContract(tokenAddress, extendedClient);
10
+ const governance = new GovernanceContract(governanceAddress, extendedClient);
11
11
  if (mint) {
12
12
  await feeJuice.mint(recipient, amount);
13
13
  debugLogger.info(`Minted ${amount} tokens to ${recipient}`);
@@ -20,17 +20,17 @@ export async function depositGovernanceTokens({ registryAddress, rpcUrls, chainI
20
20
  export async function proposeWithLock({ payloadAddress, registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, json, debugLogger, log }) {
21
21
  debugLogger.info(`Proposing with lock from ${payloadAddress} to ${registryAddress}`);
22
22
  const chain = createEthereumChain(rpcUrls, chainId);
23
- const clients = createL1Clients(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, mnemonicIndex);
24
- const addresses = await RegistryContract.collectAddresses(clients.publicClient, registryAddress, 'canonical');
23
+ const client = createExtendedL1Client(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, undefined, mnemonicIndex);
24
+ const addresses = await RegistryContract.collectAddresses(client, registryAddress, 'canonical');
25
25
  const governanceAddress = addresses.governanceAddress.toString();
26
- const governance = new GovernanceContract(governanceAddress, clients.publicClient, clients.walletClient);
26
+ const governance = new GovernanceContract(governanceAddress, client);
27
27
  const proposalId = await governance.proposeWithLock({
28
28
  payloadAddress,
29
- withdrawAddress: clients.walletClient.account.address
29
+ withdrawAddress: client.account.address
30
30
  });
31
31
  if (json) {
32
32
  log(JSON.stringify({
33
- proposalId
33
+ proposalId: Number(proposalId)
34
34
  }, null, 2));
35
35
  } else {
36
36
  log(`Proposed with lock`);
@@ -40,10 +40,10 @@ export async function proposeWithLock({ payloadAddress, registryAddress, rpcUrls
40
40
  export async function voteOnGovernanceProposal({ proposalId, voteAmount, inFavor, waitTilActive, registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, debugLogger }) {
41
41
  debugLogger.info(`Voting on proposal ${proposalId} with ${voteAmount ? voteAmount : 'all'} tokens in favor: ${inFavor}`);
42
42
  const chain = createEthereumChain(rpcUrls, chainId);
43
- const clients = createL1Clients(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, mnemonicIndex);
44
- const addresses = await RegistryContract.collectAddresses(clients.publicClient, registryAddress, 'canonical');
43
+ const client = createExtendedL1Client(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, undefined, mnemonicIndex);
44
+ const addresses = await RegistryContract.collectAddresses(client, registryAddress, 'canonical');
45
45
  const governanceAddress = addresses.governanceAddress.toString();
46
- const governance = new GovernanceContract(governanceAddress, clients.publicClient, clients.walletClient);
46
+ const governance = new GovernanceContract(governanceAddress, client);
47
47
  const state = await governance.getProposalState(proposalId);
48
48
  if (state !== ProposalState.Active && !waitTilActive) {
49
49
  debugLogger.warn(`Proposal is not active, but waitTilActive is false. Not voting.`);
@@ -64,10 +64,10 @@ export async function voteOnGovernanceProposal({ proposalId, voteAmount, inFavor
64
64
  export async function executeGovernanceProposal({ proposalId, waitTilExecutable, registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, debugLogger }) {
65
65
  debugLogger.info(`Executing proposal ${proposalId}`);
66
66
  const chain = createEthereumChain(rpcUrls, chainId);
67
- const clients = createL1Clients(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, mnemonicIndex);
68
- const addresses = await RegistryContract.collectAddresses(clients.publicClient, registryAddress, 'canonical');
67
+ const client = createExtendedL1Client(rpcUrls, privateKey ?? mnemonic, chain.chainInfo, undefined, mnemonicIndex);
68
+ const addresses = await RegistryContract.collectAddresses(client, registryAddress, 'canonical');
69
69
  const governanceAddress = addresses.governanceAddress.toString();
70
- const governance = new GovernanceContract(governanceAddress, clients.publicClient, clients.walletClient);
70
+ const governance = new GovernanceContract(governanceAddress, client);
71
71
  const state = await governance.getProposalState(proposalId);
72
72
  if (state !== ProposalState.Executable && !waitTilExecutable) {
73
73
  debugLogger.warn(`Proposal is not executable, but waitTilExecutable is false. Not executing.`);
@@ -1,4 +1,5 @@
1
1
  import type { LogFn, Logger } from '@aztec/foundation/log';
2
2
  import { type Command } from 'commander';
3
+ export { addL1Validator } from './update_l1_validators.js';
3
4
  export declare function injectCommands(program: Command, log: LogFn, debugLogger: Logger): Command;
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAsBjD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAohB/E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAcjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAa3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAof/E"}