@aztec/ethereum 0.0.1-commit.24de95ac → 0.0.1-commit.2e2504e2

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 (208) hide show
  1. package/dest/account.d.ts +1 -1
  2. package/dest/chain.d.ts +1 -1
  3. package/dest/client.d.ts +1 -1
  4. package/dest/client.js +6 -2
  5. package/dest/config.d.ts +22 -68
  6. package/dest/config.d.ts.map +1 -1
  7. package/dest/config.js +57 -378
  8. package/dest/constants.d.ts +1 -1
  9. package/dest/contracts/empire_base.d.ts +7 -5
  10. package/dest/contracts/empire_base.d.ts.map +1 -1
  11. package/dest/contracts/empire_base.js +1 -1
  12. package/dest/contracts/empire_slashing_proposer.d.ts +6 -4
  13. package/dest/contracts/empire_slashing_proposer.d.ts.map +1 -1
  14. package/dest/contracts/empire_slashing_proposer.js +30 -17
  15. package/dest/contracts/errors.d.ts +1 -1
  16. package/dest/contracts/errors.d.ts.map +1 -1
  17. package/dest/contracts/fee_asset_handler.d.ts +6 -5
  18. package/dest/contracts/fee_asset_handler.d.ts.map +1 -1
  19. package/dest/contracts/fee_asset_handler.js +11 -9
  20. package/dest/contracts/fee_juice.d.ts +1 -1
  21. package/dest/contracts/fee_juice.d.ts.map +1 -1
  22. package/dest/contracts/governance.d.ts +18 -16
  23. package/dest/contracts/governance.d.ts.map +1 -1
  24. package/dest/contracts/governance.js +11 -1
  25. package/dest/contracts/governance_proposer.d.ts +6 -4
  26. package/dest/contracts/governance_proposer.d.ts.map +1 -1
  27. package/dest/contracts/governance_proposer.js +403 -11
  28. package/dest/contracts/gse.d.ts +1 -1
  29. package/dest/contracts/gse.d.ts.map +1 -1
  30. package/dest/contracts/inbox.d.ts +24 -3
  31. package/dest/contracts/inbox.d.ts.map +1 -1
  32. package/dest/contracts/inbox.js +36 -1
  33. package/dest/contracts/index.d.ts +3 -1
  34. package/dest/contracts/index.d.ts.map +1 -1
  35. package/dest/contracts/index.js +2 -0
  36. package/dest/contracts/log.d.ts +13 -0
  37. package/dest/contracts/log.d.ts.map +1 -0
  38. package/dest/contracts/log.js +1 -0
  39. package/dest/contracts/multicall.d.ts +2 -2
  40. package/dest/contracts/multicall.d.ts.map +1 -1
  41. package/dest/contracts/multicall.js +2 -1
  42. package/dest/contracts/outbox.d.ts +41 -0
  43. package/dest/contracts/outbox.d.ts.map +1 -0
  44. package/dest/contracts/outbox.js +86 -0
  45. package/dest/contracts/registry.d.ts +1 -1
  46. package/dest/contracts/registry.d.ts.map +1 -1
  47. package/dest/contracts/rollup.d.ts +194 -123
  48. package/dest/contracts/rollup.d.ts.map +1 -1
  49. package/dest/contracts/rollup.js +750 -184
  50. package/dest/contracts/slasher_contract.d.ts +1 -1
  51. package/dest/contracts/slasher_contract.d.ts.map +1 -1
  52. package/dest/contracts/tally_slashing_proposer.d.ts +9 -7
  53. package/dest/contracts/tally_slashing_proposer.d.ts.map +1 -1
  54. package/dest/contracts/tally_slashing_proposer.js +11 -4
  55. package/dest/contracts/utils.d.ts +1 -1
  56. package/dest/deploy_aztec_l1_contracts.d.ts +260 -0
  57. package/dest/deploy_aztec_l1_contracts.d.ts.map +1 -0
  58. package/dest/deploy_aztec_l1_contracts.js +399 -0
  59. package/dest/deploy_l1_contract.d.ts +68 -0
  60. package/dest/deploy_l1_contract.d.ts.map +1 -0
  61. package/dest/deploy_l1_contract.js +312 -0
  62. package/dest/eth-signer/eth-signer.d.ts +1 -1
  63. package/dest/eth-signer/index.d.ts +1 -1
  64. package/dest/forwarder_proxy.d.ts +32 -0
  65. package/dest/forwarder_proxy.d.ts.map +1 -0
  66. package/dest/forwarder_proxy.js +93 -0
  67. package/dest/generated/l1-contracts-defaults.d.ts +30 -0
  68. package/dest/generated/l1-contracts-defaults.d.ts.map +1 -0
  69. package/dest/generated/l1-contracts-defaults.js +30 -0
  70. package/dest/l1_artifacts.d.ts +6597 -2046
  71. package/dest/l1_artifacts.d.ts.map +1 -1
  72. package/dest/l1_contract_addresses.d.ts +3 -3
  73. package/dest/l1_contract_addresses.d.ts.map +1 -1
  74. package/dest/l1_contract_addresses.js +3 -3
  75. package/dest/l1_reader.d.ts +3 -1
  76. package/dest/l1_reader.d.ts.map +1 -1
  77. package/dest/l1_reader.js +6 -0
  78. package/dest/l1_tx_utils/config.d.ts +5 -5
  79. package/dest/l1_tx_utils/config.d.ts.map +1 -1
  80. package/dest/l1_tx_utils/config.js +30 -7
  81. package/dest/l1_tx_utils/constants.d.ts +8 -2
  82. package/dest/l1_tx_utils/constants.d.ts.map +1 -1
  83. package/dest/l1_tx_utils/constants.js +27 -2
  84. package/dest/l1_tx_utils/factory.d.ts +1 -1
  85. package/dest/l1_tx_utils/fee-strategies/index.d.ts +10 -0
  86. package/dest/l1_tx_utils/fee-strategies/index.d.ts.map +1 -0
  87. package/dest/l1_tx_utils/fee-strategies/index.js +12 -0
  88. package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts +8 -0
  89. package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts.map +1 -0
  90. package/dest/l1_tx_utils/fee-strategies/p75_competitive.js +129 -0
  91. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts +23 -0
  92. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts.map +1 -0
  93. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.js +191 -0
  94. package/dest/l1_tx_utils/fee-strategies/types.d.ts +51 -0
  95. package/dest/l1_tx_utils/fee-strategies/types.d.ts.map +1 -0
  96. package/dest/l1_tx_utils/fee-strategies/types.js +3 -0
  97. package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts +41 -0
  98. package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts.map +1 -0
  99. package/dest/l1_tx_utils/forwarder_l1_tx_utils.js +48 -0
  100. package/dest/l1_tx_utils/index-blobs.d.ts +3 -0
  101. package/dest/l1_tx_utils/index-blobs.d.ts.map +1 -0
  102. package/dest/l1_tx_utils/index-blobs.js +2 -0
  103. package/dest/l1_tx_utils/index.d.ts +3 -1
  104. package/dest/l1_tx_utils/index.d.ts.map +1 -1
  105. package/dest/l1_tx_utils/index.js +2 -0
  106. package/dest/l1_tx_utils/interfaces.d.ts +2 -2
  107. package/dest/l1_tx_utils/interfaces.d.ts.map +1 -1
  108. package/dest/l1_tx_utils/l1_fee_analyzer.d.ts +233 -0
  109. package/dest/l1_tx_utils/l1_fee_analyzer.d.ts.map +1 -0
  110. package/dest/l1_tx_utils/l1_fee_analyzer.js +506 -0
  111. package/dest/l1_tx_utils/l1_tx_utils.d.ts +1 -2
  112. package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -1
  113. package/dest/l1_tx_utils/l1_tx_utils.js +23 -10
  114. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts +1 -1
  115. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts.map +1 -1
  116. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +19 -30
  117. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -1
  118. package/dest/l1_tx_utils/readonly_l1_tx_utils.js +55 -163
  119. package/dest/l1_tx_utils/signer.d.ts +1 -1
  120. package/dest/l1_tx_utils/types.d.ts +1 -1
  121. package/dest/l1_tx_utils/types.d.ts.map +1 -1
  122. package/dest/l1_tx_utils/utils.d.ts +1 -1
  123. package/dest/l1_types.d.ts +1 -1
  124. package/dest/publisher_manager.d.ts +3 -2
  125. package/dest/publisher_manager.d.ts.map +1 -1
  126. package/dest/publisher_manager.js +2 -2
  127. package/dest/queries.d.ts +2 -2
  128. package/dest/queries.d.ts.map +1 -1
  129. package/dest/queries.js +16 -6
  130. package/dest/test/chain_monitor.d.ts +27 -24
  131. package/dest/test/chain_monitor.d.ts.map +1 -1
  132. package/dest/test/chain_monitor.js +33 -36
  133. package/dest/test/delayed_tx_utils.d.ts +1 -1
  134. package/dest/test/delayed_tx_utils.d.ts.map +1 -1
  135. package/dest/test/eth_cheat_codes.d.ts +11 -3
  136. package/dest/test/eth_cheat_codes.d.ts.map +1 -1
  137. package/dest/test/eth_cheat_codes.js +11 -3
  138. package/dest/test/eth_cheat_codes_with_state.d.ts +1 -1
  139. package/dest/test/eth_cheat_codes_with_state.d.ts.map +1 -1
  140. package/dest/test/index.d.ts +1 -1
  141. package/dest/test/rollup_cheat_codes.d.ts +17 -13
  142. package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
  143. package/dest/test/rollup_cheat_codes.js +62 -38
  144. package/dest/test/start_anvil.d.ts +4 -1
  145. package/dest/test/start_anvil.d.ts.map +1 -1
  146. package/dest/test/start_anvil.js +3 -2
  147. package/dest/test/tx_delayer.d.ts +1 -1
  148. package/dest/test/tx_delayer.d.ts.map +1 -1
  149. package/dest/test/tx_delayer.js +4 -3
  150. package/dest/test/upgrade_utils.d.ts +1 -1
  151. package/dest/types.d.ts +57 -2
  152. package/dest/types.d.ts.map +1 -1
  153. package/dest/utils.d.ts +16 -3
  154. package/dest/utils.d.ts.map +1 -1
  155. package/dest/utils.js +64 -0
  156. package/dest/zkPassportVerifierAddress.d.ts +1 -1
  157. package/package.json +34 -14
  158. package/src/client.ts +2 -2
  159. package/src/config.ts +71 -458
  160. package/src/contracts/README.md +157 -0
  161. package/src/contracts/empire_base.ts +6 -5
  162. package/src/contracts/empire_slashing_proposer.ts +32 -32
  163. package/src/contracts/fee_asset_handler.ts +10 -7
  164. package/src/contracts/governance.ts +10 -1
  165. package/src/contracts/governance_proposer.ts +20 -6
  166. package/src/contracts/inbox.ts +55 -3
  167. package/src/contracts/index.ts +2 -0
  168. package/src/contracts/log.ts +13 -0
  169. package/src/contracts/multicall.ts +5 -2
  170. package/src/contracts/outbox.ts +98 -0
  171. package/src/contracts/rollup.ts +421 -160
  172. package/src/contracts/tally_slashing_proposer.ts +15 -8
  173. package/src/deploy_aztec_l1_contracts.ts +623 -0
  174. package/src/deploy_l1_contract.ts +362 -0
  175. package/src/forwarder_proxy.ts +108 -0
  176. package/src/generated/l1-contracts-defaults.ts +32 -0
  177. package/src/l1_contract_addresses.ts +22 -20
  178. package/src/l1_reader.ts +8 -0
  179. package/src/l1_tx_utils/config.ts +32 -11
  180. package/src/l1_tx_utils/constants.ts +13 -2
  181. package/src/l1_tx_utils/fee-strategies/index.ts +22 -0
  182. package/src/l1_tx_utils/fee-strategies/p75_competitive.ts +163 -0
  183. package/src/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.ts +245 -0
  184. package/src/l1_tx_utils/fee-strategies/types.ts +56 -0
  185. package/src/l1_tx_utils/forwarder_l1_tx_utils.ts +119 -0
  186. package/src/l1_tx_utils/index-blobs.ts +2 -0
  187. package/src/l1_tx_utils/index.ts +2 -0
  188. package/src/l1_tx_utils/interfaces.ts +1 -1
  189. package/src/l1_tx_utils/l1_fee_analyzer.ts +803 -0
  190. package/src/l1_tx_utils/l1_tx_utils.ts +30 -10
  191. package/src/l1_tx_utils/readonly_l1_tx_utils.ts +69 -209
  192. package/src/publisher_manager.ts +4 -2
  193. package/src/queries.ts +17 -6
  194. package/src/test/chain_monitor.ts +51 -49
  195. package/src/test/eth_cheat_codes.ts +9 -3
  196. package/src/test/rollup_cheat_codes.ts +63 -43
  197. package/src/test/start_anvil.ts +5 -1
  198. package/src/test/tx_delayer.ts +5 -3
  199. package/src/types.ts +62 -0
  200. package/src/utils.ts +83 -1
  201. package/dest/deploy_l1_contracts.d.ts +0 -226
  202. package/dest/deploy_l1_contracts.d.ts.map +0 -1
  203. package/dest/deploy_l1_contracts.js +0 -1473
  204. package/dest/index.d.ts +0 -18
  205. package/dest/index.d.ts.map +0 -1
  206. package/dest/index.js +0 -17
  207. package/src/deploy_l1_contracts.ts +0 -1849
  208. package/src/index.ts +0 -17
