@aztec/ethereum 0.0.0-test.1 → 0.0.1-commit.0208eb9

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 (285) hide show
  1. package/dest/account.d.ts +2 -0
  2. package/dest/account.d.ts.map +1 -0
  3. package/dest/account.js +4 -0
  4. package/dest/chain.d.ts +1 -1
  5. package/dest/client.d.ts +6 -4
  6. package/dest/client.d.ts.map +1 -1
  7. package/dest/client.js +21 -3
  8. package/dest/config.d.ts +68 -23
  9. package/dest/config.d.ts.map +1 -1
  10. package/dest/config.js +145 -32
  11. package/dest/constants.d.ts +1 -1
  12. package/dest/contracts/empire_base.d.ts +25 -8
  13. package/dest/contracts/empire_base.d.ts.map +1 -1
  14. package/dest/contracts/empire_base.js +75 -2
  15. package/dest/contracts/empire_slashing_proposer.d.ts +67 -0
  16. package/dest/contracts/empire_slashing_proposer.d.ts.map +1 -0
  17. package/dest/contracts/empire_slashing_proposer.js +207 -0
  18. package/dest/contracts/errors.d.ts +7 -0
  19. package/dest/contracts/errors.d.ts.map +1 -0
  20. package/dest/contracts/errors.js +12 -0
  21. package/dest/contracts/fee_asset_handler.d.ts +20 -0
  22. package/dest/contracts/fee_asset_handler.d.ts.map +1 -0
  23. package/dest/contracts/fee_asset_handler.js +59 -0
  24. package/dest/contracts/fee_juice.d.ts +6 -7
  25. package/dest/contracts/fee_juice.d.ts.map +1 -1
  26. package/dest/contracts/fee_juice.js +27 -20
  27. package/dest/contracts/governance.d.ts +45 -32
  28. package/dest/contracts/governance.d.ts.map +1 -1
  29. package/dest/contracts/governance.js +98 -85
  30. package/dest/contracts/governance_proposer.d.ts +17 -13
  31. package/dest/contracts/governance_proposer.d.ts.map +1 -1
  32. package/dest/contracts/governance_proposer.js +432 -26
  33. package/dest/contracts/gse.d.ts +32 -0
  34. package/dest/contracts/gse.d.ts.map +1 -0
  35. package/dest/contracts/gse.js +72 -0
  36. package/dest/contracts/inbox.d.ts +47 -0
  37. package/dest/contracts/inbox.d.ts.map +1 -0
  38. package/dest/contracts/inbox.js +80 -0
  39. package/dest/contracts/index.d.ts +11 -3
  40. package/dest/contracts/index.d.ts.map +1 -1
  41. package/dest/contracts/index.js +10 -2
  42. package/dest/contracts/log.d.ts +13 -0
  43. package/dest/contracts/log.d.ts.map +1 -0
  44. package/dest/contracts/log.js +1 -0
  45. package/dest/contracts/multicall.d.ts +21 -0
  46. package/dest/contracts/multicall.d.ts.map +1 -0
  47. package/dest/contracts/multicall.js +157 -0
  48. package/dest/contracts/outbox.d.ts +41 -0
  49. package/dest/contracts/outbox.d.ts.map +1 -0
  50. package/dest/contracts/outbox.js +86 -0
  51. package/dest/contracts/registry.d.ts +10 -5
  52. package/dest/contracts/registry.d.ts.map +1 -1
  53. package/dest/contracts/registry.js +44 -16
  54. package/dest/contracts/rollup.d.ts +297 -53
  55. package/dest/contracts/rollup.d.ts.map +1 -1
  56. package/dest/contracts/rollup.js +1127 -116
  57. package/dest/contracts/slasher_contract.d.ts +44 -0
  58. package/dest/contracts/slasher_contract.d.ts.map +1 -0
  59. package/dest/contracts/slasher_contract.js +75 -0
  60. package/dest/contracts/tally_slashing_proposer.d.ts +140 -0
  61. package/dest/contracts/tally_slashing_proposer.d.ts.map +1 -0
  62. package/dest/contracts/tally_slashing_proposer.js +320 -0
  63. package/dest/contracts/utils.d.ts +3 -0
  64. package/dest/contracts/utils.d.ts.map +1 -0
  65. package/dest/contracts/utils.js +11 -0
  66. package/dest/deploy_aztec_l1_contracts.d.ts +260 -0
  67. package/dest/deploy_aztec_l1_contracts.d.ts.map +1 -0
  68. package/dest/deploy_aztec_l1_contracts.js +399 -0
  69. package/dest/deploy_l1_contract.d.ts +68 -0
  70. package/dest/deploy_l1_contract.d.ts.map +1 -0
  71. package/dest/deploy_l1_contract.js +312 -0
  72. package/dest/eth-signer/eth-signer.d.ts +21 -0
  73. package/dest/eth-signer/eth-signer.d.ts.map +1 -0
  74. package/dest/eth-signer/eth-signer.js +5 -0
  75. package/dest/eth-signer/index.d.ts +2 -0
  76. package/dest/eth-signer/index.d.ts.map +1 -0
  77. package/dest/eth-signer/index.js +1 -0
  78. package/dest/forwarder_proxy.d.ts +32 -0
  79. package/dest/forwarder_proxy.d.ts.map +1 -0
  80. package/dest/forwarder_proxy.js +93 -0
  81. package/dest/generated/l1-contracts-defaults.d.ts +30 -0
  82. package/dest/generated/l1-contracts-defaults.d.ts.map +1 -0
  83. package/dest/generated/l1-contracts-defaults.js +30 -0
  84. package/dest/l1_artifacts.d.ts +80735 -0
  85. package/dest/l1_artifacts.d.ts.map +1 -0
  86. package/dest/l1_artifacts.js +166 -0
  87. package/dest/l1_contract_addresses.d.ts +24 -4
  88. package/dest/l1_contract_addresses.d.ts.map +1 -1
  89. package/dest/l1_contract_addresses.js +25 -21
  90. package/dest/l1_reader.d.ts +4 -2
  91. package/dest/l1_reader.d.ts.map +1 -1
  92. package/dest/l1_reader.js +14 -8
  93. package/dest/l1_tx_utils/config.d.ts +59 -0
  94. package/dest/l1_tx_utils/config.d.ts.map +1 -0
  95. package/dest/l1_tx_utils/config.js +96 -0
  96. package/dest/l1_tx_utils/constants.d.ts +12 -0
  97. package/dest/l1_tx_utils/constants.d.ts.map +1 -0
  98. package/dest/l1_tx_utils/constants.js +39 -0
  99. package/dest/l1_tx_utils/factory.d.ts +24 -0
  100. package/dest/l1_tx_utils/factory.d.ts.map +1 -0
  101. package/dest/l1_tx_utils/factory.js +12 -0
  102. package/dest/l1_tx_utils/fee-strategies/index.d.ts +10 -0
  103. package/dest/l1_tx_utils/fee-strategies/index.d.ts.map +1 -0
  104. package/dest/l1_tx_utils/fee-strategies/index.js +12 -0
  105. package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts +8 -0
  106. package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts.map +1 -0
  107. package/dest/l1_tx_utils/fee-strategies/p75_competitive.js +129 -0
  108. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts +23 -0
  109. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts.map +1 -0
  110. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.js +191 -0
  111. package/dest/l1_tx_utils/fee-strategies/types.d.ts +51 -0
  112. package/dest/l1_tx_utils/fee-strategies/types.d.ts.map +1 -0
  113. package/dest/l1_tx_utils/fee-strategies/types.js +3 -0
  114. package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts +41 -0
  115. package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts.map +1 -0
  116. package/dest/l1_tx_utils/forwarder_l1_tx_utils.js +48 -0
  117. package/dest/l1_tx_utils/index-blobs.d.ts +3 -0
  118. package/dest/l1_tx_utils/index-blobs.d.ts.map +1 -0
  119. package/dest/l1_tx_utils/index-blobs.js +2 -0
  120. package/dest/l1_tx_utils/index.d.ts +12 -0
  121. package/dest/l1_tx_utils/index.d.ts.map +1 -0
  122. package/dest/l1_tx_utils/index.js +12 -0
  123. package/dest/l1_tx_utils/interfaces.d.ts +76 -0
  124. package/dest/l1_tx_utils/interfaces.d.ts.map +1 -0
  125. package/dest/l1_tx_utils/interfaces.js +4 -0
  126. package/dest/l1_tx_utils/l1_fee_analyzer.d.ts +233 -0
  127. package/dest/l1_tx_utils/l1_fee_analyzer.d.ts.map +1 -0
  128. package/dest/l1_tx_utils/l1_fee_analyzer.js +506 -0
  129. package/dest/l1_tx_utils/l1_tx_utils.d.ts +94 -0
  130. package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -0
  131. package/dest/l1_tx_utils/l1_tx_utils.js +623 -0
  132. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts +26 -0
  133. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts.map +1 -0
  134. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.js +26 -0
  135. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +83 -0
  136. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -0
  137. package/dest/l1_tx_utils/readonly_l1_tx_utils.js +323 -0
  138. package/dest/l1_tx_utils/signer.d.ts +4 -0
  139. package/dest/l1_tx_utils/signer.d.ts.map +1 -0
  140. package/dest/l1_tx_utils/signer.js +16 -0
  141. package/dest/l1_tx_utils/types.d.ts +67 -0
  142. package/dest/l1_tx_utils/types.d.ts.map +1 -0
  143. package/dest/l1_tx_utils/types.js +26 -0
  144. package/dest/l1_tx_utils/utils.d.ts +4 -0
  145. package/dest/l1_tx_utils/utils.d.ts.map +1 -0
  146. package/dest/l1_tx_utils/utils.js +14 -0
  147. package/dest/l1_types.d.ts +6 -0
  148. package/dest/l1_types.d.ts.map +1 -0
  149. package/dest/l1_types.js +1 -0
  150. package/dest/publisher_manager.d.ts +16 -0
  151. package/dest/publisher_manager.d.ts.map +1 -0
  152. package/dest/publisher_manager.js +88 -0
  153. package/dest/queries.d.ts +5 -3
  154. package/dest/queries.d.ts.map +1 -1
  155. package/dest/queries.js +61 -12
  156. package/dest/test/chain_monitor.d.ts +75 -0
  157. package/dest/test/chain_monitor.d.ts.map +1 -0
  158. package/dest/test/chain_monitor.js +213 -0
  159. package/dest/test/delayed_tx_utils.d.ts +8 -3
  160. package/dest/test/delayed_tx_utils.d.ts.map +1 -1
  161. package/dest/test/delayed_tx_utils.js +13 -6
  162. package/dest/test/eth_cheat_codes.d.ts +229 -0
  163. package/dest/test/eth_cheat_codes.d.ts.map +1 -0
  164. package/dest/test/eth_cheat_codes.js +560 -0
  165. package/dest/test/eth_cheat_codes_with_state.d.ts +2 -2
  166. package/dest/test/eth_cheat_codes_with_state.d.ts.map +1 -1
  167. package/dest/test/eth_cheat_codes_with_state.js +1 -1
  168. package/dest/test/index.d.ts +4 -1
  169. package/dest/test/index.d.ts.map +1 -1
  170. package/dest/test/index.js +3 -0
  171. package/dest/test/rollup_cheat_codes.d.ts +90 -0
  172. package/dest/test/rollup_cheat_codes.d.ts.map +1 -0
  173. package/dest/test/rollup_cheat_codes.js +292 -0
  174. package/dest/test/start_anvil.d.ts +9 -1
  175. package/dest/test/start_anvil.d.ts.map +1 -1
  176. package/dest/test/start_anvil.js +16 -7
  177. package/dest/test/tx_delayer.d.ts +18 -7
  178. package/dest/test/tx_delayer.d.ts.map +1 -1
  179. package/dest/test/tx_delayer.js +97 -20
  180. package/dest/test/upgrade_utils.d.ts +6 -5
  181. package/dest/test/upgrade_utils.d.ts.map +1 -1
  182. package/dest/test/upgrade_utils.js +23 -16
  183. package/dest/types.d.ts +62 -8
  184. package/dest/types.d.ts.map +1 -1
  185. package/dest/types.js +3 -1
  186. package/dest/utils.d.ts +17 -3
  187. package/dest/utils.d.ts.map +1 -1
  188. package/dest/utils.js +107 -88
  189. package/dest/zkPassportVerifierAddress.d.ts +15 -0
  190. package/dest/zkPassportVerifierAddress.d.ts.map +1 -0
  191. package/dest/zkPassportVerifierAddress.js +11 -0
  192. package/package.json +51 -23
  193. package/src/account.ts +5 -0
  194. package/src/client.ts +43 -5
  195. package/src/config.ts +207 -41
  196. package/src/contracts/README.md +157 -0
  197. package/src/contracts/empire_base.ts +77 -7
  198. package/src/contracts/empire_slashing_proposer.ts +259 -0
  199. package/src/contracts/errors.ts +13 -0
  200. package/src/contracts/fee_asset_handler.ts +66 -0
  201. package/src/contracts/fee_juice.ts +29 -15
  202. package/src/contracts/governance.ts +90 -78
  203. package/src/contracts/governance_proposer.ts +75 -25
  204. package/src/contracts/gse.ts +88 -0
  205. package/src/contracts/inbox.ts +115 -0
  206. package/src/contracts/index.ts +10 -2
  207. package/src/contracts/log.ts +13 -0
  208. package/src/contracts/multicall.ts +158 -0
  209. package/src/contracts/outbox.ts +98 -0
  210. package/src/contracts/registry.ts +51 -26
  211. package/src/contracts/rollup.ts +879 -89
  212. package/src/contracts/slasher_contract.ts +89 -0
  213. package/src/contracts/tally_slashing_proposer.ts +322 -0
  214. package/src/contracts/utils.ts +14 -0
  215. package/src/deploy_aztec_l1_contracts.ts +623 -0
  216. package/src/deploy_l1_contract.ts +362 -0
  217. package/src/eth-signer/eth-signer.ts +25 -0
  218. package/src/eth-signer/index.ts +1 -0
  219. package/src/forwarder_proxy.ts +108 -0
  220. package/src/generated/l1-contracts-defaults.ts +32 -0
  221. package/src/l1_artifacts.ts +254 -0
  222. package/src/l1_contract_addresses.ts +49 -34
  223. package/src/l1_reader.ts +17 -9
  224. package/src/l1_tx_utils/README.md +177 -0
  225. package/src/l1_tx_utils/config.ts +161 -0
  226. package/src/l1_tx_utils/constants.ts +29 -0
  227. package/src/l1_tx_utils/factory.ts +64 -0
  228. package/src/l1_tx_utils/fee-strategies/index.ts +22 -0
  229. package/src/l1_tx_utils/fee-strategies/p75_competitive.ts +163 -0
  230. package/src/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.ts +245 -0
  231. package/src/l1_tx_utils/fee-strategies/types.ts +56 -0
  232. package/src/l1_tx_utils/forwarder_l1_tx_utils.ts +119 -0
  233. package/src/l1_tx_utils/index-blobs.ts +2 -0
  234. package/src/l1_tx_utils/index.ts +14 -0
  235. package/src/l1_tx_utils/interfaces.ts +86 -0
  236. package/src/l1_tx_utils/l1_fee_analyzer.ts +803 -0
  237. package/src/l1_tx_utils/l1_tx_utils.ts +738 -0
  238. package/src/l1_tx_utils/l1_tx_utils_with_blobs.ts +77 -0
  239. package/src/l1_tx_utils/readonly_l1_tx_utils.ts +419 -0
  240. package/src/l1_tx_utils/signer.ts +28 -0
  241. package/src/l1_tx_utils/types.ts +85 -0
  242. package/src/l1_tx_utils/utils.ts +16 -0
  243. package/src/l1_types.ts +6 -0
  244. package/src/publisher_manager.ts +108 -0
  245. package/src/queries.ts +82 -16
  246. package/src/test/chain_monitor.ts +245 -0
  247. package/src/test/delayed_tx_utils.ts +34 -6
  248. package/src/test/eth_cheat_codes.ts +588 -0
  249. package/src/test/eth_cheat_codes_with_state.ts +1 -1
  250. package/src/test/index.ts +3 -0
  251. package/src/test/rollup_cheat_codes.ts +330 -0
  252. package/src/test/start_anvil.ts +24 -5
  253. package/src/test/tx_delayer.ts +130 -27
  254. package/src/test/upgrade_utils.ts +30 -21
  255. package/src/types.ts +71 -7
  256. package/src/utils.ts +133 -92
  257. package/src/zkPassportVerifierAddress.ts +15 -0
  258. package/dest/contracts/forwarder.d.ts +0 -24
  259. package/dest/contracts/forwarder.d.ts.map +0 -1
  260. package/dest/contracts/forwarder.js +0 -101
  261. package/dest/contracts/slashing_proposer.d.ts +0 -21
  262. package/dest/contracts/slashing_proposer.d.ts.map +0 -1
  263. package/dest/contracts/slashing_proposer.js +0 -47
  264. package/dest/deploy_l1_contracts.d.ts +0 -21210
  265. package/dest/deploy_l1_contracts.d.ts.map +0 -1
  266. package/dest/deploy_l1_contracts.js +0 -687
  267. package/dest/eth_cheat_codes.d.ts +0 -147
  268. package/dest/eth_cheat_codes.d.ts.map +0 -1
  269. package/dest/eth_cheat_codes.js +0 -303
  270. package/dest/index.d.ts +0 -14
  271. package/dest/index.d.ts.map +0 -1
  272. package/dest/index.js +0 -13
  273. package/dest/l1_tx_utils.d.ts +0 -192
  274. package/dest/l1_tx_utils.d.ts.map +0 -1
  275. package/dest/l1_tx_utils.js +0 -641
  276. package/dest/l1_tx_utils_with_blobs.d.ts +0 -12
  277. package/dest/l1_tx_utils_with_blobs.d.ts.map +0 -1
  278. package/dest/l1_tx_utils_with_blobs.js +0 -64
  279. package/src/contracts/forwarder.ts +0 -132
  280. package/src/contracts/slashing_proposer.ts +0 -51
  281. package/src/deploy_l1_contracts.ts +0 -948
  282. package/src/eth_cheat_codes.ts +0 -314
  283. package/src/index.ts +0 -13
  284. package/src/l1_tx_utils.ts +0 -847
  285. package/src/l1_tx_utils_with_blobs.ts +0 -86
