@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.
- package/dest/cmds/contracts/inspect_contract.d.ts.map +1 -1
- package/dest/cmds/contracts/inspect_contract.js +9 -5
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +3 -3
- package/dest/cmds/infrastructure/sequencers.d.ts +2 -1
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +27 -15
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.js +14 -12
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +3 -2
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
- package/dest/cmds/l1/assume_proven_through.js +3 -3
- package/dest/cmds/l1/bridge_erc20.d.ts +1 -1
- package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
- package/dest/cmds/l1/bridge_erc20.js +4 -4
- package/dest/cmds/l1/deploy_l1_contracts.d.ts +2 -2
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.js +22 -5
- package/dest/cmds/l1/deploy_new_rollup.d.ts +2 -1
- package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_new_rollup.js +16 -7
- 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 +1 -0
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +29 -39
- 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 +17 -2
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +156 -101
- package/dest/cmds/misc/generate_bootnode_enr.d.ts +1 -1
- package/dest/cmds/misc/generate_bootnode_enr.d.ts.map +1 -1
- package/dest/cmds/misc/generate_bootnode_enr.js +2 -2
- package/dest/cmds/misc/generate_secret_and_hash.d.ts +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.d.ts.map +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.js +2 -2
- 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.map +1 -1
- package/dest/cmds/misc/index.js +7 -3
- package/dest/cmds/misc/update/github.d.ts +0 -1
- package/dest/cmds/misc/update/github.d.ts.map +1 -1
- package/dest/cmds/misc/update/github.js +0 -1
- package/dest/cmds/misc/update.d.ts.map +1 -1
- package/dest/cmds/misc/update.js +2 -3
- package/dest/cmds/pxe/get_contract_data.js +1 -1
- package/dest/cmds/pxe/get_node_info.d.ts.map +1 -1
- package/dest/cmds/pxe/get_node_info.js +11 -7
- package/dest/cmds/pxe/get_pxe_info.js +2 -2
- 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 +38 -0
- package/dest/config/chain_l2_config.d.ts.map +1 -0
- package/dest/config/chain_l2_config.js +376 -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 +79 -0
- package/dest/utils/aztec.d.ts +12 -11
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +52 -22
- package/dest/utils/commands.d.ts +1 -1
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +5 -5
- package/dest/utils/encoding.js +1 -1
- package/dest/utils/github.d.ts +0 -1
- package/dest/utils/github.d.ts.map +1 -1
- package/dest/utils/github.js +0 -1
- package/dest/utils/index.d.ts +1 -0
- package/dest/utils/index.d.ts.map +1 -1
- package/dest/utils/index.js +1 -0
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +18 -26
- package/dest/utils/setup_contracts.d.ts +5 -0
- package/dest/utils/setup_contracts.d.ts.map +1 -0
- package/dest/utils/setup_contracts.js +36 -0
- package/package.json +38 -32
- package/src/cmds/contracts/inspect_contract.ts +16 -6
- package/src/cmds/infrastructure/index.ts +10 -2
- package/src/cmds/infrastructure/sequencers.ts +32 -15
- package/src/cmds/infrastructure/setup_l2_contract.ts +16 -11
- package/src/cmds/l1/advance_epoch.ts +3 -2
- package/src/cmds/l1/assume_proven_through.ts +3 -3
- package/src/cmds/l1/bridge_erc20.ts +4 -3
- package/src/cmds/l1/deploy_l1_contracts.ts +30 -6
- package/src/cmds/l1/deploy_new_rollup.ts +22 -8
- package/src/cmds/l1/governance_utils.ts +18 -17
- package/src/cmds/l1/index.ts +69 -96
- package/src/cmds/l1/trigger_seed_snapshot.ts +31 -0
- package/src/cmds/l1/update_l1_validators.ts +191 -92
- package/src/cmds/misc/generate_bootnode_enr.ts +3 -2
- package/src/cmds/misc/generate_secret_and_hash.ts +2 -2
- 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.ts +1 -7
- package/src/cmds/pxe/get_contract_data.ts +1 -1
- package/src/cmds/pxe/get_node_info.ts +10 -7
- package/src/cmds/pxe/get_pxe_info.ts +2 -2
- package/src/config/cached_fetch.ts +67 -0
- package/src/config/chain_l2_config.ts +493 -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 +102 -0
- package/src/utils/aztec.ts +76 -27
- package/src/utils/commands.ts +5 -5
- 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 +18 -25
- package/src/utils/setup_contracts.ts +58 -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/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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/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,WAqD/E"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ETHEREUM_HOSTS, l1ChainIdOption, parseEthereumAddress, pxeOption } from '../../utils/commands.js';
|
|
2
|
-
export function injectCommands(program, log, debugLogger) {
|
|
3
|
-
program.command('bootstrap-network').description('Bootstrap a new network').addOption(pxeOption).addOption(l1ChainIdOption).requiredOption('--l1-rpc-urls <string>', 'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)', (arg)=>arg.split(','), [
|
|
4
|
-
ETHEREUM_HOSTS
|
|
5
|
-
]).option('--l1-private-key <string>', 'The private key to use for deployment', process.env.PRIVATE_KEY).option('-m, --mnemonic <string>', 'The mnemonic to use in deployment', 'test test test test test test test test test test test junk').option('-ai, --address-index <number>', 'The address index to use when calculating an address', (arg)=>BigInt(arg), 0n).option('--json', 'Output the result as JSON').action(async (options)=>{
|
|
6
|
-
const { bootstrapNetwork } = await import('./bootstrap_network.js');
|
|
7
|
-
await bootstrapNetwork(options[pxeOption.attributeName()], options.l1RpcUrls, options[l1ChainIdOption.attributeName()], options.l1PrivateKey, options.mnemonic, options.addressIndex, options.json, log, debugLogger);
|
|
8
|
-
});
|
|
9
|
-
program.command('drip-faucet').description('Drip the faucet').requiredOption('-u, --faucet-url <string>', 'Url of the faucet', 'http://localhost:8082').requiredOption('-t, --token <string>', 'The asset to drip', 'eth').requiredOption('-a, --address <string>', 'The Ethereum address to drip to', parseEthereumAddress).option('--json', 'Output the result as JSON').action(async (options)=>{
|
|
10
|
-
const { dripFaucet } = await import('./faucet.js');
|
|
11
|
-
await dripFaucet(options.faucetUrl, options.token, options.address, options.json, log);
|
|
12
|
-
});
|
|
13
|
-
return program;
|
|
14
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
|
-
import { type Hex } from 'viem';
|
|
3
|
-
export declare function deployUltraHonkVerifier(rollupAddress: Hex | undefined, ethRpcUrls: string[], l1ChainId: string, privateKey: string | undefined, mnemonic: string, pxeRpcUrl: string, bbBinaryPath: string, bbWorkingDirectory: string, log: LogFn, debugLogger: Logger): Promise<void>;
|
|
4
|
-
export declare function deployMockVerifier(rollupAddress: Hex | undefined, ethRpcUrls: string[], l1ChainId: string, privateKey: string | undefined, mnemonic: string, pxeRpcUrl: string, log: LogFn, debugLogger: Logger): Promise<void>;
|
|
5
|
-
//# sourceMappingURL=deploy_l1_verifier.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_l1_verifier.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/deploy_l1_verifier.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,EAAE,KAAK,GAAG,EAAe,MAAM,MAAM,CAAC;AAE7C,wBAAsB,uBAAuB,CAC3C,aAAa,EAAE,GAAG,GAAG,SAAS,EAC9B,UAAU,EAAE,MAAM,EAAE,EACpB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,kBAAkB,EAAE,MAAM,EAC1B,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBAyCpB;AAED,wBAAsB,kBAAkB,CACtC,aAAa,EAAE,GAAG,GAAG,SAAS,EAC9B,UAAU,EAAE,MAAM,EAAE,EACpB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBAmCpB"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
import { createEthereumChain, createL1Clients, deployL1Contract } from '@aztec/ethereum';
|
|
3
|
-
import { HonkVerifierAbi, HonkVerifierBytecode } from '@aztec/l1-artifacts';
|
|
4
|
-
import { InvalidOptionArgumentError } from 'commander';
|
|
5
|
-
import { getContract } from 'viem';
|
|
6
|
-
export async function deployUltraHonkVerifier(rollupAddress, ethRpcUrls, l1ChainId, privateKey, mnemonic, pxeRpcUrl, bbBinaryPath, bbWorkingDirectory, log, debugLogger) {
|
|
7
|
-
if (!bbBinaryPath || !bbWorkingDirectory) {
|
|
8
|
-
throw new InvalidOptionArgumentError('Missing path to bb binary and working directory');
|
|
9
|
-
}
|
|
10
|
-
const { publicClient, walletClient } = createL1Clients(ethRpcUrls, privateKey ?? mnemonic, createEthereumChain(ethRpcUrls, l1ChainId).chainInfo);
|
|
11
|
-
if (!rollupAddress && pxeRpcUrl) {
|
|
12
|
-
const pxe = await createCompatibleClient(pxeRpcUrl, debugLogger);
|
|
13
|
-
const { l1ContractAddresses } = await pxe.getNodeInfo();
|
|
14
|
-
rollupAddress = l1ContractAddresses.rollupAddress.toString();
|
|
15
|
-
}
|
|
16
|
-
if (!rollupAddress) {
|
|
17
|
-
throw new InvalidOptionArgumentError('Missing rollup address');
|
|
18
|
-
}
|
|
19
|
-
const { RollupAbi } = await import('@aztec/l1-artifacts');
|
|
20
|
-
const rollup = getContract({
|
|
21
|
-
abi: RollupAbi,
|
|
22
|
-
address: rollupAddress,
|
|
23
|
-
client: walletClient
|
|
24
|
-
});
|
|
25
|
-
const { address: verifierAddress } = await deployL1Contract(walletClient, publicClient, HonkVerifierAbi, HonkVerifierBytecode);
|
|
26
|
-
log(`Deployed honk verifier at ${verifierAddress}`);
|
|
27
|
-
await rollup.write.setEpochVerifier([
|
|
28
|
-
verifierAddress.toString()
|
|
29
|
-
]);
|
|
30
|
-
log(`Rollup accepts only real proofs now`);
|
|
31
|
-
}
|
|
32
|
-
export async function deployMockVerifier(rollupAddress, ethRpcUrls, l1ChainId, privateKey, mnemonic, pxeRpcUrl, log, debugLogger) {
|
|
33
|
-
const { publicClient, walletClient } = createL1Clients(ethRpcUrls, privateKey ?? mnemonic, createEthereumChain(ethRpcUrls, l1ChainId).chainInfo);
|
|
34
|
-
const { MockVerifierAbi, MockVerifierBytecode, RollupAbi } = await import('@aztec/l1-artifacts');
|
|
35
|
-
const { address: mockVerifierAddress } = await deployL1Contract(walletClient, publicClient, MockVerifierAbi, MockVerifierBytecode);
|
|
36
|
-
log(`Deployed MockVerifier at ${mockVerifierAddress.toString()}`);
|
|
37
|
-
if (!rollupAddress && pxeRpcUrl) {
|
|
38
|
-
const pxe = await createCompatibleClient(pxeRpcUrl, debugLogger);
|
|
39
|
-
const { l1ContractAddresses } = await pxe.getNodeInfo();
|
|
40
|
-
rollupAddress = l1ContractAddresses.rollupAddress.toString();
|
|
41
|
-
}
|
|
42
|
-
if (!rollupAddress) {
|
|
43
|
-
throw new InvalidOptionArgumentError('Missing rollup address');
|
|
44
|
-
}
|
|
45
|
-
const rollup = getContract({
|
|
46
|
-
abi: RollupAbi,
|
|
47
|
-
address: rollupAddress,
|
|
48
|
-
client: walletClient
|
|
49
|
-
});
|
|
50
|
-
await rollup.write.setEpochVerifier([
|
|
51
|
-
mockVerifierAddress.toString()
|
|
52
|
-
]);
|
|
53
|
-
log(`Rollup accepts only fake proofs now`);
|
|
54
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type EthAddress, type Wallet } from '@aztec/aztec.js';
|
|
2
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
-
/**
|
|
4
|
-
* Deploys the contract to pay for gas on L2.
|
|
5
|
-
*/
|
|
6
|
-
export declare function setupCanonicalL2FeeJuice(deployer: Wallet, feeJuicePortalAddress: EthAddress, waitOpts: import("@aztec/aztec.js").WaitOpts | undefined, log: LogFn): Promise<void>;
|
|
7
|
-
//# sourceMappingURL=setup_contracts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,UAAU,EAAyB,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEvG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,MAAM,EAChB,qBAAqB,EAAE,UAAU,EACjC,QAAQ,gDAAkB,EAC1B,GAAG,EAAE,KAAK,iBA0BX"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { DefaultWaitOpts, FeeJuicePaymentMethod } from '@aztec/aztec.js';
|
|
2
|
-
import { FEE_JUICE_INITIAL_MINT } from '@aztec/constants';
|
|
3
|
-
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
4
|
-
import { Gas } from '@aztec/stdlib/gas';
|
|
5
|
-
/**
|
|
6
|
-
* Deploys the contract to pay for gas on L2.
|
|
7
|
-
*/ export async function setupCanonicalL2FeeJuice(deployer, feeJuicePortalAddress, waitOpts = DefaultWaitOpts, log) {
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9
|
-
// @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
|
|
10
|
-
const { FeeJuiceContract } = await import('@aztec/noir-contracts.js/FeeJuice');
|
|
11
|
-
const feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, deployer);
|
|
12
|
-
const portalAddress = await deployer.getPublicStorageAt(feeJuiceContract.address, feeJuiceContract.artifact.storageLayout.portal_address.slot);
|
|
13
|
-
if (portalAddress.isZero()) {
|
|
14
|
-
log('setupCanonicalL2FeeJuice: Calling initialize on fee juice contract...');
|
|
15
|
-
const paymentMethod = new FeeJuicePaymentMethod(ProtocolContractAddress.FeeJuice);
|
|
16
|
-
await feeJuiceContract.methods.initialize(feeJuicePortalAddress, FEE_JUICE_INITIAL_MINT).send({
|
|
17
|
-
fee: {
|
|
18
|
-
paymentMethod,
|
|
19
|
-
gasSettings: {
|
|
20
|
-
teardownGasLimits: Gas.empty()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}).wait(waitOpts);
|
|
24
|
-
} else {
|
|
25
|
-
log('setupCanonicalL2FeeJuice: Fee juice contract already initialized. Fee Juice Portal address: ' + portalAddress.toString());
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import { getDeployedTestAccountsWallets } from '@aztec/accounts/testing';
|
|
2
|
-
import {
|
|
3
|
-
AztecAddress,
|
|
4
|
-
BatchCall,
|
|
5
|
-
EthAddress,
|
|
6
|
-
Fr,
|
|
7
|
-
L1FeeJuicePortalManager,
|
|
8
|
-
type PXE,
|
|
9
|
-
type WaitOpts,
|
|
10
|
-
type Wallet,
|
|
11
|
-
createCompatibleClient,
|
|
12
|
-
retryUntil,
|
|
13
|
-
} from '@aztec/aztec.js';
|
|
14
|
-
import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
|
|
15
|
-
import {
|
|
16
|
-
type ContractArtifacts,
|
|
17
|
-
type L1Clients,
|
|
18
|
-
createEthereumChain,
|
|
19
|
-
createL1Clients,
|
|
20
|
-
deployL1Contract,
|
|
21
|
-
} from '@aztec/ethereum';
|
|
22
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
23
|
-
|
|
24
|
-
import { getContract } from 'viem';
|
|
25
|
-
import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
26
|
-
|
|
27
|
-
type ContractDeploymentInfo = {
|
|
28
|
-
address: AztecAddress;
|
|
29
|
-
initHash: Fr;
|
|
30
|
-
salt: Fr;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const waitOpts: WaitOpts = {
|
|
34
|
-
timeout: 120,
|
|
35
|
-
provenTimeout: 4800,
|
|
36
|
-
interval: 1,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export async function bootstrapNetwork(
|
|
40
|
-
pxeUrl: string,
|
|
41
|
-
l1Urls: string[],
|
|
42
|
-
l1ChainId: string,
|
|
43
|
-
l1PrivateKey: `0x${string}` | undefined,
|
|
44
|
-
l1Mnemonic: string,
|
|
45
|
-
addressIndex: number,
|
|
46
|
-
json: boolean,
|
|
47
|
-
log: LogFn,
|
|
48
|
-
debugLog: Logger,
|
|
49
|
-
) {
|
|
50
|
-
const pxe = await createCompatibleClient(pxeUrl, debugLog);
|
|
51
|
-
|
|
52
|
-
const [wallet] = await getDeployedTestAccountsWallets(pxe);
|
|
53
|
-
|
|
54
|
-
const l1Clients = createL1Clients(
|
|
55
|
-
l1Urls,
|
|
56
|
-
l1PrivateKey
|
|
57
|
-
? privateKeyToAccount(l1PrivateKey)
|
|
58
|
-
: // We need to use a different account that the main "deployer" account because the "deployer" account creates transactions that send blobs.
|
|
59
|
-
// Note that this account needs to be funded on L1 !
|
|
60
|
-
mnemonicToAccount(l1Mnemonic, { addressIndex }),
|
|
61
|
-
createEthereumChain(l1Urls, +l1ChainId).chainInfo,
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
const { erc20Address, portalAddress } = await deployERC20(l1Clients);
|
|
65
|
-
|
|
66
|
-
const { token, bridge } = await deployToken(wallet, portalAddress);
|
|
67
|
-
|
|
68
|
-
await initPortal(pxe, l1Clients, erc20Address, portalAddress, bridge.address);
|
|
69
|
-
|
|
70
|
-
const fpcAdmin = wallet.getAddress();
|
|
71
|
-
const fpc = await deployFPC(wallet, token.address, fpcAdmin);
|
|
72
|
-
|
|
73
|
-
const counter = await deployCounter(wallet);
|
|
74
|
-
|
|
75
|
-
await fundFPC(counter.address, wallet, l1Clients, fpc.address, debugLog);
|
|
76
|
-
|
|
77
|
-
if (json) {
|
|
78
|
-
log(
|
|
79
|
-
JSON.stringify(
|
|
80
|
-
{
|
|
81
|
-
devCoinL1: erc20Address.toString(),
|
|
82
|
-
devCoinPortalL1: portalAddress.toString(),
|
|
83
|
-
devCoin: {
|
|
84
|
-
address: token.address.toString(),
|
|
85
|
-
initHash: token.initHash.toString(),
|
|
86
|
-
salt: token.salt.toString(),
|
|
87
|
-
},
|
|
88
|
-
devCoinBridge: {
|
|
89
|
-
address: bridge.address.toString(),
|
|
90
|
-
initHash: bridge.initHash.toString(),
|
|
91
|
-
salt: bridge.salt.toString(),
|
|
92
|
-
},
|
|
93
|
-
devCoinFpc: {
|
|
94
|
-
address: fpc.address.toString(),
|
|
95
|
-
initHash: fpc.initHash.toString(),
|
|
96
|
-
salt: fpc.salt.toString(),
|
|
97
|
-
},
|
|
98
|
-
counter: {
|
|
99
|
-
address: counter.address.toString(),
|
|
100
|
-
initHash: counter.initHash.toString(),
|
|
101
|
-
salt: counter.salt.toString(),
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
null,
|
|
105
|
-
2,
|
|
106
|
-
),
|
|
107
|
-
);
|
|
108
|
-
} else {
|
|
109
|
-
log(`DevCoin L1: ${erc20Address}`);
|
|
110
|
-
log(`DevCoin L1 Portal: ${portalAddress}`);
|
|
111
|
-
log(`DevCoin L2: ${token.address}`);
|
|
112
|
-
log(`DevCoin L2 init hash: ${token.initHash}`);
|
|
113
|
-
log(`DevCoin L2 salt: ${token.salt}`);
|
|
114
|
-
log(`DevCoin L2 Bridge: ${bridge.address}`);
|
|
115
|
-
log(`DevCoin L2 Bridge init hash: ${bridge.initHash}`);
|
|
116
|
-
log(`DevCoin L2 Bridge salt: ${bridge.salt}`);
|
|
117
|
-
log(`DevCoin FPC: ${fpc.address}`);
|
|
118
|
-
log(`DevCoin FPC init hash: ${fpc.initHash}`);
|
|
119
|
-
log(`DevCoin FPC salt: ${fpc.salt}`);
|
|
120
|
-
log(`Counter: ${counter.address}`);
|
|
121
|
-
log(`Counter init hash: ${counter.initHash}`);
|
|
122
|
-
log(`Counter salt: ${counter.salt}`);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Step 1. Deploy the L1 contracts, but don't initialize
|
|
128
|
-
*/
|
|
129
|
-
async function deployERC20({ walletClient, publicClient }: L1Clients) {
|
|
130
|
-
const { TestERC20Abi, TestERC20Bytecode, TokenPortalAbi, TokenPortalBytecode } = await import('@aztec/l1-artifacts');
|
|
131
|
-
|
|
132
|
-
const erc20: ContractArtifacts = {
|
|
133
|
-
contractAbi: TestERC20Abi,
|
|
134
|
-
contractBytecode: TestERC20Bytecode,
|
|
135
|
-
};
|
|
136
|
-
const portal: ContractArtifacts = {
|
|
137
|
-
contractAbi: TokenPortalAbi,
|
|
138
|
-
contractBytecode: TokenPortalBytecode,
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
const { address: erc20Address } = await deployL1Contract(
|
|
142
|
-
walletClient,
|
|
143
|
-
publicClient,
|
|
144
|
-
erc20.contractAbi,
|
|
145
|
-
erc20.contractBytecode,
|
|
146
|
-
['DevCoin', 'DEV', walletClient.account.address],
|
|
147
|
-
);
|
|
148
|
-
const { address: portalAddress } = await deployL1Contract(
|
|
149
|
-
walletClient,
|
|
150
|
-
publicClient,
|
|
151
|
-
portal.contractAbi,
|
|
152
|
-
portal.contractBytecode,
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
return {
|
|
156
|
-
erc20Address,
|
|
157
|
-
portalAddress,
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Step 2. Deploy the L2 contracts
|
|
163
|
-
*/
|
|
164
|
-
async function deployToken(
|
|
165
|
-
wallet: Wallet,
|
|
166
|
-
l1Portal: EthAddress,
|
|
167
|
-
): Promise<{ token: ContractDeploymentInfo; bridge: ContractDeploymentInfo }> {
|
|
168
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
169
|
-
// @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
|
|
170
|
-
const { TokenContract } = await import('@aztec/noir-contracts.js/Token');
|
|
171
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
172
|
-
// @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
|
|
173
|
-
const { TokenBridgeContract } = await import('@aztec/noir-contracts.js/TokenBridge');
|
|
174
|
-
const devCoin = await TokenContract.deploy(wallet, wallet.getAddress(), 'DevCoin', 'DEV', 18)
|
|
175
|
-
.send({ universalDeploy: true })
|
|
176
|
-
.deployed(waitOpts);
|
|
177
|
-
const bridge = await TokenBridgeContract.deploy(wallet, devCoin.address, l1Portal)
|
|
178
|
-
.send({ universalDeploy: true })
|
|
179
|
-
.deployed(waitOpts);
|
|
180
|
-
|
|
181
|
-
await new BatchCall(wallet, [
|
|
182
|
-
await devCoin.methods.set_minter(bridge.address, true).request(),
|
|
183
|
-
await devCoin.methods.set_admin(bridge.address).request(),
|
|
184
|
-
])
|
|
185
|
-
.send()
|
|
186
|
-
.wait(waitOpts);
|
|
187
|
-
|
|
188
|
-
return {
|
|
189
|
-
token: {
|
|
190
|
-
address: devCoin.address,
|
|
191
|
-
initHash: devCoin.instance.initializationHash,
|
|
192
|
-
salt: devCoin.instance.salt,
|
|
193
|
-
},
|
|
194
|
-
bridge: {
|
|
195
|
-
address: bridge.address,
|
|
196
|
-
initHash: bridge.instance.initializationHash,
|
|
197
|
-
salt: bridge.instance.salt,
|
|
198
|
-
},
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Step 3. Initialize DevCoin's L1 portal
|
|
204
|
-
*/
|
|
205
|
-
async function initPortal(
|
|
206
|
-
pxe: PXE,
|
|
207
|
-
{ walletClient, publicClient }: L1Clients,
|
|
208
|
-
erc20: EthAddress,
|
|
209
|
-
portal: EthAddress,
|
|
210
|
-
bridge: AztecAddress,
|
|
211
|
-
) {
|
|
212
|
-
const { TokenPortalAbi } = await import('@aztec/l1-artifacts');
|
|
213
|
-
const {
|
|
214
|
-
l1ContractAddresses: { registryAddress },
|
|
215
|
-
} = await pxe.getNodeInfo();
|
|
216
|
-
|
|
217
|
-
const contract = getContract({
|
|
218
|
-
abi: TokenPortalAbi,
|
|
219
|
-
address: portal.toString(),
|
|
220
|
-
client: walletClient,
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
const hash = await contract.write.initialize([registryAddress.toString(), erc20.toString(), bridge.toString()]);
|
|
224
|
-
|
|
225
|
-
await publicClient.waitForTransactionReceipt({ hash });
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
async function deployFPC(
|
|
229
|
-
wallet: Wallet,
|
|
230
|
-
tokenAddress: AztecAddress,
|
|
231
|
-
admin: AztecAddress,
|
|
232
|
-
): Promise<ContractDeploymentInfo> {
|
|
233
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
234
|
-
// @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
|
|
235
|
-
const { FPCContract } = await import('@aztec/noir-contracts.js/FPC');
|
|
236
|
-
const fpc = await FPCContract.deploy(wallet, tokenAddress, admin).send({ universalDeploy: true }).deployed(waitOpts);
|
|
237
|
-
const info: ContractDeploymentInfo = {
|
|
238
|
-
address: fpc.address,
|
|
239
|
-
initHash: fpc.instance.initializationHash,
|
|
240
|
-
salt: fpc.instance.salt,
|
|
241
|
-
};
|
|
242
|
-
return info;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
async function deployCounter(wallet: Wallet): Promise<ContractDeploymentInfo> {
|
|
246
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
247
|
-
// @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
|
|
248
|
-
const { CounterContract } = await import('@aztec/noir-contracts.js/Counter');
|
|
249
|
-
const counter = await CounterContract.deploy(wallet, 1, wallet.getAddress())
|
|
250
|
-
.send({ universalDeploy: true })
|
|
251
|
-
.deployed(waitOpts);
|
|
252
|
-
const info: ContractDeploymentInfo = {
|
|
253
|
-
address: counter.address,
|
|
254
|
-
initHash: counter.instance.initializationHash,
|
|
255
|
-
salt: counter.instance.salt,
|
|
256
|
-
};
|
|
257
|
-
return info;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
// NOTE: Disabling for now in order to get devnet running
|
|
261
|
-
async function fundFPC(
|
|
262
|
-
counterAddress: AztecAddress,
|
|
263
|
-
wallet: Wallet,
|
|
264
|
-
l1Clients: L1Clients,
|
|
265
|
-
fpcAddress: AztecAddress,
|
|
266
|
-
debugLog: Logger,
|
|
267
|
-
) {
|
|
268
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
269
|
-
// @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
|
|
270
|
-
const { FeeJuiceContract } = await import('@aztec/noir-contracts.js/FeeJuice');
|
|
271
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
272
|
-
// @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
|
|
273
|
-
const { CounterContract } = await import('@aztec/noir-contracts.js/Counter');
|
|
274
|
-
const {
|
|
275
|
-
protocolContractAddresses: { feeJuice },
|
|
276
|
-
} = await wallet.getPXEInfo();
|
|
277
|
-
|
|
278
|
-
const feeJuiceContract = await FeeJuiceContract.at(feeJuice, wallet);
|
|
279
|
-
|
|
280
|
-
const feeJuicePortal = await L1FeeJuicePortalManager.new(
|
|
281
|
-
wallet,
|
|
282
|
-
l1Clients.publicClient,
|
|
283
|
-
l1Clients.walletClient,
|
|
284
|
-
debugLog,
|
|
285
|
-
);
|
|
286
|
-
|
|
287
|
-
const amount = FEE_FUNDING_FOR_TESTER_ACCOUNT;
|
|
288
|
-
const { claimAmount, claimSecret, messageLeafIndex, messageHash } = await feeJuicePortal.bridgeTokensPublic(
|
|
289
|
-
fpcAddress,
|
|
290
|
-
amount,
|
|
291
|
-
true,
|
|
292
|
-
);
|
|
293
|
-
|
|
294
|
-
await retryUntil(
|
|
295
|
-
async () => await wallet.isL1ToL2MessageSynced(Fr.fromHexString(messageHash)),
|
|
296
|
-
'message sync',
|
|
297
|
-
600,
|
|
298
|
-
1,
|
|
299
|
-
);
|
|
300
|
-
|
|
301
|
-
const counter = await CounterContract.at(counterAddress, wallet);
|
|
302
|
-
|
|
303
|
-
debugLog.info('Incrementing Counter');
|
|
304
|
-
|
|
305
|
-
// TODO (alexg) remove this once sequencer builds blocks continuously
|
|
306
|
-
// advance the chain
|
|
307
|
-
await counter.methods.increment(wallet.getAddress(), wallet.getAddress()).send().wait(waitOpts);
|
|
308
|
-
await counter.methods.increment(wallet.getAddress(), wallet.getAddress()).send().wait(waitOpts);
|
|
309
|
-
|
|
310
|
-
debugLog.info('Claiming FPC');
|
|
311
|
-
|
|
312
|
-
await feeJuiceContract.methods
|
|
313
|
-
.claim(fpcAddress, claimAmount, claimSecret, messageLeafIndex)
|
|
314
|
-
.send()
|
|
315
|
-
.wait({ ...waitOpts, proven: true });
|
|
316
|
-
|
|
317
|
-
debugLog.info('Finished claiming FPC');
|
|
318
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
-
|
|
4
|
-
import { prettyPrintJSON } from '../../utils/commands.js';
|
|
5
|
-
|
|
6
|
-
export async function dripFaucet(
|
|
7
|
-
faucetUrl: string,
|
|
8
|
-
asset: string,
|
|
9
|
-
account: EthAddress,
|
|
10
|
-
json: boolean,
|
|
11
|
-
log: LogFn,
|
|
12
|
-
): Promise<void> {
|
|
13
|
-
const url = new URL(`/drip/${account.toString()}`, faucetUrl);
|
|
14
|
-
url.searchParams.set('asset', asset);
|
|
15
|
-
const res = await fetch(url);
|
|
16
|
-
if (res.status === 200) {
|
|
17
|
-
if (json) {
|
|
18
|
-
log(prettyPrintJSON({ ok: true }));
|
|
19
|
-
} else {
|
|
20
|
-
log(`Dripped ${asset} for ${account.toString()}`);
|
|
21
|
-
}
|
|
22
|
-
} else {
|
|
23
|
-
if (json) {
|
|
24
|
-
log(prettyPrintJSON({ ok: false }));
|
|
25
|
-
} else if (res.status === 429) {
|
|
26
|
-
log(`Rate limited when dripping ${asset} for ${account.toString()}`);
|
|
27
|
-
} else {
|
|
28
|
-
log(`Failed to drip ${asset} for ${account.toString()}`);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
process.exit(1);
|
|
32
|
-
}
|
|
33
|
-
}
|
package/src/cmds/devnet/index.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
|
-
|
|
3
|
-
import type { Command } from 'commander';
|
|
4
|
-
|
|
5
|
-
import { ETHEREUM_HOSTS, l1ChainIdOption, parseEthereumAddress, pxeOption } from '../../utils/commands.js';
|
|
6
|
-
|
|
7
|
-
export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
|
|
8
|
-
program
|
|
9
|
-
.command('bootstrap-network')
|
|
10
|
-
.description('Bootstrap a new network')
|
|
11
|
-
.addOption(pxeOption)
|
|
12
|
-
.addOption(l1ChainIdOption)
|
|
13
|
-
.requiredOption<string[]>(
|
|
14
|
-
'--l1-rpc-urls <string>',
|
|
15
|
-
'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)',
|
|
16
|
-
(arg: string) => arg.split(','),
|
|
17
|
-
[ETHEREUM_HOSTS],
|
|
18
|
-
)
|
|
19
|
-
.option('--l1-private-key <string>', 'The private key to use for deployment', process.env.PRIVATE_KEY)
|
|
20
|
-
.option(
|
|
21
|
-
'-m, --mnemonic <string>',
|
|
22
|
-
'The mnemonic to use in deployment',
|
|
23
|
-
'test test test test test test test test test test test junk',
|
|
24
|
-
)
|
|
25
|
-
.option(
|
|
26
|
-
'-ai, --address-index <number>',
|
|
27
|
-
'The address index to use when calculating an address',
|
|
28
|
-
arg => BigInt(arg),
|
|
29
|
-
0n,
|
|
30
|
-
)
|
|
31
|
-
.option('--json', 'Output the result as JSON')
|
|
32
|
-
.action(async options => {
|
|
33
|
-
const { bootstrapNetwork } = await import('./bootstrap_network.js');
|
|
34
|
-
await bootstrapNetwork(
|
|
35
|
-
options[pxeOption.attributeName()],
|
|
36
|
-
options.l1RpcUrls,
|
|
37
|
-
options[l1ChainIdOption.attributeName()],
|
|
38
|
-
options.l1PrivateKey,
|
|
39
|
-
options.mnemonic,
|
|
40
|
-
options.addressIndex,
|
|
41
|
-
options.json,
|
|
42
|
-
log,
|
|
43
|
-
debugLogger,
|
|
44
|
-
);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
program
|
|
48
|
-
.command('drip-faucet')
|
|
49
|
-
.description('Drip the faucet')
|
|
50
|
-
.requiredOption('-u, --faucet-url <string>', 'Url of the faucet', 'http://localhost:8082')
|
|
51
|
-
.requiredOption('-t, --token <string>', 'The asset to drip', 'eth')
|
|
52
|
-
.requiredOption('-a, --address <string>', 'The Ethereum address to drip to', parseEthereumAddress)
|
|
53
|
-
.option('--json', 'Output the result as JSON')
|
|
54
|
-
.action(async options => {
|
|
55
|
-
const { dripFaucet } = await import('./faucet.js');
|
|
56
|
-
await dripFaucet(options.faucetUrl, options.token, options.address, options.json, log);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
return program;
|
|
60
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
import { createEthereumChain, createL1Clients, deployL1Contract } from '@aztec/ethereum';
|
|
3
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
4
|
-
import { HonkVerifierAbi, HonkVerifierBytecode } from '@aztec/l1-artifacts';
|
|
5
|
-
|
|
6
|
-
import { InvalidOptionArgumentError } from 'commander';
|
|
7
|
-
import { type Hex, getContract } from 'viem';
|
|
8
|
-
|
|
9
|
-
export async function deployUltraHonkVerifier(
|
|
10
|
-
rollupAddress: Hex | undefined,
|
|
11
|
-
ethRpcUrls: string[],
|
|
12
|
-
l1ChainId: string,
|
|
13
|
-
privateKey: string | undefined,
|
|
14
|
-
mnemonic: string,
|
|
15
|
-
pxeRpcUrl: string,
|
|
16
|
-
bbBinaryPath: string,
|
|
17
|
-
bbWorkingDirectory: string,
|
|
18
|
-
log: LogFn,
|
|
19
|
-
debugLogger: Logger,
|
|
20
|
-
) {
|
|
21
|
-
if (!bbBinaryPath || !bbWorkingDirectory) {
|
|
22
|
-
throw new InvalidOptionArgumentError('Missing path to bb binary and working directory');
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const { publicClient, walletClient } = createL1Clients(
|
|
26
|
-
ethRpcUrls,
|
|
27
|
-
privateKey ?? mnemonic,
|
|
28
|
-
createEthereumChain(ethRpcUrls, l1ChainId).chainInfo,
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
if (!rollupAddress && pxeRpcUrl) {
|
|
32
|
-
const pxe = await createCompatibleClient(pxeRpcUrl, debugLogger);
|
|
33
|
-
const { l1ContractAddresses } = await pxe.getNodeInfo();
|
|
34
|
-
rollupAddress = l1ContractAddresses.rollupAddress.toString();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (!rollupAddress) {
|
|
38
|
-
throw new InvalidOptionArgumentError('Missing rollup address');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const { RollupAbi } = await import('@aztec/l1-artifacts');
|
|
42
|
-
|
|
43
|
-
const rollup = getContract({
|
|
44
|
-
abi: RollupAbi,
|
|
45
|
-
address: rollupAddress,
|
|
46
|
-
client: walletClient,
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const { address: verifierAddress } = await deployL1Contract(
|
|
50
|
-
walletClient,
|
|
51
|
-
publicClient,
|
|
52
|
-
HonkVerifierAbi,
|
|
53
|
-
HonkVerifierBytecode,
|
|
54
|
-
);
|
|
55
|
-
log(`Deployed honk verifier at ${verifierAddress}`);
|
|
56
|
-
|
|
57
|
-
await rollup.write.setEpochVerifier([verifierAddress.toString()]);
|
|
58
|
-
|
|
59
|
-
log(`Rollup accepts only real proofs now`);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export async function deployMockVerifier(
|
|
63
|
-
rollupAddress: Hex | undefined,
|
|
64
|
-
ethRpcUrls: string[],
|
|
65
|
-
l1ChainId: string,
|
|
66
|
-
privateKey: string | undefined,
|
|
67
|
-
mnemonic: string,
|
|
68
|
-
pxeRpcUrl: string,
|
|
69
|
-
log: LogFn,
|
|
70
|
-
debugLogger: Logger,
|
|
71
|
-
) {
|
|
72
|
-
const { publicClient, walletClient } = createL1Clients(
|
|
73
|
-
ethRpcUrls,
|
|
74
|
-
privateKey ?? mnemonic,
|
|
75
|
-
createEthereumChain(ethRpcUrls, l1ChainId).chainInfo,
|
|
76
|
-
);
|
|
77
|
-
const { MockVerifierAbi, MockVerifierBytecode, RollupAbi } = await import('@aztec/l1-artifacts');
|
|
78
|
-
|
|
79
|
-
const { address: mockVerifierAddress } = await deployL1Contract(
|
|
80
|
-
walletClient,
|
|
81
|
-
publicClient,
|
|
82
|
-
MockVerifierAbi,
|
|
83
|
-
MockVerifierBytecode,
|
|
84
|
-
);
|
|
85
|
-
log(`Deployed MockVerifier at ${mockVerifierAddress.toString()}`);
|
|
86
|
-
|
|
87
|
-
if (!rollupAddress && pxeRpcUrl) {
|
|
88
|
-
const pxe = await createCompatibleClient(pxeRpcUrl, debugLogger);
|
|
89
|
-
const { l1ContractAddresses } = await pxe.getNodeInfo();
|
|
90
|
-
rollupAddress = l1ContractAddresses.rollupAddress.toString();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (!rollupAddress) {
|
|
94
|
-
throw new InvalidOptionArgumentError('Missing rollup address');
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const rollup = getContract({
|
|
98
|
-
abi: RollupAbi,
|
|
99
|
-
address: rollupAddress,
|
|
100
|
-
client: walletClient,
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
await rollup.write.setEpochVerifier([mockVerifierAddress.toString()]);
|
|
104
|
-
log(`Rollup accepts only fake proofs now`);
|
|
105
|
-
}
|