package/src/utils.ts CHANGED
@@ -1,18 +1,21 @@
1
- import type { Fr } from '@aztec/foundation/fields';
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import type { Logger } from '@aztec/foundation/log';
3
3
  import { ErrorsAbi } from '@aztec/l1-artifacts/ErrorsAbi';
4
4
 
5
5
  import {
6
6
  type Abi,
7
+ type AbiItem,
7
8
  BaseError,
8
9
  type ContractEventName,
9
10
  ContractFunctionRevertedError,
10
11
  type DecodeEventLogReturnType,
12
+ type FormattedTransaction,
11
13
  type Hex,
12
14
  type Log,
13
15
  decodeErrorResult,
14
16
  decodeEventLog,
15
17
  } from 'viem';
18
+ import { formatAbiItem, formatAbiParams } from 'viem/utils';
16
19
 
17
20
  export interface L2Claim {
18
21
  claimSecret: Fr;
@@ -92,6 +95,57 @@ export function prettyLogViemErrorMsg(err: any) {
92
95
  return err?.message ?? err;
93
96
  }
94
97
 
98
+ export function mergeAbis(abis: Abi[]): Abi {
99
+ let merged: Abi = [];
100
+ const seen = new Set<string>();
101
+
102
+ for (const abi of abis) {
103
+ for (const item of abi) {
104
+ const key = getAbiItemKey(item);
105
+ if (!seen.has(key)) {
106
+ seen.add(key);
107
+ merged = [...merged, item];
108
+ }
109
+ }
110
+ }
111
+
112
+ return merged;
113
+ }
114
+
115
+ function getAbiItemKey(item: AbiItem): string {
116
+ if (item.type === 'function') {
117
+ const signature = formatAbiItem(item);
118
+ const outputs = formatAbiParams(item.outputs);
119
+ const stateMutability = typeof item.stateMutability === 'string' ? item.stateMutability : '';
120
+ return `function:${signature}:${outputs}:${stateMutability}`;
121
+ }
122
+
123
+ if (item.type === 'event') {
124
+ const signature = formatAbiItem(item);
125
+ const indexed = (item.inputs ?? []).map(input => ((input as { indexed?: boolean }).indexed ? '1' : '0')).join('');
126
+ const anonymous = item.anonymous ? 'anonymous' : 'not-anonymous';
127
+ return `event:${signature}:${indexed}:${anonymous}`;
128
+ }
129
+
130
+ if (item.type === 'error') {
131
+ const signature = formatAbiItem(item);
132
+ return `error:${signature}`;
133
+ }
134
+
135
+ if (item.type === 'constructor') {
136
+ const inputs = formatAbiParams(item.inputs);
137
+ const stateMutability = typeof item.stateMutability === 'string' ? item.stateMutability : '';
138
+ return `constructor::${inputs}:${stateMutability}`;
139
+ }
140
+
141
+ if (item.type === 'fallback' || item.type === 'receive') {
142
+ const stateMutability = typeof item.stateMutability === 'string' ? item.stateMutability : '';
143
+ return `${item.type}:::${stateMutability}`;
144
+ }
145
+
146
+ return 'unknown';
147
+ }
148
+
95
149
  function getNestedErrorData(error: unknown): string | undefined {
96
150
  // If nothing, bail
97
151
  if (!error) {
@@ -233,3 +287,31 @@ export function tryGetCustomErrorName(err: any) {
233
287
  return undefined;
234
288
  }
235
289
  }
290
+
291
+ /**
292
+ * Type guard to check if a transaction is a blob transaction (EIP-4844).
293
+ * Blob transactions have maxFeePerBlobGas and blobVersionedHashes fields.
294
+ */
295
+ export function isBlobTransaction(tx: FormattedTransaction): tx is FormattedTransaction & {
296
+ maxFeePerBlobGas: bigint;
297
+ blobVersionedHashes: readonly Hex[];
298
+ } {
299
+ return (
300
+ 'maxFeePerBlobGas' in tx &&
301
+ tx.maxFeePerBlobGas !== undefined &&
302
+ 'blobVersionedHashes' in tx &&
303
+ tx.blobVersionedHashes !== undefined
304
+ );
305
+ }
306
+
307
+ /**
308
+ * Calculates a percentile from an array of bigints
309
+ */
310
+ export function calculatePercentile(values: bigint[], percentile: number): bigint {
311
+ if (values.length === 0) {
312
+ return 0n;
313
+ }
314
+ const sorted = [...values].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
315
+ const index = Math.ceil((sorted.length - 1) * (percentile / 100));
316
+ return sorted[index];
317
+ }
@@ -1,226 +0,0 @@
1
- import { SecretValue } from '@aztec/foundation/config';
2
- import { EthAddress } from '@aztec/foundation/eth-address';
3
- import type { Fr } from '@aztec/foundation/fields';
4
- import { type Logger } from '@aztec/foundation/log';
5
- import { DateProvider } from '@aztec/foundation/timer';
6
- import type { Abi, Narrow } from 'abitype';
7
- import { type Chain, type ContractConstructorArgs, type HDAccount, type Hex, type PrivateKeyAccount } from 'viem';
8
- import { type L1ContractsConfig } from './config.js';
9
- import { RollupContract } from './contracts/rollup.js';
10
- import type { L1ContractAddresses } from './l1_contract_addresses.js';
11
- import { type GasPrice, type L1TxConfig, type L1TxRequest, L1TxUtils, type L1TxUtilsConfig } from './l1_tx_utils/index.js';
12
- import type { ExtendedViemWalletClient } from './types.js';
13
- export declare const DEPLOYER_ADDRESS: Hex;
14
- export type Operator = {
15
- attester: EthAddress;
16
- withdrawer: EthAddress;
17
- bn254SecretKey: SecretValue<bigint>;
18
- };
19
- /**
20
- * Return type of the deployL1Contract function.
21
- */
22
- export type DeployL1ContractsReturnType = {
23
- /** Extended Wallet Client Type. */
24
- l1Client: ExtendedViemWalletClient;
25
- /** The currently deployed l1 contract addresses */
26
- l1ContractAddresses: L1ContractAddresses;
27
- /** Version of the current rollup contract. */
28
- rollupVersion: number;
29
- };
30
- export interface LinkReferences {
31
- [fileName: string]: {
32
- [contractName: string]: ReadonlyArray<{
33
- start: number;
34
- length: number;
35
- }>;
36
- };
37
- }
38
- export interface Libraries {
39
- linkReferences: LinkReferences;
40
- libraryCode: Record<string, ContractArtifacts>;
41
- }
42
- /**
43
- * Contract artifacts
44
- */
45
- export interface ContractArtifacts<TAbi extends Abi | readonly unknown[] = Abi> {
46
- /**
47
- * The contract name.
48
- */
49
- name: string;
50
- /**
51
- * The contract abi.
52
- */
53
- contractAbi: Narrow<TAbi>;
54
- /**
55
- * The contract bytecode
56
- */
57
- contractBytecode: Hex;
58
- /**
59
- * The contract libraries
60
- */
61
- libraries?: Libraries;
62
- }
63
- export type VerificationLibraryEntry = {
64
- file: string;
65
- contract: string;
66
- address: string;
67
- };
68
- export type VerificationRecord = {
69
- name: string;
70
- address: string;
71
- constructorArgsHex: Hex;
72
- libraries: VerificationLibraryEntry[];
73
- };
74
- export interface DeployL1ContractsArgs extends Omit<L1ContractsConfig, keyof L1TxUtilsConfig> {
75
- /** The vk tree root. */
76
- vkTreeRoot: Fr;
77
- /** The hash of the protocol contracts. */
78
- protocolContractsHash: Fr;
79
- /** The genesis root of the archive tree. */
80
- genesisArchiveRoot: Fr;
81
- /** The salt for CREATE2 deployment. */
82
- salt: number | undefined;
83
- /** The initial validators for the rollup contract. */
84
- initialValidators?: Operator[];
85
- /** Configuration for the L1 tx utils module. */
86
- l1TxConfig?: Partial<L1TxUtilsConfig>;
87
- /** Enable fast mode for deployments (fire and forget transactions) */
88
- acceleratedTestDeployments?: boolean;
89
- /** The initial balance of the fee juice portal. This is the amount of fee juice that is prefunded to accounts */
90
- feeJuicePortalInitialBalance?: bigint;
91
- /** Whether to deploy the real verifier or the mock verifier */
92
- realVerifier: boolean;
93
- /** The zk passport args */
94
- zkPassportArgs?: ZKPassportArgs;
95
- /** If provided, use this token for BOTH fee and staking assets (skip deployments) */
96
- existingTokenAddress?: EthAddress;
97
- }
98
- export interface ZKPassportArgs {
99
- /** Whether to use the mock zk passport verifier */
100
- mockZkPassportVerifier?: boolean;
101
- /** The domain of the zk passport (url) */
102
- zkPassportDomain?: string;
103
- /** The scope of the zk passport (personhood, etc) */
104
- zkPassportScope?: string;
105
- }
106
- /**
107
- * Validates that the provided address points to a contract that resembles an ERC20 token.
108
- * Checks for contract code and attempts common ERC20 view calls.
109
- * Throws an error if validation fails.
110
- */
111
- export declare function validateExistingErc20TokenAddress(l1Client: ExtendedViemWalletClient, tokenAddress: EthAddress, logger: Logger): Promise<void>;
112
- export declare const deploySharedContracts: (l1Client: ExtendedViemWalletClient, deployer: L1Deployer, args: DeployL1ContractsArgs, logger: Logger) => Promise<{
113
- feeAssetAddress: EthAddress;
114
- feeAssetHandlerAddress: EthAddress | undefined;
115
- stakingAssetAddress: EthAddress;
116
- stakingAssetHandlerAddress: EthAddress | undefined;
117
- zkPassportVerifierAddress: EthAddress | undefined;
118
- registryAddress: EthAddress;
119
- gseAddress: EthAddress;
120
- governanceAddress: EthAddress;
121
- governanceProposerAddress: EthAddress;
122
- coinIssuerAddress: EthAddress;
123
- rewardDistributorAddress: EthAddress;
124
- }>;
125
- /**
126
- * Deploys a new rollup, using the existing canonical version to derive certain values (addresses of assets etc).
127
- * @param clients - The L1 clients.
128
- * @param args - The deployment arguments.
129
- * @param registryAddress - The address of the registry.
130
- * @param logger - The logger.
131
- * @param txUtilsConfig - The L1 tx utils config.
132
- * @param createVerificationJson - Optional path to write verification data for forge verify.
133
- */
134
- export declare const deployRollupForUpgrade: (extendedClient: ExtendedViemWalletClient, args: Omit<DeployL1ContractsArgs, "governanceProposerQuorum" | "governanceProposerRoundSize" | "ejectionThreshold" | "activationThreshold">, registryAddress: EthAddress, logger: Logger, txUtilsConfig: L1TxUtilsConfig, createVerificationJson?: string | false) => Promise<{
135
- rollup: RollupContract;
136
- slashFactoryAddress: EthAddress;
137
- }>;
138
- export declare const deploySlashFactory: (deployer: L1Deployer, rollupAddress: Hex, logger: Logger) => Promise<EthAddress>;
139
- export declare const deployUpgradePayload: (deployer: L1Deployer, addresses: Pick<L1ContractAddresses, "registryAddress" | "rollupAddress">) => Promise<EthAddress>;
140
- /**
141
- * Deploys a new rollup contract, funds and initializes the fee juice portal, and initializes the validator set.
142
- */
143
- export declare const deployRollup: (extendedClient: ExtendedViemWalletClient, deployer: L1Deployer, args: Omit<DeployL1ContractsArgs, "governanceProposerQuorum" | "governanceProposerRoundSize" | "ejectionThreshold" | "activationThreshold">, addresses: Pick<L1ContractAddresses, "feeJuiceAddress" | "registryAddress" | "rewardDistributorAddress" | "stakingAssetAddress" | "gseAddress" | "governanceAddress">, logger: Logger) => Promise<{
144
- rollup: RollupContract;
145
- slashFactoryAddress: EthAddress;
146
- }>;
147
- export declare const handoverToGovernance: (extendedClient: ExtendedViemWalletClient, deployer: L1Deployer, registryAddress: EthAddress, gseAddress: EthAddress, coinIssuerAddress: EthAddress, feeAssetAddress: EthAddress, governanceAddress: EthAddress, logger: Logger, acceleratedTestDeployments: boolean | undefined, useExternalToken?: boolean) => Promise<{
148
- dateGatedRelayerAddress: EthAddress;
149
- }>;
150
- export declare const addMultipleValidators: (extendedClient: ExtendedViemWalletClient, deployer: L1Deployer, gseAddress: Hex, rollupAddress: Hex, stakingAssetAddress: Hex, validators: Operator[], acceleratedTestDeployments: boolean | undefined, logger: Logger) => Promise<void>;
151
- /**
152
- * Initialize the fee asset handler and make it a minter on the fee asset.
153
- * @note This function will only be used for testing purposes.
154
- *
155
- * @param extendedClient - The L1 clients.
156
- * @param deployer - The L1 deployer.
157
- * @param feeAssetAddress - The address of the fee asset.
158
- * @param logger - The logger.
159
- */
160
- export declare const cheat_initializeFeeAssetHandler: (extendedClient: ExtendedViemWalletClient, deployer: L1Deployer, feeAssetAddress: EthAddress, logger: Logger) => Promise<{
161
- feeAssetHandlerAddress: EthAddress;
162
- txHash: Hex;
163
- }>;
164
- /**
165
- * Deploys the aztec L1 contracts; Rollup & (optionally) Decoder Helper.
166
- * @param rpcUrls - List of URLs of the ETH RPC to use for deployment.
167
- * @param account - Private Key or HD Account that will deploy the contracts.
168
- * @param chain - The chain instance to deploy to.
169
- * @param logger - A logger object.
170
- * @param args - Arguments for initialization of L1 contracts
171
- * @returns A list of ETH addresses of the deployed contracts.
172
- */
173
- export declare const deployL1Contracts: (rpcUrls: string[], account: HDAccount | PrivateKeyAccount, chain: Chain, logger: Logger, args: DeployL1ContractsArgs, txUtilsConfig?: L1TxUtilsConfig, createVerificationJson?: string | false) => Promise<DeployL1ContractsReturnType>;
174
- export declare class L1Deployer {
175
- readonly client: ExtendedViemWalletClient;
176
- private acceleratedTestDeployments;
177
- private logger;
178
- private txUtilsConfig?;
179
- private createVerificationJson;
180
- private salt;
181
- private txHashes;
182
- readonly l1TxUtils: L1TxUtils;
183
- readonly verificationRecords: VerificationRecord[];
184
- constructor(client: ExtendedViemWalletClient, maybeSalt: number | undefined, dateProvider?: DateProvider, acceleratedTestDeployments?: boolean, logger?: Logger, txUtilsConfig?: L1TxUtilsConfig | undefined, createVerificationJson?: boolean);
185
- deploy<const TAbi extends Abi>(params: ContractArtifacts<TAbi>, args?: ContractConstructorArgs<TAbi>, opts?: {
186
- gasLimit?: bigint;
187
- }): Promise<{
188
- address: EthAddress;
189
- existed: boolean;
190
- }>;
191
- waitForDeployments(): Promise<void>;
192
- sendTransaction(tx: L1TxRequest, options?: L1TxConfig): Promise<{
193
- txHash: Hex;
194
- gasLimit: bigint;
195
- gasPrice: GasPrice;
196
- }>;
197
- }
198
- /**
199
- * Helper function to deploy ETH contracts.
200
- * @param walletClient - A viem WalletClient.
201
- * @param publicClient - A viem PublicClient.
202
- * @param abi - The ETH contract's ABI (as abitype's Abi).
203
- * @param bytecode - The ETH contract's bytecode.
204
- * @param args - Constructor arguments for the contract.
205
- * @param salt - Optional salt for CREATE2 deployment (does not wait for deployment tx to be mined if set, does not send tx if contract already exists).
206
- * @returns The ETH address the contract was deployed to.
207
- */
208
- export declare function deployL1Contract(extendedClient: ExtendedViemWalletClient, abi: Narrow<Abi | readonly unknown[]>, bytecode: Hex, args?: readonly unknown[], opts?: {
209
- salt?: Hex;
210
- libraries?: Libraries;
211
- logger?: Logger;
212
- l1TxUtils?: L1TxUtils;
213
- gasLimit?: bigint;
214
- acceleratedTestDeployments?: boolean;
215
- }): Promise<{
216
- address: EthAddress;
217
- txHash: Hex | undefined;
218
- deployedLibraries?: VerificationLibraryEntry[];
219
- existed: boolean;
220
- }>;
221
- export declare function getExpectedAddress(abi: Narrow<Abi | readonly unknown[]>, bytecode: Hex, args: readonly unknown[], salt: Hex): {
222
- address: `0x${string}`;
223
- paddedSalt: `0x${string}`;
224
- calldata: `0x${string}`;
225
- };
226
- //# sourceMappingURL=deploy_l1_contracts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy_l1_contracts.d.ts","sourceRoot":"","sources":["../src/deploy_l1_contracts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAwB,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,E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