@@ -1,20 +1,21 @@
1
1
  import { EthAddress } from '@aztec/foundation/eth-address';
2
2
  import type { Logger } from '@aztec/foundation/log';
3
3
  import { sleep } from '@aztec/foundation/sleep';
4
- import { GovernanceAbi } from '@aztec/l1-artifacts';
4
+ import { GovernanceAbi } from '@aztec/l1-artifacts/GovernanceAbi';
5
5
 
6
6
  import {
7
7
  type EncodeFunctionDataParameters,
8
8
  type GetContractReturnType,
9
9
  type Hex,
10
+ type Log,
10
11
  encodeFunctionData,
11
12
  getContract,
13
+ parseEventLogs,
12
14
  } from 'viem';
13
15
 
14
16
  import type { L1ContractAddresses } from '../l1_contract_addresses.js';
15
- import { L1TxUtils } from '../l1_tx_utils.js';
16
- import type { ViemPublicClient, ViemWalletClient } from '../types.js';
17
- import { GovernanceProposerContract } from './governance_proposer.js';
17
+ import { createL1TxUtilsFromViemWallet } from '../l1_tx_utils/index.js';
18
+ import { type ExtendedViemWalletClient, type ViemClient, isExtendedClient } from '../types.js';
18
19
 
19
20
  export type L1GovernanceContractAddresses = Pick<
