@aztec/cli 0.0.0-test.1 → 0.0.1-commit.21caa21
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/README.md +2 -428
- package/dest/cmds/aztec_node/block_number.d.ts +3 -0
- package/dest/cmds/aztec_node/block_number.d.ts.map +1 -0
- package/dest/cmds/aztec_node/block_number.js +10 -0
- package/dest/cmds/aztec_node/get_block.d.ts +3 -0
- package/dest/cmds/aztec_node/get_block.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_block.js +9 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts +3 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_current_base_fee.js +7 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +5 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.js +12 -0
- package/dest/cmds/aztec_node/get_logs.d.ts +6 -0
- package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_logs.js +4 -4
- package/dest/cmds/aztec_node/get_node_info.d.ts +3 -0
- package/dest/cmds/aztec_node/get_node_info.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_node_info.js +14 -15
- package/dest/cmds/aztec_node/index.d.ts +4 -0
- package/dest/cmds/aztec_node/index.d.ts.map +1 -0
- package/dest/cmds/aztec_node/index.js +28 -0
- package/dest/cmds/contracts/index.d.ts +1 -1
- package/dest/cmds/contracts/inspect_contract.d.ts +1 -1
- package/dest/cmds/contracts/inspect_contract.d.ts.map +1 -1
- package/dest/cmds/contracts/inspect_contract.js +12 -14
- package/dest/cmds/contracts/parse_parameter_struct.d.ts +1 -1
- package/dest/cmds/infrastructure/index.d.ts +3 -3
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +8 -9
- package/dest/cmds/infrastructure/sequencers.d.ts +5 -5
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +29 -16
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts +2 -2
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.js +11 -24
- package/dest/cmds/l1/advance_epoch.d.ts +2 -2
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +8 -6
- package/dest/cmds/l1/assume_proven_through.d.ts +2 -2
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
- package/dest/cmds/l1/assume_proven_through.js +9 -8
- package/dest/cmds/l1/bridge_erc20.d.ts +3 -3
- package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
- package/dest/cmds/l1/bridge_erc20.js +5 -5
- package/dest/cmds/l1/create_l1_account.d.ts +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.d.ts +3 -3
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.js +23 -6
- package/dest/cmds/l1/deploy_new_rollup.d.ts +3 -2
- package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_new_rollup.js +17 -8
- package/dest/cmds/l1/get_l1_addresses.d.ts +2 -2
- package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
- package/dest/cmds/l1/get_l1_balance.d.ts +1 -1
- package/dest/cmds/l1/governance_utils.d.ts +5 -5
- package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
- package/dest/cmds/l1/governance_utils.js +17 -17
- package/dest/cmds/l1/index.d.ts +2 -1
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +33 -43
- package/dest/cmds/l1/prover_stats.d.ts +1 -1
- package/dest/cmds/l1/prover_stats.d.ts.map +1 -1
- package/dest/cmds/l1/prover_stats.js +28 -28
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts +6 -0
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -0
- package/dest/cmds/l1/trigger_seed_snapshot.js +19 -0
- package/dest/cmds/l1/update_l1_validators.d.ts +21 -6
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +159 -103
- package/dest/cmds/misc/compute_selector.d.ts +1 -1
- package/dest/cmds/misc/example_contracts.d.ts +1 -1
- package/dest/cmds/misc/generate_bootnode_enr.d.ts +2 -2
- 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/generate_p2p_private_key.d.ts +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.d.ts +2 -2
- package/dest/cmds/misc/generate_secret_and_hash.d.ts.map +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.js +3 -3
- package/dest/cmds/misc/generate_secret_key.d.ts +2 -2
- package/dest/cmds/misc/generate_secret_key.d.ts.map +1 -1
- package/dest/cmds/misc/generate_secret_key.js +1 -1
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts +3 -0
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts.map +1 -0
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.js +4 -0
- package/dest/cmds/misc/index.d.ts +1 -1
- package/dest/cmds/misc/index.d.ts.map +1 -1
- package/dest/cmds/misc/index.js +7 -3
- package/dest/cmds/misc/update/common.d.ts +1 -1
- package/dest/cmds/misc/update/github.d.ts +1 -2
- 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/noir.d.ts +1 -1
- package/dest/cmds/misc/update/npm.d.ts +1 -1
- package/dest/cmds/misc/update/npm.js +1 -1
- package/dest/cmds/misc/update/utils.d.ts +1 -1
- package/dest/cmds/misc/update.d.ts +1 -1
- package/dest/cmds/misc/update.d.ts.map +1 -1
- package/dest/cmds/misc/update.js +2 -3
- package/dest/cmds/validator_keys/add.d.ts +5 -0
- package/dest/cmds/validator_keys/add.d.ts.map +1 -0
- package/dest/cmds/validator_keys/add.js +83 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.d.ts +12 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.d.ts.map +1 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.js +27 -0
- package/dest/cmds/validator_keys/index.d.ts +4 -0
- package/dest/cmds/validator_keys/index.d.ts.map +1 -0
- package/dest/cmds/validator_keys/index.js +32 -0
- package/dest/cmds/validator_keys/new.d.ts +29 -0
- package/dest/cmds/validator_keys/new.d.ts.map +1 -0
- package/dest/cmds/validator_keys/new.js +131 -0
- package/dest/cmds/validator_keys/shared.d.ts +68 -0
- package/dest/cmds/validator_keys/shared.d.ts.map +1 -0
- package/dest/cmds/validator_keys/shared.js +273 -0
- package/dest/cmds/validator_keys/staker.d.ts +38 -0
- package/dest/cmds/validator_keys/staker.d.ts.map +1 -0
- package/dest/cmds/validator_keys/staker.js +207 -0
- package/dest/cmds/validator_keys/utils.d.ts +25 -0
- package/dest/cmds/validator_keys/utils.d.ts.map +1 -0
- package/dest/cmds/validator_keys/utils.js +52 -0
- package/dest/config/cached_fetch.d.ts +18 -0
- package/dest/config/cached_fetch.d.ts.map +1 -0
- package/dest/config/cached_fetch.js +54 -0
- package/dest/config/chain_l2_config.d.ts +40 -0
- package/dest/config/chain_l2_config.d.ts.map +1 -0
- package/dest/config/chain_l2_config.js +505 -0
- package/dest/config/enrich_env.d.ts +4 -0
- package/dest/config/enrich_env.d.ts.map +1 -0
- package/dest/config/enrich_env.js +12 -0
- package/dest/config/get_l1_config.d.ts +8 -0
- package/dest/config/get_l1_config.d.ts.map +1 -0
- package/dest/config/get_l1_config.js +22 -0
- package/dest/config/index.d.ts +5 -0
- package/dest/config/index.d.ts.map +1 -0
- package/dest/config/index.js +4 -0
- package/dest/config/network_config.d.ts +19 -0
- package/dest/config/network_config.d.ts.map +1 -0
- package/dest/config/network_config.js +93 -0
- package/dest/utils/aztec.d.ts +13 -18
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +54 -49
- package/dest/utils/commands.d.ts +19 -11
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +40 -14
- package/dest/utils/encoding.d.ts +1 -1
- package/dest/utils/encoding.js +1 -1
- package/dest/utils/github.d.ts +1 -2
- package/dest/utils/github.d.ts.map +1 -1
- package/dest/utils/github.js +0 -1
- package/dest/utils/index.d.ts +2 -1
- package/dest/utils/index.d.ts.map +1 -1
- package/dest/utils/index.js +1 -0
- package/dest/utils/inspect.d.ts +4 -11
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +19 -109
- package/dest/utils/setup_contracts.d.ts +3 -0
- package/dest/utils/setup_contracts.d.ts.map +1 -0
- package/dest/utils/setup_contracts.js +16 -0
- package/package.json +52 -36
- package/public_include_metric_prefixes.json +1 -0
- package/src/cmds/aztec_node/block_number.ts +9 -0
- package/src/cmds/aztec_node/get_block.ts +10 -0
- package/src/cmds/aztec_node/get_current_base_fee.ts +9 -0
- package/src/cmds/aztec_node/get_l1_to_l2_message_witness.ts +27 -0
- package/src/cmds/{pxe → aztec_node}/get_logs.ts +8 -7
- package/src/cmds/{pxe → aztec_node}/get_node_info.ts +15 -23
- package/src/cmds/aztec_node/index.ts +87 -0
- package/src/cmds/contracts/inspect_contract.ts +19 -16
- package/src/cmds/infrastructure/index.ts +8 -10
- package/src/cmds/infrastructure/sequencers.ts +36 -19
- package/src/cmds/infrastructure/setup_l2_contract.ts +13 -25
- package/src/cmds/l1/advance_epoch.ts +7 -5
- package/src/cmds/l1/assume_proven_through.ts +8 -7
- package/src/cmds/l1/bridge_erc20.ts +7 -4
- package/src/cmds/l1/deploy_l1_contracts.ts +32 -7
- package/src/cmds/l1/deploy_new_rollup.ts +23 -9
- package/src/cmds/l1/get_l1_addresses.ts +1 -1
- package/src/cmds/l1/governance_utils.ts +18 -17
- package/src/cmds/l1/index.ts +74 -101
- package/src/cmds/l1/prover_stats.ts +36 -29
- package/src/cmds/l1/trigger_seed_snapshot.ts +31 -0
- package/src/cmds/l1/update_l1_validators.ts +194 -94
- package/src/cmds/misc/generate_bootnode_enr.ts +3 -2
- package/src/cmds/misc/generate_secret_and_hash.ts +3 -3
- package/src/cmds/misc/generate_secret_key.ts +1 -1
- package/src/cmds/misc/get_canonical_sponsored_fpc_address.ts +7 -0
- package/src/cmds/misc/index.ts +13 -4
- package/src/cmds/misc/update/github.ts +0 -1
- package/src/cmds/misc/update/npm.ts +1 -1
- package/src/cmds/misc/update.ts +1 -7
- package/src/cmds/validator_keys/add.ts +123 -0
- package/src/cmds/validator_keys/generate_bls_keypair.ts +34 -0
- package/src/cmds/validator_keys/index.ts +142 -0
- package/src/cmds/validator_keys/new.ts +206 -0
- package/src/cmds/validator_keys/shared.ts +325 -0
- package/src/cmds/validator_keys/staker.ts +300 -0
- package/src/cmds/validator_keys/utils.ts +80 -0
- package/src/config/cached_fetch.ts +67 -0
- package/src/config/chain_l2_config.ts +668 -0
- package/src/config/enrich_env.ts +15 -0
- package/src/config/get_l1_config.ts +28 -0
- package/src/config/index.ts +4 -0
- package/src/config/network_config.ts +123 -0
- package/src/utils/aztec.ts +78 -65
- package/src/utils/commands.ts +54 -18
- package/src/utils/encoding.ts +1 -1
- package/src/utils/github.ts +0 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/inspect.ts +23 -123
- package/src/utils/setup_contracts.ts +19 -0
- package/dest/cmds/devnet/bootstrap_network.d.ts +0 -3
- package/dest/cmds/devnet/bootstrap_network.d.ts.map +0 -1
- package/dest/cmds/devnet/bootstrap_network.js +0 -196
- package/dest/cmds/devnet/faucet.d.ts +0 -4
- package/dest/cmds/devnet/faucet.d.ts.map +0 -1
- package/dest/cmds/devnet/faucet.js +0 -26
- package/dest/cmds/devnet/index.d.ts +0 -4
- package/dest/cmds/devnet/index.d.ts.map +0 -1
- package/dest/cmds/devnet/index.js +0 -14
- package/dest/cmds/l1/deploy_l1_verifier.d.ts +0 -5
- package/dest/cmds/l1/deploy_l1_verifier.d.ts.map +0 -1
- package/dest/cmds/l1/deploy_l1_verifier.js +0 -54
- package/dest/cmds/misc/setup_contracts.d.ts +0 -7
- package/dest/cmds/misc/setup_contracts.d.ts.map +0 -1
- package/dest/cmds/misc/setup_contracts.js +0 -27
- package/dest/cmds/pxe/add_contract.d.ts +0 -5
- package/dest/cmds/pxe/add_contract.d.ts.map +0 -1
- package/dest/cmds/pxe/add_contract.js +0 -29
- package/dest/cmds/pxe/block_number.d.ts +0 -3
- package/dest/cmds/pxe/block_number.d.ts.map +0 -1
- package/dest/cmds/pxe/block_number.js +0 -10
- package/dest/cmds/pxe/get_account.d.ts +0 -4
- package/dest/cmds/pxe/get_account.d.ts.map +0 -1
- package/dest/cmds/pxe/get_account.js +0 -10
- package/dest/cmds/pxe/get_accounts.d.ts +0 -3
- package/dest/cmds/pxe/get_accounts.d.ts.map +0 -1
- package/dest/cmds/pxe/get_accounts.js +0 -25
- package/dest/cmds/pxe/get_block.d.ts +0 -3
- package/dest/cmds/pxe/get_block.d.ts.map +0 -1
- package/dest/cmds/pxe/get_block.js +0 -9
- package/dest/cmds/pxe/get_contract_data.d.ts +0 -4
- package/dest/cmds/pxe/get_contract_data.d.ts.map +0 -1
- package/dest/cmds/pxe/get_contract_data.js +0 -31
- package/dest/cmds/pxe/get_current_base_fee.d.ts +0 -3
- package/dest/cmds/pxe/get_current_base_fee.d.ts.map +0 -1
- package/dest/cmds/pxe/get_current_base_fee.js +0 -7
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts +0 -4
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts.map +0 -1
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.js +0 -11
- package/dest/cmds/pxe/get_logs.d.ts +0 -4
- package/dest/cmds/pxe/get_logs.d.ts.map +0 -1
- package/dest/cmds/pxe/get_node_info.d.ts +0 -3
- package/dest/cmds/pxe/get_node_info.d.ts.map +0 -1
- package/dest/cmds/pxe/get_pxe_info.d.ts +0 -3
- package/dest/cmds/pxe/get_pxe_info.d.ts.map +0 -1
- package/dest/cmds/pxe/get_pxe_info.js +0 -11
- package/dest/cmds/pxe/index.d.ts +0 -4
- package/dest/cmds/pxe/index.d.ts.map +0 -1
- package/dest/cmds/pxe/index.js +0 -55
- package/src/cmds/devnet/bootstrap_network.ts +0 -318
- package/src/cmds/devnet/faucet.ts +0 -33
- package/src/cmds/devnet/index.ts +0 -60
- package/src/cmds/l1/deploy_l1_verifier.ts +0 -105
- package/src/cmds/misc/setup_contracts.ts +0 -40
- package/src/cmds/pxe/add_contract.ts +0 -41
- package/src/cmds/pxe/block_number.ts +0 -9
- package/src/cmds/pxe/get_account.ts +0 -16
- package/src/cmds/pxe/get_accounts.ts +0 -35
- package/src/cmds/pxe/get_block.ts +0 -10
- package/src/cmds/pxe/get_contract_data.ts +0 -51
- package/src/cmds/pxe/get_current_base_fee.ts +0 -9
- package/src/cmds/pxe/get_l1_to_l2_message_witness.ts +0 -25
- package/src/cmds/pxe/get_pxe_info.ts +0 -13
- package/src/cmds/pxe/index.ts +0 -170
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
|
+
|
|
3
|
+
import type { Command } from 'commander';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
logJson,
|
|
7
|
+
nodeOption,
|
|
8
|
+
parseAztecAddress,
|
|
9
|
+
parseField,
|
|
10
|
+
parseOptionalAztecAddress,
|
|
11
|
+
parseOptionalInteger,
|
|
12
|
+
parseOptionalLogId,
|
|
13
|
+
parseOptionalTxHash,
|
|
14
|
+
} from '../../utils/commands.js';
|
|
15
|
+
|
|
16
|
+
export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
|
|
17
|
+
program
|
|
18
|
+
.command('get-block')
|
|
19
|
+
.description('Gets info for a given block or latest.')
|
|
20
|
+
.argument('[blockNumber]', 'Block height', parseOptionalInteger)
|
|
21
|
+
.addOption(nodeOption)
|
|
22
|
+
.action(async (blockNumber, options) => {
|
|
23
|
+
const { getBlock } = await import('./get_block.js');
|
|
24
|
+
await getBlock(options.nodeUrl, blockNumber, log);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
program
|
|
28
|
+
.command('get-current-base-fee')
|
|
29
|
+
.description('Gets the current base fee.')
|
|
30
|
+
.addOption(nodeOption)
|
|
31
|
+
.action(async options => {
|
|
32
|
+
const { getCurrentBaseFee } = await import('./get_current_base_fee.js');
|
|
33
|
+
await getCurrentBaseFee(options.rpcUrl, debugLogger, log);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
program
|
|
37
|
+
.command('get-l1-to-l2-message-witness')
|
|
38
|
+
.description('Gets a L1 to L2 message witness.')
|
|
39
|
+
.requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress)
|
|
40
|
+
.requiredOption('--message-hash <messageHash>', 'The L1 to L2 message hash.', parseField)
|
|
41
|
+
.requiredOption('--secret <secret>', 'The secret used to claim the L1 to L2 message', parseField)
|
|
42
|
+
.addOption(nodeOption)
|
|
43
|
+
.action(async ({ contractAddress, messageHash, secret, nodeUrl }) => {
|
|
44
|
+
const { getL1ToL2MessageWitness } = await import('./get_l1_to_l2_message_witness.js');
|
|
45
|
+
await getL1ToL2MessageWitness(nodeUrl, contractAddress, messageHash, secret, log);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
program
|
|
49
|
+
.command('get-logs')
|
|
50
|
+
.description('Gets all the public logs from an intersection of all the filter params.')
|
|
51
|
+
.option('-tx, --tx-hash <txHash>', 'A transaction hash to get the receipt for.', parseOptionalTxHash)
|
|
52
|
+
.option(
|
|
53
|
+
'-fb, --from-block <blockNum>',
|
|
54
|
+
'Initial block number for getting logs (defaults to 1).',
|
|
55
|
+
parseOptionalInteger,
|
|
56
|
+
)
|
|
57
|
+
.option('-tb, --to-block <blockNum>', 'Up to which block to fetch logs (defaults to latest).', parseOptionalInteger)
|
|
58
|
+
.option('-al --after-log <logId>', 'ID of a log after which to fetch the logs.', parseOptionalLogId)
|
|
59
|
+
.option('-ca, --contract-address <address>', 'Contract address to filter logs by.', parseOptionalAztecAddress)
|
|
60
|
+
.addOption(nodeOption)
|
|
61
|
+
.option('--follow', 'If set, will keep polling for new logs until interrupted.')
|
|
62
|
+
.action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, aztecNodeRpcUrl: nodeUrl, follow }) => {
|
|
63
|
+
const { getLogs } = await import('./get_logs.js');
|
|
64
|
+
await getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, nodeUrl, follow, log);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
program
|
|
68
|
+
.command('block-number')
|
|
69
|
+
.description('Gets the current Aztec L2 block number.')
|
|
70
|
+
.addOption(nodeOption)
|
|
71
|
+
.action(async (options: any) => {
|
|
72
|
+
const { blockNumber } = await import('./block_number.js');
|
|
73
|
+
await blockNumber(options.nodeUrl, log);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
program
|
|
77
|
+
.command('get-node-info')
|
|
78
|
+
.description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.')
|
|
79
|
+
.option('--json', 'Emit output as json')
|
|
80
|
+
.addOption(nodeOption)
|
|
81
|
+
.action(async options => {
|
|
82
|
+
const { getNodeInfo } = await import('./get_node_info.js');
|
|
83
|
+
await getNodeInfo(options.nodeUrl, options.json, log, logJson(log));
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
return program;
|
|
87
|
+
}
|
|
@@ -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
|
}
|
|
@@ -26,16 +29,9 @@ export async function inspectContract(contractArtifactFile: string, debugLogger:
|
|
|
26
29
|
log(`\tpublic bytecode commitment: ${contractClass.publicBytecodeCommitment.toString()}`);
|
|
27
30
|
log(`\tpublic bytecode length: ${contractClass.packedBytecode.length} bytes (${bytecodeLengthInFields} fields)`);
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
await Promise.all(externalFunctions.map(f => logFunction(f, log)));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const internalFunctions = contractFns.filter(f => f.isInternal);
|
|
36
|
-
if (internalFunctions.length > 0) {
|
|
37
|
-
log(`\nInternal functions:`);
|
|
38
|
-
await Promise.all(internalFunctions.map(f => logFunction(f, log)));
|
|
32
|
+
if (contractFns.length > 0) {
|
|
33
|
+
log(`\nExternal contract functions:`);
|
|
34
|
+
await Promise.all(contractFns.map(f => logFunction(f, log)));
|
|
39
35
|
}
|
|
40
36
|
}
|
|
41
37
|
|
|
@@ -43,9 +39,16 @@ async function logFunction(fn: FunctionArtifact, log: LogFn) {
|
|
|
43
39
|
const signatureWithParameterNames = decodeFunctionSignatureWithParameterNames(fn.name, fn.parameters);
|
|
44
40
|
const signature = decodeFunctionSignature(fn.name, fn.parameters);
|
|
45
41
|
const selector = await FunctionSelector.fromSignature(signature);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
|
|
43
|
+
if (retainBytecode(fn)) {
|
|
44
|
+
const bytecodeSize = fn.bytecode.length;
|
|
45
|
+
const bytecodeHash = sha256(fn.bytecode).toString('hex');
|
|
46
|
+
log(
|
|
47
|
+
`${fn.functionType} ${signatureWithParameterNames} \n\tfunction signature: ${signature}\n\tselector: ${selector}\n\tbytecode: ${bytecodeSize} bytes (sha256 ${bytecodeHash})`,
|
|
48
|
+
);
|
|
49
|
+
} else {
|
|
50
|
+
log(
|
|
51
|
+
`${fn.functionType} ${signatureWithParameterNames} \n\tfunction signature: ${signature}\n\tselector: ${selector}`,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
51
54
|
}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import type { LogFn
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
2
|
|
|
3
3
|
import type { Command } from 'commander';
|
|
4
4
|
|
|
5
|
-
import { ETHEREUM_HOSTS, l1ChainIdOption,
|
|
5
|
+
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseOptionalInteger } from '../../utils/commands.js';
|
|
6
6
|
|
|
7
|
-
export function injectCommands(program: Command, log: LogFn
|
|
7
|
+
export function injectCommands(program: Command, log: LogFn) {
|
|
8
8
|
program
|
|
9
9
|
.command('setup-protocol-contracts')
|
|
10
10
|
.description('Bootstrap the blockchain by initializing all the protocol contracts')
|
|
11
|
-
.addOption(
|
|
11
|
+
.addOption(nodeOption)
|
|
12
12
|
.option('--testAccounts', 'Deploy funded test accounts.')
|
|
13
13
|
.option('--json', 'Output the contract addresses in JSON format')
|
|
14
|
-
.option('--skipProofWait', "Don't wait for proofs to land.")
|
|
15
14
|
.action(async options => {
|
|
16
15
|
const { setupL2Contracts } = await import('./setup_l2_contract.js');
|
|
17
|
-
await setupL2Contracts(options.
|
|
16
|
+
await setupL2Contracts(options.nodeUrl, options.testAccounts, options.json, log);
|
|
18
17
|
});
|
|
19
18
|
|
|
20
19
|
program
|
|
@@ -34,7 +33,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
34
33
|
'test test test test test test test test test test test junk',
|
|
35
34
|
)
|
|
36
35
|
.option('--block-number <number>', 'Block number to query next sequencer for', parseOptionalInteger)
|
|
37
|
-
.addOption(
|
|
36
|
+
.addOption(nodeOption)
|
|
38
37
|
.addOption(l1ChainIdOption)
|
|
39
38
|
.action(async (command, who, options) => {
|
|
40
39
|
const { sequencers } = await import('./sequencers.js');
|
|
@@ -42,12 +41,11 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
42
41
|
command: command,
|
|
43
42
|
who,
|
|
44
43
|
mnemonic: options.mnemonic,
|
|
45
|
-
|
|
46
|
-
l1RpcUrls: options.l1RpcUrls
|
|
44
|
+
nodeUrl: options.nodeUrl,
|
|
45
|
+
l1RpcUrls: options.l1RpcUrls,
|
|
47
46
|
chainId: options.l1ChainId,
|
|
48
47
|
blockNumber: options.blockNumber,
|
|
49
48
|
log,
|
|
50
|
-
debugLogger,
|
|
51
49
|
});
|
|
52
50
|
});
|
|
53
51
|
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
2
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
3
|
+
import { GSEContract, RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
4
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
4
5
|
import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
5
6
|
|
|
6
7
|
import { createPublicClient, createWalletClient, fallback, getContract, http } from 'viem';
|
|
7
8
|
import { mnemonicToAccount } from 'viem/accounts';
|
|
8
9
|
|
|
9
10
|
export async function sequencers(opts: {
|
|
10
|
-
command: 'list' | 'add' | 'remove' | 'who-next';
|
|
11
|
+
command: 'list' | 'add' | 'remove' | 'who-next' | 'flush';
|
|
11
12
|
who?: string;
|
|
12
13
|
mnemonic?: string;
|
|
13
|
-
|
|
14
|
+
bn254SecretKey?: bigint;
|
|
15
|
+
nodeUrl: string;
|
|
14
16
|
l1RpcUrls: string[];
|
|
15
17
|
chainId: number;
|
|
16
18
|
blockNumber?: number;
|
|
17
19
|
log: LogFn;
|
|
18
|
-
debugLogger: Logger;
|
|
19
20
|
}) {
|
|
20
|
-
const { command, who: maybeWho, mnemonic,
|
|
21
|
-
const client =
|
|
21
|
+
const { command, who: maybeWho, mnemonic, bn254SecretKey, nodeUrl, l1RpcUrls, chainId, log } = opts;
|
|
22
|
+
const client = createAztecNodeClient(nodeUrl);
|
|
22
23
|
const { l1ContractAddresses } = await client.getNodeInfo();
|
|
23
24
|
|
|
24
25
|
const chain = createEthereumChain(l1RpcUrls, chainId);
|
|
@@ -35,11 +36,7 @@ export async function sequencers(opts: {
|
|
|
35
36
|
})
|
|
36
37
|
: undefined;
|
|
37
38
|
|
|
38
|
-
const rollup =
|
|
39
|
-
address: l1ContractAddresses.rollupAddress.toString(),
|
|
40
|
-
abi: RollupAbi,
|
|
41
|
-
client: publicClient,
|
|
42
|
-
});
|
|
39
|
+
const rollup = new RollupContract(publicClient, l1ContractAddresses.rollupAddress);
|
|
43
40
|
|
|
44
41
|
const writeableRollup = walletClient
|
|
45
42
|
? getContract({
|
|
@@ -52,7 +49,7 @@ export async function sequencers(opts: {
|
|
|
52
49
|
const who = (maybeWho as `0x{string}`) ?? walletClient?.account.address.toString();
|
|
53
50
|
|
|
54
51
|
if (command === 'list') {
|
|
55
|
-
const sequencers = await rollup.
|
|
52
|
+
const sequencers = await rollup.getAttesters();
|
|
56
53
|
if (sequencers.length === 0) {
|
|
57
54
|
log(`No sequencers registered on rollup`);
|
|
58
55
|
} else {
|
|
@@ -69,23 +66,43 @@ export async function sequencers(opts: {
|
|
|
69
66
|
log(`Adding ${who} as sequencer`);
|
|
70
67
|
|
|
71
68
|
const stakingAsset = getContract({
|
|
72
|
-
address: await rollup.
|
|
69
|
+
address: await rollup.getStakingAsset(),
|
|
73
70
|
abi: TestERC20Abi,
|
|
74
71
|
client: walletClient,
|
|
75
72
|
});
|
|
76
73
|
|
|
77
74
|
const config = getL1ContractsConfigEnvVars();
|
|
78
75
|
|
|
76
|
+
const bn254SecretKeyFieldElement = bn254SecretKey ? new Fr(bn254SecretKey) : Fr.random();
|
|
77
|
+
const gseAddress = await rollup.getGSE();
|
|
78
|
+
const gseContract = new GSEContract(publicClient, gseAddress);
|
|
79
|
+
const registrationTuple = await gseContract.makeRegistrationTuple(bn254SecretKeyFieldElement.toBigInt());
|
|
80
|
+
|
|
79
81
|
await Promise.all(
|
|
80
82
|
[
|
|
81
|
-
await stakingAsset.write.mint([walletClient.account.address, config.
|
|
82
|
-
await stakingAsset.write.approve([rollup.address, config.
|
|
83
|
+
await stakingAsset.write.mint([walletClient.account.address, config.activationThreshold], {} as any),
|
|
84
|
+
await stakingAsset.write.approve([rollup.address, config.activationThreshold], {} as any),
|
|
83
85
|
].map(txHash => publicClient.waitForTransactionReceipt({ hash: txHash })),
|
|
84
86
|
);
|
|
85
87
|
|
|
86
|
-
const hash = await writeableRollup.write.deposit([
|
|
88
|
+
const hash = await writeableRollup.write.deposit([
|
|
89
|
+
who,
|
|
90
|
+
who,
|
|
91
|
+
registrationTuple.publicKeyInG1,
|
|
92
|
+
registrationTuple.publicKeyInG2,
|
|
93
|
+
registrationTuple.proofOfPossession,
|
|
94
|
+
true,
|
|
95
|
+
]);
|
|
87
96
|
await publicClient.waitForTransactionReceipt({ hash });
|
|
88
97
|
log(`Added in tx ${hash}`);
|
|
98
|
+
} else if (command === 'flush') {
|
|
99
|
+
if (!writeableRollup) {
|
|
100
|
+
throw new Error(`Missing sequencer address`);
|
|
101
|
+
}
|
|
102
|
+
log(`Flushing staking entry queue`);
|
|
103
|
+
const hash = await writeableRollup.write.flushEntryQueue();
|
|
104
|
+
await publicClient.waitForTransactionReceipt({ hash });
|
|
105
|
+
log(`Flushed staking entry queue in tx ${hash}`);
|
|
89
106
|
} else if (command === 'remove') {
|
|
90
107
|
if (!who || !writeableRollup) {
|
|
91
108
|
throw new Error(`Missing sequencer address`);
|
|
@@ -95,7 +112,7 @@ export async function sequencers(opts: {
|
|
|
95
112
|
await publicClient.waitForTransactionReceipt({ hash });
|
|
96
113
|
log(`Removed in tx ${hash}`);
|
|
97
114
|
} else if (command === 'who-next') {
|
|
98
|
-
const next = await rollup.
|
|
115
|
+
const next = await rollup.getCurrentProposer();
|
|
99
116
|
log(`Sequencer expected to build is ${next}`);
|
|
100
117
|
} else {
|
|
101
118
|
throw new Error(`Unknown command ${command}`);
|
|
@@ -1,45 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
+
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
+
import type { WaitOpts } from '@aztec/aztec.js/contracts';
|
|
4
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
5
|
+
import { AccountManager } from '@aztec/aztec.js/wallet';
|
|
3
6
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
7
|
import type { LogFn } from '@aztec/foundation/log';
|
|
5
8
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
9
|
+
import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet/server';
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export async function setupL2Contracts(
|
|
10
|
-
rpcUrl: string,
|
|
11
|
-
testAccounts: boolean,
|
|
12
|
-
json: boolean,
|
|
13
|
-
skipProofWait: boolean,
|
|
14
|
-
log: LogFn,
|
|
15
|
-
) {
|
|
11
|
+
export async function setupL2Contracts(nodeUrl: string, testAccounts: boolean, json: boolean, log: LogFn) {
|
|
16
12
|
const waitOpts: WaitOpts = {
|
|
17
13
|
timeout: 180,
|
|
18
14
|
interval: 1,
|
|
19
|
-
proven: !skipProofWait,
|
|
20
|
-
provenTimeout: 600,
|
|
21
15
|
};
|
|
22
16
|
log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
|
|
23
17
|
log('setupL2Contracts: Creating PXE client...');
|
|
24
|
-
const
|
|
25
|
-
const wallet =
|
|
26
|
-
|
|
27
|
-
log('setupL2Contracts: Getting fee juice portal address...');
|
|
28
|
-
// Deploy Fee Juice
|
|
29
|
-
const feeJuicePortalAddress = (await wallet.getNodeInfo()).l1ContractAddresses.feeJuicePortalAddress;
|
|
30
|
-
log('setupL2Contracts: Setting up fee juice portal...');
|
|
31
|
-
await setupCanonicalL2FeeJuice(wallet, feeJuicePortalAddress, waitOpts, log);
|
|
18
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
19
|
+
const wallet = await TestWallet.create(node);
|
|
32
20
|
|
|
33
|
-
let
|
|
21
|
+
let deployedAccountManagers: AccountManager[] = [];
|
|
34
22
|
if (testAccounts) {
|
|
35
23
|
log('setupL2Contracts: Deploying test accounts...');
|
|
36
|
-
|
|
37
|
-
await deployFundedSchnorrAccounts(
|
|
24
|
+
const initialAccountsData = await getInitialTestAccountsData();
|
|
25
|
+
deployedAccountManagers = await deployFundedSchnorrAccounts(wallet, node, initialAccountsData, waitOpts);
|
|
38
26
|
}
|
|
39
27
|
|
|
40
28
|
if (json) {
|
|
41
29
|
const toPrint: Record<string, AztecAddress> = { ...ProtocolContractAddress };
|
|
42
|
-
|
|
30
|
+
deployedAccountManagers.forEach((a, i) => {
|
|
43
31
|
toPrint[`testAccount${i}`] = a.address;
|
|
44
32
|
});
|
|
45
33
|
log(JSON.stringify(toPrint, null, 2));
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
2
|
+
import { RollupCheatCodes } from '@aztec/ethereum/test';
|
|
2
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
|
+
import { DateProvider } from '@aztec/foundation/timer';
|
|
3
5
|
|
|
4
|
-
export async function advanceEpoch(l1RpcUrls: string[],
|
|
5
|
-
const
|
|
6
|
-
const rollupAddress = await
|
|
6
|
+
export async function advanceEpoch(l1RpcUrls: string[], nodeUrl: string, log: LogFn) {
|
|
7
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
8
|
+
const rollupAddress = await aztecNode.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
|
|
7
9
|
|
|
8
|
-
const cheat =
|
|
10
|
+
const cheat = RollupCheatCodes.create(l1RpcUrls, { rollupAddress }, new DateProvider());
|
|
9
11
|
|
|
10
12
|
await cheat.advanceToNextEpoch();
|
|
11
13
|
log(`Warped time to advance to next epoch`);
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
2
|
+
import { RollupCheatCodes } from '@aztec/ethereum/test';
|
|
2
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
|
+
import { DateProvider } from '@aztec/foundation/timer';
|
|
3
5
|
|
|
4
6
|
export async function assumeProvenThrough(
|
|
5
7
|
blockNumberOrLatest: number | undefined,
|
|
6
8
|
l1RpcUrls: string[],
|
|
7
|
-
|
|
9
|
+
nodeUrl: string,
|
|
8
10
|
log: LogFn,
|
|
9
11
|
) {
|
|
10
|
-
const
|
|
11
|
-
const rollupAddress = await
|
|
12
|
-
const blockNumber = blockNumberOrLatest ?? (await
|
|
12
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
13
|
+
const rollupAddress = await aztecNode.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
|
|
14
|
+
const blockNumber = blockNumberOrLatest ?? (await aztecNode.getBlockNumber());
|
|
13
15
|
|
|
14
|
-
const
|
|
15
|
-
const rollupCheatCodes = new RollupCheatCodes(ethCheatCode, { rollupAddress });
|
|
16
|
+
const rollupCheatCodes = RollupCheatCodes.create(l1RpcUrls, { rollupAddress }, new DateProvider());
|
|
16
17
|
|
|
17
18
|
await rollupCheatCodes.markAsProven(blockNumber);
|
|
18
19
|
log(`Assumed proven through block ${blockNumber}`);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { L1ToL2TokenPortalManager } from '@aztec/aztec.js/ethereum';
|
|
3
|
+
import type { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
+
import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
|
|
3
5
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
4
6
|
|
|
5
7
|
import { prettyPrintJSON } from '../../utils/commands.js';
|
|
@@ -12,6 +14,7 @@ export async function bridgeERC20(
|
|
|
12
14
|
privateKey: string | undefined,
|
|
13
15
|
mnemonic: string,
|
|
14
16
|
tokenAddress: EthAddress,
|
|
17
|
+
handlerAddress: EthAddress | undefined,
|
|
15
18
|
portalAddress: EthAddress,
|
|
16
19
|
privateTransfer: boolean,
|
|
17
20
|
mint: boolean,
|
|
@@ -21,10 +24,10 @@ export async function bridgeERC20(
|
|
|
21
24
|
) {
|
|
22
25
|
// Prepare L1 client
|
|
23
26
|
const chain = createEthereumChain(l1RpcUrls, chainId);
|
|
24
|
-
const
|
|
27
|
+
const l1Client = createExtendedL1Client(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
|
|
25
28
|
|
|
26
29
|
// Setup portal manager
|
|
27
|
-
const manager = new L1ToL2TokenPortalManager(portalAddress, tokenAddress,
|
|
30
|
+
const manager = new L1ToL2TokenPortalManager(portalAddress, tokenAddress, handlerAddress, l1Client, debugLogger);
|
|
28
31
|
let claimSecret: Fr;
|
|
29
32
|
let messageHash: `0x${string}`;
|
|
30
33
|
if (privateTransfer) {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
+
import type { EthAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
2
4
|
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
3
|
-
import
|
|
5
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
4
6
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
5
7
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
6
8
|
|
|
7
9
|
import { deployAztecContracts } from '../../utils/aztec.js';
|
|
10
|
+
import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
|
|
8
11
|
|
|
9
12
|
export async function deployL1Contracts(
|
|
10
13
|
rpcUrls: string[],
|
|
@@ -14,16 +17,28 @@ export async function deployL1Contracts(
|
|
|
14
17
|
mnemonicIndex: number,
|
|
15
18
|
salt: number | undefined,
|
|
16
19
|
testAccounts: boolean,
|
|
20
|
+
sponsoredFPC: boolean,
|
|
17
21
|
acceleratedTestDeployments: boolean,
|
|
18
22
|
json: boolean,
|
|
23
|
+
createVerificationJson: string | false,
|
|
19
24
|
initialValidators: EthAddress[],
|
|
25
|
+
realVerifier: boolean,
|
|
26
|
+
existingToken: EthAddress | undefined,
|
|
20
27
|
log: LogFn,
|
|
21
28
|
debugLogger: Logger,
|
|
22
29
|
) {
|
|
23
30
|
const config = getL1ContractsConfigEnvVars();
|
|
24
31
|
|
|
25
|
-
const
|
|
26
|
-
const
|
|
32
|
+
const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
|
|
33
|
+
const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : [];
|
|
34
|
+
const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddress);
|
|
35
|
+
const { genesisArchiveRoot, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
|
|
36
|
+
|
|
37
|
+
const initialValidatorOperators = initialValidators.map(a => ({
|
|
38
|
+
attester: a,
|
|
39
|
+
withdrawer: a,
|
|
40
|
+
bn254SecretKey: new SecretValue(Fr.random().toBigInt()),
|
|
41
|
+
}));
|
|
27
42
|
|
|
28
43
|
const { l1ContractAddresses } = await deployAztecContracts(
|
|
29
44
|
rpcUrls,
|
|
@@ -32,18 +47,21 @@ export async function deployL1Contracts(
|
|
|
32
47
|
mnemonic,
|
|
33
48
|
mnemonicIndex,
|
|
34
49
|
salt,
|
|
35
|
-
|
|
50
|
+
initialValidatorOperators,
|
|
36
51
|
genesisArchiveRoot,
|
|
37
|
-
|
|
52
|
+
fundingNeeded,
|
|
38
53
|
acceleratedTestDeployments,
|
|
39
54
|
config,
|
|
55
|
+
existingToken,
|
|
56
|
+
realVerifier,
|
|
57
|
+
createVerificationJson,
|
|
40
58
|
debugLogger,
|
|
41
59
|
);
|
|
42
60
|
|
|
43
61
|
if (json) {
|
|
44
62
|
log(
|
|
45
63
|
JSON.stringify(
|
|
46
|
-
Object.fromEntries(Object.entries(l1ContractAddresses).map(([k, v]) => [k, v
|
|
64
|
+
Object.fromEntries(Object.entries(l1ContractAddresses).map(([k, v]) => [k, v?.toString() ?? 'Not deployed'])),
|
|
47
65
|
null,
|
|
48
66
|
2,
|
|
49
67
|
),
|
|
@@ -51,6 +69,7 @@ export async function deployL1Contracts(
|
|
|
51
69
|
} else {
|
|
52
70
|
log(`Rollup Address: ${l1ContractAddresses.rollupAddress.toString()}`);
|
|
53
71
|
log(`Registry Address: ${l1ContractAddresses.registryAddress.toString()}`);
|
|
72
|
+
log(`GSE Address: ${l1ContractAddresses.gseAddress?.toString()}`);
|
|
54
73
|
log(`L1 -> L2 Inbox Address: ${l1ContractAddresses.inboxAddress.toString()}`);
|
|
55
74
|
log(`L2 -> L1 Outbox Address: ${l1ContractAddresses.outboxAddress.toString()}`);
|
|
56
75
|
log(`Fee Juice Address: ${l1ContractAddresses.feeJuiceAddress.toString()}`);
|
|
@@ -61,5 +80,11 @@ export async function deployL1Contracts(
|
|
|
61
80
|
log(`GovernanceProposer Address: ${l1ContractAddresses.governanceProposerAddress.toString()}`);
|
|
62
81
|
log(`Governance Address: ${l1ContractAddresses.governanceAddress.toString()}`);
|
|
63
82
|
log(`SlashFactory Address: ${l1ContractAddresses.slashFactoryAddress?.toString()}`);
|
|
83
|
+
log(`FeeAssetHandler Address: ${l1ContractAddresses.feeAssetHandlerAddress?.toString()}`);
|
|
84
|
+
log(`StakingAssetHandler Address: ${l1ContractAddresses.stakingAssetHandlerAddress?.toString()}`);
|
|
85
|
+
log(`ZK Passport Verifier Address: ${l1ContractAddresses.zkPassportVerifierAddress?.toString()}`);
|
|
86
|
+
log(`Initial funded accounts: ${initialFundedAccounts.map(a => a.toString()).join(', ')}`);
|
|
87
|
+
log(`Initial validators: ${initialValidators.map(a => a.toString()).join(', ')}`);
|
|
88
|
+
log(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
64
89
|
}
|
|
65
90
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
+
import { type Operator, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
3
3
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
5
5
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
6
6
|
|
|
7
7
|
import { deployNewRollupContracts } from '../../utils/aztec.js';
|
|
8
|
+
import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
|
|
8
9
|
|
|
9
10
|
export async function deployNewRollup(
|
|
10
11
|
registryAddress: EthAddress,
|
|
@@ -15,17 +16,22 @@ export async function deployNewRollup(
|
|
|
15
16
|
mnemonicIndex: number,
|
|
16
17
|
salt: number | undefined,
|
|
17
18
|
testAccounts: boolean,
|
|
19
|
+
sponsoredFPC: boolean,
|
|
18
20
|
json: boolean,
|
|
19
|
-
initialValidators:
|
|
21
|
+
initialValidators: Operator[],
|
|
22
|
+
realVerifier: boolean,
|
|
23
|
+
createVerificationJson: string | false,
|
|
20
24
|
log: LogFn,
|
|
21
25
|
debugLogger: Logger,
|
|
22
26
|
) {
|
|
23
27
|
const config = getL1ContractsConfigEnvVars();
|
|
24
28
|
|
|
25
|
-
const
|
|
26
|
-
const
|
|
29
|
+
const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
|
|
30
|
+
const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : [];
|
|
31
|
+
const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddress);
|
|
32
|
+
const { genesisArchiveRoot, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
|
|
27
33
|
|
|
28
|
-
const {
|
|
34
|
+
const { rollup, slashFactoryAddress } = await deployNewRollupContracts(
|
|
29
35
|
registryAddress,
|
|
30
36
|
rpcUrls,
|
|
31
37
|
chainId,
|
|
@@ -35,8 +41,10 @@ export async function deployNewRollup(
|
|
|
35
41
|
salt,
|
|
36
42
|
initialValidators,
|
|
37
43
|
genesisArchiveRoot,
|
|
38
|
-
|
|
44
|
+
fundingNeeded,
|
|
39
45
|
config,
|
|
46
|
+
realVerifier,
|
|
47
|
+
createVerificationJson,
|
|
40
48
|
debugLogger,
|
|
41
49
|
);
|
|
42
50
|
|
|
@@ -44,15 +52,21 @@ export async function deployNewRollup(
|
|
|
44
52
|
log(
|
|
45
53
|
JSON.stringify(
|
|
46
54
|
{
|
|
47
|
-
payloadAddress: payloadAddress.toString(),
|
|
48
55
|
rollupAddress: rollup.address,
|
|
56
|
+
initialFundedAccounts: initialFundedAccounts.map(a => a.toString()),
|
|
57
|
+
initialValidators: initialValidators.map(a => a.attester.toString()),
|
|
58
|
+
genesisArchiveRoot: genesisArchiveRoot.toString(),
|
|
59
|
+
slashFactoryAddress: slashFactoryAddress.toString(),
|
|
49
60
|
},
|
|
50
61
|
null,
|
|
51
62
|
2,
|
|
52
63
|
),
|
|
53
64
|
);
|
|
54
65
|
} else {
|
|
55
|
-
log(`Payload Address: ${payloadAddress.toString()}`);
|
|
56
66
|
log(`Rollup Address: ${rollup.address}`);
|
|
67
|
+
log(`Initial funded accounts: ${initialFundedAccounts.map(a => a.toString()).join(', ')}`);
|
|
68
|
+
log(`Initial validators: ${initialValidators.map(a => a.attester.toString()).join(', ')}`);
|
|
69
|
+
log(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
70
|
+
log(`Slash Factory Address: ${slashFactoryAddress.toString()}`);
|
|
57
71
|
}
|
|
58
72
|
}
|