20
21
  L1ContractAddresses,
@@ -33,87 +34,54 @@ export enum ProposalState {
33
34
  Expired,
34
35
  }
35
36
 
36
- export class GovernanceContract {
37
- private readonly publicGovernance: GetContractReturnType<typeof GovernanceAbi, ViemPublicClient>;
38
- private readonly walletGovernance: GetContractReturnType<typeof GovernanceAbi, ViemWalletClient> | undefined;
37
+ export function extractProposalIdFromLogs(logs: Log[]): bigint {
38
+ const parsedLogs = parseEventLogs({
39
+ abi: GovernanceAbi,
40
+ logs: logs,
41
+ eventName: 'Proposed',
42
+ });
43
+
44
+ if (parsedLogs.length === 0) {
45
+ throw new Error('Proposal log not found');
46
+ }
47
+ return parsedLogs[0].args.proposalId;
48
+ }
49
+
50
+ export class ReadOnlyGovernanceContract {
51
+ protected readonly governanceContract: GetContractReturnType<typeof GovernanceAbi, ViemClient>;
39
52
 
40
53
  constructor(
41
54
  address: Hex,
42
- public readonly publicClient: ViemPublicClient,
43
- public readonly walletClient: ViemWalletClient | undefined,
55
+ public readonly client: ViemClient,
44
56
  ) {
45
- this.publicGovernance = getContract({ address, abi: GovernanceAbi, client: publicClient });
46
- this.walletGovernance = walletClient
47
- ? getContract({ address, abi: GovernanceAbi, client: walletClient })
48
- : undefined;
57
+ this.governanceContract = getContract({ address, abi: GovernanceAbi, client: client });
49
58
  }
50
59
 
51
60
  public get address() {
52
- return EthAddress.fromString(this.publicGovernance.address);
61
+ return EthAddress.fromString(this.governanceContract.address);
53
62
  }
54
63
 
55
- public async getProposer() {
56
- const governanceProposerAddress = EthAddress.fromString(await this.publicGovernance.read.governanceProposer());
57
- return new GovernanceProposerContract(this.publicClient, governanceProposerAddress.toString());
64
+ public async getGovernanceProposerAddress() {
65
+ return EthAddress.fromString(await this.governanceContract.read.governanceProposer());
58
66
  }
59
67
 
60
- public async getGovernanceAddresses(): Promise<L1GovernanceContractAddresses> {
61
- const governanceProposer = await this.getProposer();
62
- const [rollupAddress, registryAddress] = await Promise.all([
63
- governanceProposer.getRollupAddress(),
64
- governanceProposer.getRegistryAddress(),
65
- ]);
66
- return {
67
- governanceAddress: this.address,
68
- rollupAddress,
69
- registryAddress,
70
- governanceProposerAddress: governanceProposer.address,
71
- };
68
+ public getConfiguration() {
69
+ return this.governanceContract.read.getConfiguration();
72
70
  }
73
71
 
74
72
  public getProposal(proposalId: bigint) {
75
- return this.publicGovernance.read.getProposal([proposalId]);
73
+ return this.governanceContract.read.getProposal([proposalId]);
76
74
  }
77
75
 
78
76
  public async getProposalState(proposalId: bigint): Promise<ProposalState> {
79
- const state = await this.publicGovernance.read.getProposalState([proposalId]);
77
+ const state = await this.governanceContract.read.getProposalState([proposalId]);
78
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
80
79
  if (state < 0 || state > ProposalState.Expired) {
81
80
  throw new Error(`Invalid proposal state: ${state}`);
82
81
  }
83
82
  return state as ProposalState;
84
83
  }
85
84
 
86
- private assertWalletGovernance(): NonNullable<typeof this.walletGovernance> {
87
- if (!this.walletGovernance) {
88
- throw new Error('Wallet client is required for this operation');
89
- }
90
- return this.walletGovernance;
91
- }
92
-
93
- public async deposit(onBehalfOf: Hex, amount: bigint) {
94
- const walletGovernance = this.assertWalletGovernance();
95
- const depositTx = await walletGovernance.write.deposit([onBehalfOf, amount]);
96
- await this.publicClient.waitForTransactionReceipt({ hash: depositTx });
97
- }
98
-
99
- public async proposeWithLock({
100
- payloadAddress,
101
- withdrawAddress,
102
- }: {
103
- payloadAddress: Hex;
104
- withdrawAddress: Hex;
105
- }): Promise<number> {
106
- const walletGovernance = this.assertWalletGovernance();
107
- const proposeTx = await walletGovernance.write.proposeWithLock([payloadAddress, withdrawAddress]);
108
- const receipt = await this.publicClient.waitForTransactionReceipt({ hash: proposeTx });
109
- if (receipt.status !== 'success') {
110
- throw new Error(`Proposal failed: ${receipt.status}`);
111
- }
112
-
113
- const proposalId = Number(receipt.logs[1].topics[1]);
114
- return proposalId;
115
- }
116
-
117
85
  public async awaitProposalActive({ proposalId, logger }: { proposalId: bigint; logger: Logger }) {
118
86
  const state = await this.getProposalState(proposalId);
119
87
  if (state === ProposalState.Active) {
@@ -123,7 +91,7 @@ export class GovernanceContract {
123
91
  } else {
124
92
  const proposal = await this.getProposal(proposalId);
125
93
  const startOfActive = proposal.creation + proposal.config.votingDelay;
126
- const block = await this.publicClient.getBlock();
94
+ const block = await this.client.getBlock();
127
95
  // Add 12 seconds to the time to make sure we don't vote too early
128
96
  const secondsToActive = Number(startOfActive - block.timestamp) + 12;
129
97
  const now = new Date();
@@ -151,7 +119,7 @@ export class GovernanceContract {
151
119
  proposal.config.votingDelay +
152
120
  proposal.config.votingDuration +
153
121
  proposal.config.executionDelay;
154
- const block = await this.publicClient.getBlock();
122
+ const block = await this.client.getBlock();
155
123
  const secondsToExecutable = Number(startOfExecutable - block.timestamp) + 12;
156
124
  const now = new Date();
157
125
  logger.info(`
@@ -162,11 +130,55 @@ export class GovernanceContract {
162
130
  await sleep(secondsToExecutable * 1000);
163
131
  }
164
132
  }
133
+ }
134
+
135
+ export class GovernanceContract extends ReadOnlyGovernanceContract {
136
+ protected override readonly governanceContract: GetContractReturnType<typeof GovernanceAbi, ExtendedViemWalletClient>;
137
+
138
+ constructor(
139
+ address: Hex | EthAddress,
140
+ public override readonly client: ExtendedViemWalletClient,
141
+ ) {
142
+ if (address instanceof EthAddress) {
143
+ address = address.toString();
144
+ }
145
+ super(address, client);
146
+ if (!isExtendedClient(client)) {
147
+ throw new Error('GovernanceContract has to be instantiated with a wallet client.');
148
+ }
149
+ this.governanceContract = getContract({ address, abi: GovernanceAbi, client });
150
+ }
151
+
152
+ public async deposit(onBehalfOf: Hex, amount: bigint) {
153
+ const depositTx = await this.governanceContract.write.deposit([onBehalfOf, amount]);
154
+ await this.client.waitForTransactionReceipt({ hash: depositTx });
155
+ }
156
+
157
+ public async proposeWithLock({
158
+ payloadAddress,
159
+ withdrawAddress,
160
+ }: {
161
+ payloadAddress: Hex;
162
+ withdrawAddress: Hex;
163
+ }): Promise<bigint> {
164
+ const proposeTx = await this.governanceContract.write.proposeWithLock([payloadAddress, withdrawAddress]);
165
+ const receipt = await this.client.waitForTransactionReceipt({ hash: proposeTx });
166
+ if (receipt.status !== 'success') {
167
+ throw new Error(`Proposal failed: ${receipt.status}`);
168
+ }
169
+ return extractProposalIdFromLogs(receipt.logs);
170
+ }
165
171
 
166
172
  public async getPower(): Promise<bigint> {
167
- const walletGovernance = this.assertWalletGovernance();
168
- const now = await this.publicClient.getBlock();
169
- return walletGovernance.read.powerAt([this.walletClient!.account.address, now.timestamp]);
173
+ const now = await this.client.getBlock();
174
+ return this.governanceContract.read.powerAt([this.client.account.address, now.timestamp]);
175
+ }
176
+
177
+ /** Returns the user's voting power for a specific proposal, checked at pendingThrough timestamp. */
178
+ public async getPowerForProposal(proposalId: bigint): Promise<bigint> {
179
+ const proposal = await this.getProposal(proposalId);
180
+ const pendingThrough = proposal.creation + proposal.config.votingDelay;
181
+ return this.governanceContract.read.powerAt([this.client.account.address, pendingThrough]);
170
182
  }
171
183
 
172
184
  public async vote({
@@ -182,11 +194,10 @@ export class GovernanceContract {
182
194
  retries: number;
183
195
  logger: Logger;
184
196
  }) {
185
- const walletGovernance = this.assertWalletGovernance();
186
- const l1TxUtils = new L1TxUtils(this.publicClient, this.walletClient!, logger);
197
+ const l1TxUtils = createL1TxUtilsFromViemWallet(this.client, { logger });
187
198
  const retryDelaySeconds = 12;
188
199
 
189
- voteAmount = voteAmount ?? (await this.getPower());
200
+ voteAmount = voteAmount ?? (await this.getPowerForProposal(proposalId));
190
201
 
191
202
  let success = false;
192
203
  for (let i = 0; i < retries; i++) {
@@ -199,7 +210,8 @@ export class GovernanceContract {
199
210
  const encodedVoteData = encodeFunctionData(voteFunctionData);
200
211
 
201
212
  const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
202
- to: walletGovernance.address,
213
+ to: this.governanceContract.address,
214
+ abi: GovernanceAbi,
203
215
  data: encodedVoteData,
204
216
  });
205
217
 
@@ -209,7 +221,7 @@ export class GovernanceContract {
209
221
  } else {
210
222
  const args = {
211
223
  ...voteFunctionData,
212
- address: walletGovernance.address,
224
+ address: this.governanceContract.address,
213
225
  };
214
226
  const errorMsg = await l1TxUtils.tryGetErrorFromRevertedTx(encodedVoteData, args, undefined, []);
215
227
  logger.error(`Error voting on proposal ${proposalId}: ${errorMsg}`);
@@ -226,9 +238,9 @@ export class GovernanceContract {
226
238
  }
227
239
  logger.info(`Voted [${inFavor ? 'yea' : 'nay'}] on proposal [${proposalId}]`);
228
240
  const proposal = await this.getProposal(proposalId);
229
- logger.info(`Proposal [${proposalId}] has state [${proposal.state}]`);
241
+ logger.info(`Proposal [${proposalId}] has cached state [${proposal.cachedState}]`);
230
242
  logger.info(`Proposal [${proposalId}] has summedBallot yea [${proposal.summedBallot.yea}]`);
231
- logger.info(`Proposal [${proposalId}] has summedBallot nea [${proposal.summedBallot.nea}]`);
243
+ logger.info(`Proposal [${proposalId}] has summedBallot nay [${proposal.summedBallot.nay}]`);
232
244
  }
233
245
 
234
246
  public async executeProposal({
@@ -240,8 +252,7 @@ export class GovernanceContract {
240
252
  retries: number;
241
253
  logger: Logger;
242
254
  }) {
243
- const walletGovernance = this.assertWalletGovernance();
244
- const l1TxUtils = new L1TxUtils(this.publicClient, this.walletClient!, logger);
255
+ const l1TxUtils = createL1TxUtilsFromViemWallet(this.client, { logger });
245
256
  const retryDelaySeconds = 12;
246
257
  let success = false;
247
258
  for (let i = 0; i < retries; i++) {
@@ -254,7 +265,8 @@ export class GovernanceContract {
254
265
  const encodedExecuteData = encodeFunctionData(executeFunctionData);
255
266
 
256
267
  const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
257
- to: walletGovernance.address,
268
+ to: this.governanceContract.address,
269
+ abi: GovernanceAbi,
258
270
  data: encodedExecuteData,
259
271
  });
260
272
 
@@ -264,7 +276,7 @@ export class GovernanceContract {
264
276
  } else {
265
277
  const args = {
266
278
  ...executeFunctionData,
267
- address: walletGovernance.address,
279
+ address: this.governanceContract.address,
268
280
  };
269
281
  const errorMsg = await l1TxUtils.tryGetErrorFromRevertedTx(encodedExecuteData, args, undefined, []);
270
282
  logger.error(`Error executing proposal ${proposalId}: ${errorMsg}`);
@@ -1,17 +1,32 @@
1
+ import { SlotNumber } from '@aztec/foundation/branded-types';
1
2
  import { memoize } from '@aztec/foundation/decorators';
2
3
  import { EthAddress } from '@aztec/foundation/eth-address';
3
- import { GovernanceProposerAbi } from '@aztec/l1-artifacts';
4
+ import { GovernanceProposerAbi } from '@aztec/l1-artifacts/GovernanceProposerAbi';
4
5
 
5
- import { type GetContractReturnType, type Hex, type TransactionReceipt, encodeFunctionData, getContract } from 'viem';
6
+ import {
7
+ type GetContractReturnType,
8
+ type Hex,
9
+ type TransactionReceipt,
10
+ type TypedDataDefinition,
11
+ encodeFunctionData,
12
+ getContract,
13
+ } from 'viem';
6
14
 
7
- import type { GasPrice, L1TxRequest, L1TxUtils } from '../l1_tx_utils.js';
8
- import type { ViemPublicClient } from '../types.js';
9
- import { type IEmpireBase, encodeVote } from './empire_base.js';
15
+ import type { L1TxRequest, L1TxUtils } from '../l1_tx_utils/index.js';
16
+ import type { ViemClient } from '../types.js';
17
+ import { type IEmpireBase, encodeSignal, encodeSignalWithSignature, signSignalWithSig } from './empire_base.js';
18
+ import { extractProposalIdFromLogs } from './governance.js';
10
19
 
11
20
  export class GovernanceProposerContract implements IEmpireBase {
12
- private readonly proposer: GetContractReturnType<typeof GovernanceProposerAbi, ViemPublicClient>;
21
+ private readonly proposer: GetContractReturnType<typeof GovernanceProposerAbi, ViemClient>;
13
22
 
14
- constructor(public readonly client: ViemPublicClient, address: Hex) {
23
+ constructor(
24
+ public readonly client: ViemClient,
25
+ address: Hex | EthAddress,
26
+ ) {
27
+ if (address instanceof EthAddress) {
28
+ address = address.toString();
29
+ }
15
30
  this.proposer = getContract({ address, abi: GovernanceProposerAbi, client });
16
31
  }
17
32
 
@@ -29,54 +44,89 @@ export class GovernanceProposerContract implements IEmpireBase {
29
44
  }
30
45
 
31
46
  public getQuorumSize(): Promise<bigint> {
32
- return this.proposer.read.N();
47
+ return this.proposer.read.QUORUM_SIZE();
33
48
  }
34
49
 
35
50
  public getRoundSize(): Promise<bigint> {
36
- return this.proposer.read.M();
51
+ return this.proposer.read.ROUND_SIZE();
37
52
  }
38
53
 
39
- public computeRound(slot: bigint): Promise<bigint> {
40
- return this.proposer.read.computeRound([slot]);
54
+ public getInstance() {
55
+ return this.proposer.read.getInstance();
56
+ }
57
+
58
+ public computeRound(slot: SlotNumber): Promise<bigint> {
59
+ return this.proposer.read.computeRound([BigInt(slot)]);
41
60
  }
42
61
 
43
62
  public async getRoundInfo(
44
63
  rollupAddress: Hex,
45
64
  round: bigint,
46
- ): Promise<{ lastVote: bigint; leader: Hex; executed: boolean }> {
47
- const roundInfo = await this.proposer.read.rounds([rollupAddress, round]);
65
+ ): Promise<{ lastSignalSlot: SlotNumber; payloadWithMostSignals: Hex; quorumReached: boolean; executed: boolean }> {
66
+ const result = await this.proposer.read.getRoundData([rollupAddress, round]);
67
+ const [signalCount, quorum] = await Promise.all([
68
+ this.proposer.read.signalCount([rollupAddress, round, result.payloadWithMostSignals]),
69
+ this.getQuorumSize(),
70
+ ]);
48
71
  return {
49
- lastVote: roundInfo[0],
50
- leader: roundInfo[1],
51
- executed: roundInfo[2],
72
+ lastSignalSlot: SlotNumber.fromBigInt(result.lastSignalSlot),
73
+ payloadWithMostSignals: result.payloadWithMostSignals,
74
+ quorumReached: signalCount >= quorum,
75
+ executed: result.executed,
52
76
  };
53
77
  }
54
78
 
55
- public getProposalVotes(rollupAddress: Hex, round: bigint, proposal: Hex): Promise<bigint> {
56
- return this.proposer.read.yeaCount([rollupAddress, round, proposal]);
79
+ public getPayloadSignals(rollupAddress: Hex, round: bigint, payload: Hex): Promise<bigint> {
80
+ return this.proposer.read.signalCount([rollupAddress, round, payload]);
81
+ }
82
+
83
+ public createSignalRequest(payload: Hex): L1TxRequest {
84
+ return {
85
+ to: this.address.toString(),
86
+ abi: GovernanceProposerAbi,
87
+ data: encodeSignal(payload),
88
+ };
57
89
  }
58
90
 
59
- public createVoteRequest(payload: Hex): L1TxRequest {
91
+ public async createSignalRequestWithSignature(
92
+ payload: Hex,
93
+ slot: SlotNumber,
94
+ chainId: number,
95
+ signerAddress: Hex,
96
+ signer: (msg: TypedDataDefinition) => Promise<Hex>,
97
+ ): Promise<L1TxRequest> {
98
+ const signature = await signSignalWithSig(
99
+ signer,
100
+ payload,
101
+ slot,
102
+ await this.getInstance(),
103
+ this.address.toString(),
104
+ chainId,
105
+ );
60
106
  return {
61
107
  to: this.address.toString(),
62
- data: encodeVote(payload),
108
+ abi: GovernanceProposerAbi,
109
+ data: encodeSignalWithSignature(payload, signature),
63
110
  };
64
111
  }
65
112
 
66
- public executeProposal(
113
+ public async submitRoundWinner(
67
114
  round: bigint,
68
115
  l1TxUtils: L1TxUtils,
69
116
  ): Promise<{
70
117
  receipt: TransactionReceipt;
71
- gasPrice: GasPrice;
118
+ proposalId: bigint;
72
119
  }> {
73
- return l1TxUtils.sendAndMonitorTransaction({
120
+ const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
74
121
  to: this.address.toString(),
122
+ abi: GovernanceProposerAbi,
75
123
  data: encodeFunctionData({
76
- abi: this.proposer.abi,
77
- functionName: 'executeProposal',
124
+ abi: GovernanceProposerAbi,
125
+ functionName: 'submitRoundWinner',
78
126
  args: [round],
79
127
  }),
80
128
  });
129
+ const proposalId = extractProposalIdFromLogs(receipt.logs);
130
+ return { receipt, proposalId };
81
131
  }
82
132
  }
@@ -0,0 +1,88 @@
1
+ import { EthAddress } from '@aztec/foundation/eth-address';
2
+ import { GSEAbi } from '@aztec/l1-artifacts/GSEAbi';
3
+
4
+ import type { ProjPointType } from '@noble/curves/abstract/weierstrass';
5
+ import { bn254 } from '@noble/curves/bn254';
6
+ import { type GetContractReturnType, type Hex, getContract } from 'viem';
7
+
8
+ import type { ViemClient } from '../types.js';
9
+
10
+ export type RegistrationTuple = {
11
+ publicKeyInG1: {
12
+ x: bigint;
13
+ y: bigint;
14
+ };
15
+ publicKeyInG2: {
16
+ x0: bigint;
17
+ x1: bigint;
18
+ y0: bigint;
19
+ y1: bigint;
20
+ };
21
+ proofOfPossession: {
22
+ x: bigint;
23
+ y: bigint;
24
+ };
25
+ };
26
+
27
+ export class GSEContract {
28
+ public address: EthAddress;
29
+ private readonly gse: GetContractReturnType<typeof GSEAbi, ViemClient>;
30
+
31
+ constructor(
32
+ public readonly client: ViemClient,
33
+ address: Hex | EthAddress,
34
+ ) {
35
+ if (address instanceof EthAddress) {
36
+ address = address.toString();
37
+ }
38
+ this.address = EthAddress.fromString(address);
39
+ this.gse = getContract({ address, abi: GSEAbi, client });
40
+ }
41
+
42
+ public async getOwner(): Promise<EthAddress> {
43
+ return EthAddress.fromString(await this.gse.read.owner());
44
+ }
45
+
46
+ public async getGovernance(): Promise<EthAddress> {
47
+ return EthAddress.fromString(await this.gse.read.getGovernance());
48
+ }
49
+
50
+ getAttestersFromIndicesAtTime(instance: Hex | EthAddress, ts: bigint, indices: bigint[]) {
51
+ if (instance instanceof EthAddress) {
52
+ instance = instance.toString();
53
+ }
54
+ return this.gse.read.getAttestersFromIndicesAtTime([instance, ts, indices]);
55
+ }
56
+
57
+ public async getRegistrationDigest(publicKey: ProjPointType<bigint>): Promise<ProjPointType<bigint>> {
58
+ const affinePublicKey = publicKey.toAffine();
59
+ const g1PointDigest = await this.gse.read.getRegistrationDigest([{ x: affinePublicKey.x, y: affinePublicKey.y }]);
60
+ return bn254.G1.ProjectivePoint.fromAffine(g1PointDigest);
61
+ }
62
+
63
+ public async makeRegistrationTuple(privateKey: bigint): Promise<RegistrationTuple> {
64
+ const publicKeyG1 = bn254.G1.ProjectivePoint.BASE.multiply(privateKey);
65
+ const digest = await this.getRegistrationDigest(publicKeyG1);
66
+ const signature = digest.multiply(privateKey);
67
+ const publicKeyG2 = bn254.G2.ProjectivePoint.BASE.multiply(privateKey);
68
+ const publicKeyG1Affine = publicKeyG1.toAffine();
69
+ const signatureAffine = signature.toAffine();
70
+ const publicKeyG2Affine = publicKeyG2.toAffine();
71
+ return {
72
+ publicKeyInG1: {
73
+ x: publicKeyG1Affine.x,
74
+ y: publicKeyG1Affine.y,
75
+ },
76
+ publicKeyInG2: {
77
+ x0: publicKeyG2Affine.x.c0,
78
+ x1: publicKeyG2Affine.x.c1,
79
+ y0: publicKeyG2Affine.y.c0,
80
+ y1: publicKeyG2Affine.y.c1,
81
+ },
82
+ proofOfPossession: {
83
+ x: signatureAffine.x,
84
+ y: signatureAffine.y,
85
+ },
86
+ };
87
+ }
88
+ }
@@ -0,0 +1,115 @@
1
+ import { CheckpointNumber } from '@aztec/foundation/branded-types';
2
+ import { Buffer16, Buffer32 } from '@aztec/foundation/buffer';
3
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
+ import { EthAddress } from '@aztec/foundation/eth-address';
5
+ import { InboxAbi } from '@aztec/l1-artifacts/InboxAbi';
6
+
7
+ import { type BlockTag, type GetContractReturnType, type Hex, getContract } from 'viem';
8
+
9
+ import { getPublicClient } from '../client.js';
10
+ import type { DeployAztecL1ContractsReturnType } from '../deploy_aztec_l1_contracts.js';
11
+ import type { L1ReaderConfig } from '../l1_reader.js';
12
+ import type { ViemClient } from '../types.js';
13
+ import type { L1EventLog } from './log.js';
14
+ import { checkBlockTag } from './utils.js';
15
+
16
+ /** Arguments for the MessageSent event. */
17
+ export type MessageSentArgs = {
18
+ index: bigint;
19
+ leaf: Fr;
20
+ checkpointNumber: CheckpointNumber;
21
+ rollingHash: Buffer16;
22
+ };
23
+
24
+ /** Log type for MessageSent events. */
25
+ export type MessageSentLog = L1EventLog<MessageSentArgs>;
26
+
27
+ export class InboxContract {
28
+ private readonly inbox: GetContractReturnType<typeof InboxAbi, ViemClient>;
29
+
30
+ static getFromL1ContractsValues(deployL1ContractsValues: DeployAztecL1ContractsReturnType) {
31
+ const {
32
+ l1Client,
33
+ l1ContractAddresses: { inboxAddress },
34
+ } = deployL1ContractsValues;
35
+ return new InboxContract(l1Client, inboxAddress.toString());
36
+ }
37
+
38
+ static getFromConfig(config: L1ReaderConfig) {
39
+ const client = getPublicClient(config);
40
+ const address = config.l1Contracts.inboxAddress.toString();
41
+ return new InboxContract(client, address);
42
+ }
43
+
44
+ constructor(
45
+ public readonly client: ViemClient,
46
+ address: Hex | EthAddress,
47
+ ) {
48
+ if (address instanceof EthAddress) {
49
+ address = address.toString();
50
+ }
51
+ this.inbox = getContract({ address, abi: InboxAbi, client });
52
+ }
53
+
54
+ public get address() {
55
+ return this.inbox.address;
56
+ }
57
+
58
+ public getContract(): GetContractReturnType<typeof InboxAbi, ViemClient> {
59
+ return this.inbox;
60
+ }
61
+
62
+ public async getLag(opts: { blockTag?: BlockTag; blockNumber?: bigint } = {}): Promise<bigint> {
63
+ await checkBlockTag(opts.blockNumber, this.client);
64
+ return await this.inbox.read.LAG(opts);
65
+ }
66
+
67
+ public async getState(opts: { blockTag?: BlockTag; blockNumber?: bigint } = {}): Promise<InboxContractState> {
68
+ await checkBlockTag(opts.blockNumber, this.client);
69
+ const state = await this.inbox.read.getState(opts);
70
+ return {
71
+ totalMessagesInserted: state.totalMessagesInserted,
72
+ messagesRollingHash: Buffer16.fromString(state.rollingHash),
73
+ treeInProgress: state.inProgress,
74
+ };
75
+ }
76
+
77
+ /** Fetches MessageSent events within the given block range. */
78
+ async getMessageSentEvents(fromBlock: bigint, toBlock: bigint): Promise<MessageSentLog[]> {
79
+ const logs = await this.inbox.getEvents.MessageSent({}, { fromBlock, toBlock });
80
+ return logs
81
+ .filter(log => log.blockNumber! >= fromBlock && log.blockNumber! <= toBlock)
82
+ .map(log => this.mapMessageSentLog(log));
83
+ }
84
+
85
+ /** Fetches MessageSent events for a specific message hash within the given block range. */
86
+ async getMessageSentEventByHash(hash: Hex, fromBlock: bigint, toBlock: bigint): Promise<MessageSentLog[]> {
87
+ const logs = await this.inbox.getEvents.MessageSent({ hash }, { fromBlock, toBlock });
88
+ return logs.map(log => this.mapMessageSentLog(log));
89
+ }
90
+
91
+ private mapMessageSentLog(log: {
92
+ blockNumber: bigint | null;
93
+ blockHash: `0x${string}` | null;
94
+ transactionHash: `0x${string}` | null;
95
+ args: { index?: bigint; hash?: `0x${string}`; checkpointNumber?: bigint; rollingHash?: `0x${string}` };
96
+ }): MessageSentLog {
97
+ return {
98
+ l1BlockNumber: log.blockNumber!,
99
+ l1BlockHash: Buffer32.fromString(log.blockHash!),
100
+ l1TransactionHash: log.transactionHash!,
101
+ args: {
102
+ index: log.args.index!,
103
+ leaf: Fr.fromString(log.args.hash!),
104
+ checkpointNumber: CheckpointNumber.fromBigInt(log.args.checkpointNumber!),
105
+ rollingHash: Buffer16.fromString(log.args.rollingHash!),
106
+ },
107
+ };
108
+ }
109
+ }
110
+
111
+ export type InboxContractState = {
112
+ totalMessagesInserted: bigint;
113
+ messagesRollingHash: Buffer16;
114
+ treeInProgress: bigint;
115
+ };
@@ -1,8 +1,16 @@
1
1
  export * from './empire_base.js';
2
+ export * from './errors.js';
3
+ export * from './fee_asset_handler.js';
2
4
  export * from './fee_juice.js';
3
- export * from './forwarder.js';
4
5
  export * from './governance.js';
5
6
  export * from './governance_proposer.js';
7
+ export * from './gse.js';
8
+ export * from './inbox.js';
9
+ export * from './log.js';
10
+ export * from './multicall.js';
11
+ export * from './outbox.js';
6
12
  export * from './registry.js';
7
13
  export * from './rollup.js';
8
- export * from './slashing_proposer.js';
14
+ export * from './empire_slashing_proposer.js';
15
+ export * from './tally_slashing_proposer.js';
16
+ export * from './slasher_contract.js';
@@ -0,0 +1,13 @@
1
+ import type { Buffer32 } from '@aztec/foundation/buffer';
2
+
3
+ /** Base L1 event log with common fields. */
4
+ export type L1EventLog<T> = {
5
+ /** L1 block number where the event was emitted. */
6
+ l1BlockNumber: bigint;
7
+ /** L1 block hash. */
8
+ l1BlockHash: Buffer32;
9
+ /** L1 transaction hash that emitted the event. */
10
+ l1TransactionHash: `0x${string}`;
11
+ /** Event-specific arguments. */
12
+ args: T;
13
+ };