@aztec/aztec.js 0.76.4 → 0.77.0-testnet-ignition.21

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 (274) hide show
  1. package/dest/account/contract.d.ts +9 -5
  2. package/dest/account/contract.d.ts.map +1 -1
  3. package/dest/account/contract.js +15 -2
  4. package/dest/account/index.d.ts +2 -2
  5. package/dest/account/index.d.ts.map +1 -1
  6. package/dest/account/index.js +8 -1
  7. package/dest/account/interface.d.ts +5 -4
  8. package/dest/account/interface.d.ts.map +1 -1
  9. package/dest/account/interface.js +4 -3
  10. package/dest/account/wallet.d.ts +4 -3
  11. package/dest/account/wallet.d.ts.map +1 -1
  12. package/dest/account/wallet.js +3 -2
  13. package/dest/account_manager/deploy_account_method.d.ts +5 -5
  14. package/dest/account_manager/deploy_account_method.d.ts.map +1 -1
  15. package/dest/account_manager/deploy_account_method.js +22 -25
  16. package/dest/account_manager/deploy_account_sent_tx.d.ts +4 -3
  17. package/dest/account_manager/deploy_account_sent_tx.d.ts.map +1 -1
  18. package/dest/account_manager/deploy_account_sent_tx.js +16 -17
  19. package/dest/account_manager/index.d.ts +20 -11
  20. package/dest/account_manager/index.d.ts.map +1 -1
  21. package/dest/account_manager/index.js +89 -87
  22. package/dest/api/abi.d.ts +2 -3
  23. package/dest/api/abi.d.ts.map +1 -1
  24. package/dest/api/abi.js +1 -3
  25. package/dest/api/account.d.ts +1 -2
  26. package/dest/api/account.d.ts.map +1 -1
  27. package/dest/api/account.js +1 -2
  28. package/dest/api/addresses.d.ts +2 -2
  29. package/dest/api/addresses.d.ts.map +1 -1
  30. package/dest/api/addresses.js +2 -3
  31. package/dest/api/cheat_codes.d.ts +4 -4
  32. package/dest/api/cheat_codes.d.ts.map +1 -1
  33. package/dest/api/cheat_codes.js +10 -15
  34. package/dest/api/deployment.js +0 -1
  35. package/dest/api/entrypoint.js +0 -1
  36. package/dest/api/eth_address.js +0 -1
  37. package/dest/api/ethereum/anvil_test_watcher.d.ts +10 -6
  38. package/dest/api/ethereum/anvil_test_watcher.d.ts.map +1 -1
  39. package/dest/api/ethereum/anvil_test_watcher.js +43 -18
  40. package/dest/api/ethereum/chain_monitor.d.ts +6 -2
  41. package/dest/api/ethereum/chain_monitor.d.ts.map +1 -1
  42. package/dest/api/ethereum/chain_monitor.js +24 -8
  43. package/dest/api/ethereum/cheat_codes.d.ts +14 -3
  44. package/dest/api/ethereum/cheat_codes.d.ts.map +1 -1
  45. package/dest/api/ethereum/cheat_codes.js +106 -53
  46. package/dest/api/ethereum/index.d.ts +1 -1
  47. package/dest/api/ethereum/index.d.ts.map +1 -1
  48. package/dest/api/ethereum/index.js +1 -2
  49. package/dest/api/ethereum/l1_contracts.d.ts +1 -1
  50. package/dest/api/ethereum/l1_contracts.d.ts.map +1 -1
  51. package/dest/api/ethereum/l1_contracts.js +4 -6
  52. package/dest/api/ethereum/portal_manager.d.ts +16 -12
  53. package/dest/api/ethereum/portal_manager.d.ts.map +1 -1
  54. package/dest/api/ethereum/portal_manager.js +134 -115
  55. package/dest/api/fee.d.ts +0 -1
  56. package/dest/api/fee.d.ts.map +1 -1
  57. package/dest/api/fee.js +0 -2
  58. package/dest/api/fields.js +0 -1
  59. package/dest/api/interfaces/pxe.d.ts +1 -1
  60. package/dest/api/interfaces/pxe.d.ts.map +1 -1
  61. package/dest/api/interfaces/pxe.js +1 -2
  62. package/dest/api/log.js +0 -1
  63. package/dest/api/log_id.d.ts +1 -1
  64. package/dest/api/log_id.d.ts.map +1 -1
  65. package/dest/api/log_id.js +1 -2
  66. package/dest/api/tx_hash.d.ts +1 -1
  67. package/dest/api/tx_hash.d.ts.map +1 -1
  68. package/dest/api/tx_hash.js +1 -2
  69. package/dest/api/wallet.d.ts +1 -1
  70. package/dest/api/wallet.d.ts.map +1 -1
  71. package/dest/api/wallet.js +1 -2
  72. package/dest/contract/base_contract_interaction.d.ts +21 -5
  73. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  74. package/dest/contract/base_contract_interaction.js +97 -55
  75. package/dest/contract/batch_call.d.ts +3 -2
  76. package/dest/contract/batch_call.d.ts.map +1 -1
  77. package/dest/contract/batch_call.js +64 -40
  78. package/dest/contract/checker.d.ts +1 -1
  79. package/dest/contract/checker.d.ts.map +1 -1
  80. package/dest/contract/checker.js +29 -20
  81. package/dest/contract/contract.d.ts +4 -4
  82. package/dest/contract/contract.d.ts.map +1 -1
  83. package/dest/contract/contract.js +30 -28
  84. package/dest/contract/contract_base.d.ts +5 -5
  85. package/dest/contract/contract_base.d.ts.map +1 -1
  86. package/dest/contract/contract_base.js +22 -31
  87. package/dest/contract/contract_function_interaction.d.ts +9 -8
  88. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  89. package/dest/contract/contract_function_interaction.js +63 -51
  90. package/dest/contract/deploy_method.d.ts +14 -11
  91. package/dest/contract/deploy_method.d.ts.map +1 -1
  92. package/dest/contract/deploy_method.js +115 -87
  93. package/dest/contract/deploy_proven_tx.d.ts +6 -4
  94. package/dest/contract/deploy_proven_tx.d.ts.map +1 -1
  95. package/dest/contract/deploy_proven_tx.js +8 -11
  96. package/dest/contract/deploy_sent_tx.d.ts +8 -6
  97. package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
  98. package/dest/contract/deploy_sent_tx.js +19 -22
  99. package/dest/contract/get_gas_limits.d.ts +2 -2
  100. package/dest/contract/get_gas_limits.d.ts.map +1 -1
  101. package/dest/contract/get_gas_limits.js +2 -4
  102. package/dest/contract/index.js +2 -4
  103. package/dest/{deployment → contract}/protocol_contracts.d.ts +4 -2
  104. package/dest/contract/protocol_contracts.d.ts.map +1 -0
  105. package/dest/contract/protocol_contracts.js +26 -0
  106. package/dest/contract/proven_tx.d.ts +3 -2
  107. package/dest/contract/proven_tx.d.ts.map +1 -1
  108. package/dest/contract/proven_tx.js +8 -11
  109. package/dest/contract/sent_tx.d.ts +3 -2
  110. package/dest/contract/sent_tx.d.ts.map +1 -1
  111. package/dest/contract/sent_tx.js +33 -35
  112. package/dest/contract/unsafe_contract.d.ts +3 -3
  113. package/dest/contract/unsafe_contract.d.ts.map +1 -1
  114. package/dest/contract/unsafe_contract.js +2 -10
  115. package/dest/deployment/broadcast_function.d.ts +3 -3
  116. package/dest/deployment/broadcast_function.d.ts.map +1 -1
  117. package/dest/deployment/broadcast_function.js +39 -32
  118. package/dest/deployment/contract_deployer.d.ts +3 -3
  119. package/dest/deployment/contract_deployer.d.ts.map +1 -1
  120. package/dest/deployment/contract_deployer.js +16 -15
  121. package/dest/deployment/deploy_instance.d.ts +3 -3
  122. package/dest/deployment/deploy_instance.d.ts.map +1 -1
  123. package/dest/deployment/deploy_instance.js +3 -5
  124. package/dest/deployment/index.js +0 -1
  125. package/dest/deployment/register_class.d.ts +3 -3
  126. package/dest/deployment/register_class.d.ts.map +1 -1
  127. package/dest/deployment/register_class.js +19 -14
  128. package/dest/entrypoint/default_entrypoint.d.ts +2 -2
  129. package/dest/entrypoint/default_entrypoint.d.ts.map +1 -1
  130. package/dest/entrypoint/default_entrypoint.js +11 -9
  131. package/dest/entrypoint/default_multi_call_entrypoint.d.ts +2 -2
  132. package/dest/entrypoint/default_multi_call_entrypoint.d.ts.map +1 -1
  133. package/dest/entrypoint/default_multi_call_entrypoint.js +68 -25
  134. package/dest/entrypoint/entrypoint.d.ts +7 -3
  135. package/dest/entrypoint/entrypoint.d.ts.map +1 -1
  136. package/dest/entrypoint/entrypoint.js +0 -1
  137. package/dest/entrypoint/payload.d.ts +8 -5
  138. package/dest/entrypoint/payload.d.ts.map +1 -1
  139. package/dest/entrypoint/payload.js +78 -85
  140. package/dest/fee/fee_juice_payment_method.d.ts +3 -3
  141. package/dest/fee/fee_juice_payment_method.d.ts.map +1 -1
  142. package/dest/fee/fee_juice_payment_method.js +5 -4
  143. package/dest/fee/fee_juice_payment_method_with_claim.d.ts +5 -4
  144. package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
  145. package/dest/fee/fee_juice_payment_method_with_claim.js +18 -20
  146. package/dest/fee/fee_payment_method.d.ts +3 -3
  147. package/dest/fee/fee_payment_method.d.ts.map +1 -1
  148. package/dest/fee/fee_payment_method.js +3 -2
  149. package/dest/fee/private_fee_payment_method.d.ts +5 -5
  150. package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
  151. package/dest/fee/private_fee_payment_method.js +40 -38
  152. package/dest/fee/public_fee_payment_method.d.ts +5 -5
  153. package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
  154. package/dest/fee/public_fee_payment_method.js +38 -35
  155. package/dest/index.d.ts +25 -12
  156. package/dest/index.d.ts.map +1 -1
  157. package/dest/index.js +24 -14
  158. package/dest/rpc_clients/index.js +0 -1
  159. package/dest/rpc_clients/node/index.d.ts +2 -1
  160. package/dest/rpc_clients/node/index.d.ts.map +1 -1
  161. package/dest/rpc_clients/node/index.js +35 -18
  162. package/dest/rpc_clients/pxe_client.d.ts +2 -2
  163. package/dest/rpc_clients/pxe_client.d.ts.map +1 -1
  164. package/dest/rpc_clients/pxe_client.js +9 -7
  165. package/dest/utils/abi_types.d.ts +4 -1
  166. package/dest/utils/abi_types.d.ts.map +1 -1
  167. package/dest/utils/abi_types.js +1 -2
  168. package/dest/utils/authwit.d.ts +3 -2
  169. package/dest/utils/authwit.d.ts.map +1 -1
  170. package/dest/utils/authwit.js +18 -17
  171. package/dest/utils/aztec_cheatcodes.d.ts +4 -2
  172. package/dest/utils/aztec_cheatcodes.d.ts.map +1 -1
  173. package/dest/utils/aztec_cheatcodes.js +32 -41
  174. package/dest/utils/field_compressed_string.js +3 -5
  175. package/dest/utils/index.d.ts +1 -1
  176. package/dest/utils/index.d.ts.map +1 -1
  177. package/dest/utils/index.js +1 -2
  178. package/dest/utils/node.d.ts +3 -3
  179. package/dest/utils/node.d.ts.map +1 -1
  180. package/dest/utils/node.js +4 -6
  181. package/dest/utils/pub_key.d.ts +2 -1
  182. package/dest/utils/pub_key.d.ts.map +1 -1
  183. package/dest/utils/pub_key.js +2 -4
  184. package/dest/utils/pxe.d.ts +2 -2
  185. package/dest/utils/pxe.d.ts.map +1 -1
  186. package/dest/utils/pxe.js +3 -5
  187. package/dest/wallet/account_wallet.d.ts +8 -5
  188. package/dest/wallet/account_wallet.d.ts.map +1 -1
  189. package/dest/wallet/account_wallet.js +120 -83
  190. package/dest/wallet/account_wallet_with_private_key.d.ts +5 -5
  191. package/dest/wallet/account_wallet_with_private_key.d.ts.map +1 -1
  192. package/dest/wallet/account_wallet_with_private_key.js +10 -16
  193. package/dest/wallet/base_wallet.d.ts +19 -10
  194. package/dest/wallet/base_wallet.d.ts.map +1 -1
  195. package/dest/wallet/base_wallet.js +12 -13
  196. package/dest/wallet/index.d.ts +3 -3
  197. package/dest/wallet/index.d.ts.map +1 -1
  198. package/dest/wallet/index.js +2 -4
  199. package/dest/wallet/signerless_wallet.d.ts +7 -4
  200. package/dest/wallet/signerless_wallet.d.ts.map +1 -1
  201. package/dest/wallet/signerless_wallet.js +4 -6
  202. package/package.json +10 -14
  203. package/src/account/contract.ts +22 -5
  204. package/src/account/index.ts +2 -2
  205. package/src/account/interface.ts +5 -4
  206. package/src/account/wallet.ts +4 -3
  207. package/src/account_manager/deploy_account_method.ts +5 -5
  208. package/src/account_manager/deploy_account_sent_tx.ts +4 -3
  209. package/src/account_manager/index.ts +51 -24
  210. package/src/api/abi.ts +10 -3
  211. package/src/api/account.ts +8 -3
  212. package/src/api/addresses.ts +2 -2
  213. package/src/api/cheat_codes.ts +6 -6
  214. package/src/api/ethereum/anvil_test_watcher.ts +31 -7
  215. package/src/api/ethereum/chain_monitor.ts +9 -2
  216. package/src/api/ethereum/cheat_codes.ts +65 -24
  217. package/src/api/ethereum/index.ts +5 -1
  218. package/src/api/ethereum/l1_contracts.ts +1 -1
  219. package/src/api/ethereum/portal_manager.ts +27 -32
  220. package/src/api/fee.ts +0 -1
  221. package/src/api/interfaces/pxe.ts +1 -1
  222. package/src/api/log_id.ts +1 -1
  223. package/src/api/tx_hash.ts +1 -1
  224. package/src/api/wallet.ts +1 -1
  225. package/src/contract/base_contract_interaction.ts +35 -9
  226. package/src/contract/batch_call.ts +9 -7
  227. package/src/contract/checker.ts +1 -1
  228. package/src/contract/contract.ts +11 -4
  229. package/src/contract/contract_base.ts +3 -3
  230. package/src/contract/contract_function_interaction.ts +24 -13
  231. package/src/contract/deploy_method.ts +27 -18
  232. package/src/contract/deploy_proven_tx.ts +6 -4
  233. package/src/contract/deploy_sent_tx.ts +8 -6
  234. package/src/contract/get_gas_limits.ts +2 -2
  235. package/src/contract/protocol_contracts.ts +35 -0
  236. package/src/contract/proven_tx.ts +3 -2
  237. package/src/contract/sent_tx.ts +3 -2
  238. package/src/contract/unsafe_contract.ts +3 -3
  239. package/src/deployment/broadcast_function.ts +47 -40
  240. package/src/deployment/contract_deployer.ts +4 -3
  241. package/src/deployment/deploy_instance.ts +5 -5
  242. package/src/deployment/register_class.ts +25 -18
  243. package/src/entrypoint/default_entrypoint.ts +5 -5
  244. package/src/entrypoint/default_multi_call_entrypoint.ts +5 -4
  245. package/src/entrypoint/entrypoint.ts +7 -3
  246. package/src/entrypoint/payload.ts +11 -6
  247. package/src/fee/fee_juice_payment_method.ts +5 -3
  248. package/src/fee/fee_juice_payment_method_with_claim.ts +11 -10
  249. package/src/fee/fee_payment_method.ts +3 -3
  250. package/src/fee/private_fee_payment_method.ts +10 -11
  251. package/src/fee/public_fee_payment_method.ts +11 -11
  252. package/src/index.ts +35 -58
  253. package/src/rpc_clients/node/index.ts +2 -1
  254. package/src/rpc_clients/pxe_client.ts +2 -2
  255. package/src/utils/abi_types.ts +4 -7
  256. package/src/utils/authwit.ts +5 -2
  257. package/src/utils/aztec_cheatcodes.ts +5 -3
  258. package/src/utils/field_compressed_string.ts +1 -1
  259. package/src/utils/index.ts +1 -1
  260. package/src/utils/node.ts +3 -3
  261. package/src/utils/pub_key.ts +3 -2
  262. package/src/utils/pxe.ts +2 -2
  263. package/src/wallet/account_wallet.ts +8 -5
  264. package/src/wallet/account_wallet_with_private_key.ts +5 -4
  265. package/src/wallet/base_wallet.ts +37 -46
  266. package/src/wallet/index.ts +3 -3
  267. package/src/wallet/signerless_wallet.ts +7 -4
  268. package/dest/deployment/protocol_contracts.d.ts.map +0 -1
  269. package/dest/deployment/protocol_contracts.js +0 -14
  270. package/dest/fee/no_fee_payment_method.d.ts +0 -13
  271. package/dest/fee/no_fee_payment_method.d.ts.map +0 -1
  272. package/dest/fee/no_fee_payment_method.js +0 -17
  273. package/src/deployment/protocol_contracts.ts +0 -17
  274. package/src/fee/no_fee_payment_method.ts +0 -23
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aztec/aztec.js",
3
3
  "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
4
- "version": "0.76.4",
4
+ "version": "0.77.0-testnet-ignition.21",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./dest/index.js",
@@ -38,7 +38,7 @@
38
38
  "clean": "rm -rf ./dest .tsbuildinfo ./src/account_contract/artifacts",
39
39
  "formatting": "run -T prettier --check ./src && run -T eslint ./src",
40
40
  "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
41
- "test": "HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-16} RAYON_NUM_THREADS=${RAYON_NUM_THREADS:-4} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
41
+ "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
42
42
  },
43
43
  "inherits": [
44
44
  "../package.common.json",
@@ -72,19 +72,18 @@
72
72
  "reporters": [
73
73
  "default"
74
74
  ],
75
- "testTimeout": 30000,
75
+ "testTimeout": 120000,
76
76
  "setupFiles": [
77
77
  "../../foundation/src/jest/setup.mjs"
78
78
  ]
79
79
  },
80
80
  "dependencies": {
81
- "@aztec/circuit-types": "0.76.4",
82
- "@aztec/circuits.js": "0.76.4",
83
- "@aztec/ethereum": "0.76.4",
84
- "@aztec/foundation": "0.76.4",
85
- "@aztec/l1-artifacts": "0.76.4",
86
- "@aztec/protocol-contracts": "0.76.4",
87
- "@aztec/types": "0.76.4",
81
+ "@aztec/constants": "0.77.0-testnet-ignition.21",
82
+ "@aztec/ethereum": "0.77.0-testnet-ignition.21",
83
+ "@aztec/foundation": "0.77.0-testnet-ignition.21",
84
+ "@aztec/l1-artifacts": "0.77.0-testnet-ignition.21",
85
+ "@aztec/protocol-contracts": "0.77.0-testnet-ignition.21",
86
+ "@aztec/stdlib": "0.77.0-testnet-ignition.21",
88
87
  "axios": "^1.7.2",
89
88
  "tslib": "^2.4.0",
90
89
  "viem": "2.22.8"
@@ -94,7 +93,6 @@
94
93
  "@types/jest": "^29.5.0",
95
94
  "@types/node": "^18.7.23",
96
95
  "buffer": "^6.0.3",
97
- "copy-webpack-plugin": "^12.0.2",
98
96
  "crypto-browserify": "^3.12.0",
99
97
  "jest": "^29.5.0",
100
98
  "jest-mock-extended": "^3.0.3",
@@ -104,9 +102,7 @@
104
102
  "ts-loader": "^9.4.4",
105
103
  "ts-node": "^10.9.1",
106
104
  "typescript": "^5.0.4",
107
- "util": "^0.12.5",
108
- "webpack": "^5.88.2",
109
- "webpack-cli": "^5.1.4"
105
+ "util": "^0.12.5"
110
106
  },
111
107
  "files": [
112
108
  "dest",
@@ -1,8 +1,10 @@
1
- import { type CompleteAddress } from '@aztec/circuit-types';
2
- import { type NodeInfo } from '@aztec/circuits.js';
3
- import { type ContractArtifact } from '@aztec/foundation/abi';
1
+ import { Fr } from '@aztec/foundation/fields';
2
+ import type { ContractArtifact } from '@aztec/stdlib/abi';
3
+ import type { CompleteAddress, NodeInfo } from '@aztec/stdlib/contract';
4
+ import { getContractInstanceFromDeployParams } from '@aztec/stdlib/contract';
5
+ import { deriveKeys } from '@aztec/stdlib/keys';
4
6
 
5
- import { type AccountInterface, type AuthWitnessProvider } from './interface.js';
7
+ import type { AccountInterface, AuthWitnessProvider } from './interface.js';
6
8
 
7
9
  // docs:start:account-contract-interface
8
10
  /**
@@ -13,7 +15,7 @@ export interface AccountContract {
13
15
  /**
14
16
  * Returns the artifact of this account contract.
15
17
  */
16
- getContractArtifact(): ContractArtifact;
18
+ getContractArtifact(): Promise<ContractArtifact>;
17
19
 
18
20
  /**
19
21
  * Returns the deployment arguments for this instance, or undefined if this contract does not require deployment.
@@ -37,3 +39,18 @@ export interface AccountContract {
37
39
  getAuthWitnessProvider(address: CompleteAddress): AuthWitnessProvider;
38
40
  }
39
41
  // docs:end:account-contract-interface
42
+
43
+ /**
44
+ * Compute the address of an account contract from secret and salt.
45
+ */
46
+ export async function getAccountContractAddress(accountContract: AccountContract, secret: Fr, salt: Fr) {
47
+ const { publicKeys } = await deriveKeys(secret);
48
+ const constructorArgs = await accountContract.getDeploymentArgs();
49
+ const artifact = await accountContract.getContractArtifact();
50
+ const instance = await getContractInstanceFromDeployParams(artifact, {
51
+ constructorArgs,
52
+ salt,
53
+ publicKeys,
54
+ });
55
+ return instance.address;
56
+ }
@@ -6,9 +6,9 @@
6
6
  *
7
7
  * @packageDocumentation
8
8
  */
9
- import { type Fr } from '@aztec/circuits.js';
9
+ import type { Fr } from '@aztec/foundation/fields';
10
10
 
11
- export { type AccountContract } from './contract.js';
11
+ export { type AccountContract, getAccountContractAddress } from './contract.js';
12
12
  export { type AccountInterface, type AuthWitnessProvider } from './interface.js';
13
13
  export * from './wallet.js';
14
14
 
@@ -1,8 +1,9 @@
1
- import { type AuthWitness, type CompleteAddress } from '@aztec/circuit-types';
2
- import { type AztecAddress } from '@aztec/circuits.js';
3
- import { type Fr } from '@aztec/foundation/fields';
1
+ import type { Fr } from '@aztec/foundation/fields';
2
+ import type { AuthWitness } from '@aztec/stdlib/auth-witness';
3
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
+ import type { CompleteAddress } from '@aztec/stdlib/contract';
4
5
 
5
- import { type EntrypointInterface } from '../entrypoint/entrypoint.js';
6
+ import type { EntrypointInterface } from '../entrypoint/entrypoint.js';
6
7
 
7
8
  // docs:start:account-interface
8
9
  /** Creates authorization witnesses. */
@@ -1,7 +1,8 @@
1
- import { type AuthWitness, type PXE } from '@aztec/circuit-types';
1
+ import type { AuthWitness } from '@aztec/stdlib/auth-witness';
2
+ import type { PXE } from '@aztec/stdlib/interfaces/client';
2
3
 
3
- import { type IntentAction, type IntentInnerHash } from '../utils/authwit.js';
4
- import { type AccountInterface } from './interface.js';
4
+ import type { IntentAction, IntentInnerHash } from '../utils/authwit.js';
5
+ import type { AccountInterface } from './interface.js';
5
6
 
6
7
  /**
7
8
  * The wallet interface.
@@ -1,15 +1,15 @@
1
- import { type PublicKeys } from '@aztec/circuits.js';
2
1
  import {
3
2
  type ContractArtifact,
4
3
  type FunctionArtifact,
5
4
  FunctionSelector,
6
5
  encodeArguments,
7
6
  getFunctionArtifactByName,
8
- } from '@aztec/foundation/abi';
7
+ } from '@aztec/stdlib/abi';
8
+ import type { PublicKeys } from '@aztec/stdlib/keys';
9
9
 
10
- import { type AuthWitnessProvider } from '../account/interface.js';
11
- import { type Wallet } from '../account/wallet.js';
12
- import { type ExecutionRequestInit } from '../api/entrypoint.js';
10
+ import type { AuthWitnessProvider } from '../account/interface.js';
11
+ import type { Wallet } from '../account/wallet.js';
12
+ import type { ExecutionRequestInit } from '../api/entrypoint.js';
13
13
  import { Contract } from '../contract/contract.js';
14
14
  import { DeployMethod, type DeployOptions } from '../contract/deploy_method.js';
15
15
  import { EntrypointPayload, computeCombinedPayloadHash } from '../entrypoint/payload.js';
@@ -1,7 +1,8 @@
1
- import { type PXE, type TxHash, type TxReceipt } from '@aztec/circuit-types';
2
- import { type FieldsOf } from '@aztec/foundation/types';
1
+ import type { FieldsOf } from '@aztec/foundation/types';
2
+ import type { PXE } from '@aztec/stdlib/interfaces/client';
3
+ import type { TxHash, TxReceipt } from '@aztec/stdlib/tx';
3
4
 
4
- import { type Wallet } from '../account/index.js';
5
+ import type { Wallet } from '../account/index.js';
5
6
  import { DefaultWaitOpts, SentTx, type WaitOpts } from '../contract/sent_tx.js';
6
7
 
7
8
  /** Extends a transaction receipt with a wallet instance for the newly deployed contract. */
@@ -1,11 +1,14 @@
1
- import { CompleteAddress, type PXE } from '@aztec/circuit-types';
2
- import { type ContractInstanceWithAddress, deriveKeys, getContractInstanceFromDeployParams } from '@aztec/circuits.js';
3
1
  import { Fr } from '@aztec/foundation/fields';
4
-
5
- import { type AccountContract } from '../account/contract.js';
6
- import { type Salt } from '../account/index.js';
7
- import { type AccountInterface } from '../account/interface.js';
8
- import { type DeployOptions } from '../contract/deploy_method.js';
2
+ import { CompleteAddress, type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
3
+ import { getContractInstanceFromDeployParams } from '@aztec/stdlib/contract';
4
+ import type { PXE } from '@aztec/stdlib/interfaces/client';
5
+ import { deriveKeys } from '@aztec/stdlib/keys';
6
+
7
+ import type { AccountContract } from '../account/contract.js';
8
+ import type { Salt, Wallet } from '../account/index.js';
9
+ import type { AccountInterface } from '../account/interface.js';
10
+ import { DeployMethod, type DeployOptions } from '../contract/deploy_method.js';
11
+ import { Contract } from '../contract/index.js';
9
12
  import { DefaultWaitOpts, type WaitOpts } from '../contract/sent_tx.js';
10
13
  import { DefaultMultiCallEntrypoint } from '../entrypoint/default_multi_call_entrypoint.js';
11
14
  import { AccountWalletWithSecretKey, SignerlessWallet } from '../wallet/index.js';
@@ -18,7 +21,12 @@ import { DeployAccountSentTx } from './deploy_account_sent_tx.js';
18
21
  export type DeployAccountOptions = Pick<
19
22
  DeployOptions,
20
23
  'fee' | 'skipClassRegistration' | 'skipPublicDeployment' | 'skipInitialization'
21
- >;
24
+ > & {
25
+ /**
26
+ * Wallet used for deploying the account contract. Must be funded in order to pay for the fee.
27
+ */
28
+ deployWallet?: Wallet;
29
+ };
22
30
 
23
31
  /**
24
32
  * Manages a user account. Provides methods for calculating the account's address, deploying the account contract,
@@ -40,7 +48,8 @@ export class AccountManager {
40
48
  const { publicKeys } = await deriveKeys(secretKey);
41
49
  salt = salt !== undefined ? new Fr(salt) : Fr.random();
42
50
 
43
- const instance = await getContractInstanceFromDeployParams(accountContract.getContractArtifact(), {
51
+ const artifact = await accountContract.getContractArtifact();
52
+ const instance = await getContractInstanceFromDeployParams(artifact, {
44
53
  constructorArgs: await accountContract.getDeploymentArgs(),
45
54
  salt: salt,
46
55
  publicKeys,
@@ -113,7 +122,7 @@ export class AccountManager {
113
122
  */
114
123
  public async register(): Promise<AccountWalletWithSecretKey> {
115
124
  await this.pxe.registerContract({
116
- artifact: this.accountContract.getContractArtifact(),
125
+ artifact: await this.accountContract.getContractArtifact(),
117
126
  instance: this.getInstance(),
118
127
  });
119
128
 
@@ -126,31 +135,46 @@ export class AccountManager {
126
135
  * Returns the pre-populated deployment method to deploy the account contract that backs this account.
127
136
  * Typically you will not need this method and can call `deploy` directly. Use this for having finer
128
137
  * grained control on when to create, simulate, and send the deployment tx.
138
+ * @param deployWallet - Wallet used for deploying the account contract.
129
139
  * @returns A DeployMethod instance that deploys this account contract.
130
140
  */
131
- public async getDeployMethod() {
141
+ public async getDeployMethod(deployWallet?: Wallet) {
142
+ const artifact = await this.accountContract.getContractArtifact();
143
+
132
144
  if (!(await this.isDeployable())) {
133
- throw new Error(
134
- `Account contract ${this.accountContract.getContractArtifact().name} does not require deployment.`,
135
- );
145
+ throw new Error(`Account contract ${artifact.name} does not require deployment.`);
136
146
  }
137
147
 
138
148
  const completeAddress = await this.getCompleteAddress();
139
149
 
140
150
  await this.pxe.registerAccount(this.secretKey, completeAddress.partialAddress);
141
151
 
142
- const { l1ChainId: chainId, protocolVersion } = await this.pxe.getNodeInfo();
143
- const deployWallet = new SignerlessWallet(this.pxe, new DefaultMultiCallEntrypoint(chainId, protocolVersion));
152
+ const args = (await this.accountContract.getDeploymentArgs()) ?? [];
144
153
 
145
- // We use a signerless wallet with the multi call entrypoint in order to make multiple calls in one go
154
+ if (deployWallet) {
155
+ // If deploying using an existing wallet/account, treat it like regular contract deployment.
156
+ const thisWallet = await this.getWallet();
157
+ return new DeployMethod(
158
+ this.getPublicKeys(),
159
+ deployWallet,
160
+ artifact,
161
+ address => Contract.at(address, artifact, thisWallet),
162
+ args,
163
+ 'constructor',
164
+ );
165
+ }
166
+
167
+ const { l1ChainId: chainId, protocolVersion } = await this.pxe.getNodeInfo();
168
+ // We use a signerless wallet with the multi call entrypoint in order to make multiple calls in one go.
146
169
  // If we used getWallet, the deployment would get routed via the account contract entrypoint
147
- // and it can't be used unless the contract is initialized
148
- const args = (await this.accountContract.getDeploymentArgs()) ?? [];
170
+ // and it can't be used unless the contract is initialized.
171
+ const wallet = new SignerlessWallet(this.pxe, new DefaultMultiCallEntrypoint(chainId, protocolVersion));
172
+
149
173
  return new DeployAccountMethod(
150
174
  this.accountContract.getAuthWitnessProvider(completeAddress),
151
175
  this.getPublicKeys(),
152
- deployWallet,
153
- this.accountContract.getContractArtifact(),
176
+ wallet,
177
+ artifact,
154
178
  args,
155
179
  'constructor',
156
180
  'entrypoint',
@@ -166,7 +190,7 @@ export class AccountManager {
166
190
  * @returns A SentTx object that can be waited to get the associated Wallet.
167
191
  */
168
192
  public deploy(opts?: DeployAccountOptions): DeployAccountSentTx {
169
- const sentTx = this.getDeployMethod()
193
+ const sentTx = this.getDeployMethod(opts?.deployWallet)
170
194
  .then(deployMethod =>
171
195
  deployMethod.send({
172
196
  contractAddressSalt: new Fr(this.salt),
@@ -188,8 +212,8 @@ export class AccountManager {
188
212
  * @param opts - Options to wait for the tx to be mined.
189
213
  * @returns A Wallet instance.
190
214
  */
191
- public async waitSetup(opts: WaitOpts = DefaultWaitOpts): Promise<AccountWalletWithSecretKey> {
192
- await ((await this.isDeployable()) ? this.deploy().wait(opts) : this.register());
215
+ public async waitSetup(opts: DeployAccountOptions & WaitOpts = DefaultWaitOpts): Promise<AccountWalletWithSecretKey> {
216
+ await ((await this.isDeployable()) ? this.deploy(opts).wait(opts) : this.register());
193
217
  return this.getWallet();
194
218
  }
195
219
 
@@ -200,3 +224,6 @@ export class AccountManager {
200
224
  return (await this.accountContract.getDeploymentArgs()) !== undefined;
201
225
  }
202
226
  }
227
+
228
+ export { DeployAccountMethod } from './deploy_account_method.js';
229
+ export { type DeployAccountTxReceipt, DeployAccountSentTx } from './deploy_account_sent_tx.js';
package/src/api/abi.ts CHANGED
@@ -1,3 +1,10 @@
1
- export { type ContractArtifact, type FunctionArtifact, EventSelector, FunctionSelector } from '@aztec/foundation/abi';
2
- export { loadContractArtifact, contractArtifactToBuffer, contractArtifactFromBuffer } from '@aztec/types/abi';
3
- export { type NoirCompiledContract } from '@aztec/types/noir';
1
+ export {
2
+ type ContractArtifact,
3
+ type FunctionArtifact,
4
+ EventSelector,
5
+ FunctionSelector,
6
+ loadContractArtifact,
7
+ contractArtifactToBuffer,
8
+ contractArtifactFromBuffer,
9
+ } from '@aztec/stdlib/abi';
10
+ export { type NoirCompiledContract } from '@aztec/stdlib/noir';
@@ -1,5 +1,10 @@
1
- export { AccountContract, AccountInterface, AuthWitnessProvider, Salt, Wallet } from '../account/index.js';
1
+ export {
2
+ type AccountContract,
3
+ type AccountInterface,
4
+ type AuthWitnessProvider,
5
+ type Salt,
6
+ type Wallet,
7
+ getAccountContractAddress,
8
+ } from '../account/index.js';
2
9
 
3
10
  export { AccountManager } from '../account_manager/index.js';
4
-
5
- export { CompleteAddress } from '@aztec/circuit-types';
@@ -1,2 +1,2 @@
1
- export { AztecAddress } from '@aztec/foundation/aztec-address';
2
- export { CompleteAddress } from '@aztec/circuits.js';
1
+ export { AztecAddress } from '@aztec/stdlib/aztec-address';
2
+ export { CompleteAddress } from '@aztec/stdlib/contract';
@@ -1,6 +1,6 @@
1
- import { type PXE } from '@aztec/circuit-types';
2
1
  import { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes';
3
- import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
2
+ import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
3
+ import type { PXE } from '@aztec/stdlib/interfaces/client';
4
4
 
5
5
  import { AztecCheatCodes } from '../utils/aztec_cheatcodes.js';
6
6
  import { RollupCheatCodes } from './ethereum/cheat_codes.js';
@@ -18,8 +18,8 @@ export class CheatCodes {
18
18
  public rollup: RollupCheatCodes,
19
19
  ) {}
20
20
 
21
- static async create(rpcUrl: string, pxe: PXE): Promise<CheatCodes> {
22
- const ethCheatCodes = new EthCheatCodes(rpcUrl);
21
+ static async create(rpcUrls: string[], pxe: PXE): Promise<CheatCodes> {
22
+ const ethCheatCodes = new EthCheatCodes(rpcUrls);
23
23
  const aztecCheatCodes = new AztecCheatCodes(pxe);
24
24
  const rollupCheatCodes = new RollupCheatCodes(
25
25
  ethCheatCodes,
@@ -28,8 +28,8 @@ export class CheatCodes {
28
28
  return new CheatCodes(ethCheatCodes, aztecCheatCodes, rollupCheatCodes);
29
29
  }
30
30
 
31
- static createRollup(rpcUrl: string, addresses: Pick<L1ContractAddresses, 'rollupAddress'>): RollupCheatCodes {
32
- const ethCheatCodes = new EthCheatCodes(rpcUrl);
31
+ static createRollup(rpcUrls: string[], addresses: Pick<L1ContractAddresses, 'rollupAddress'>): RollupCheatCodes {
32
+ const ethCheatCodes = new EthCheatCodes(rpcUrls);
33
33
  return new RollupCheatCodes(ethCheatCodes, addresses);
34
34
  }
35
35
  }
@@ -1,12 +1,14 @@
1
- import { type EthAddress } from '@aztec/circuits.js';
2
- import { type EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes';
1
+ import type { ViemPublicClient } from '@aztec/ethereum';
2
+ import type { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes';
3
+ import type { EthAddress } from '@aztec/foundation/eth-address';
3
4
  import { type Logger, createLogger } from '@aztec/foundation/log';
4
5
  import { RunningPromise } from '@aztec/foundation/running-promise';
5
- import { type TestDateProvider } from '@aztec/foundation/timer';
6
+ import type { TestDateProvider } from '@aztec/foundation/timer';
6
7
  import { RollupAbi } from '@aztec/l1-artifacts';
7
8
 
8
- import { type GetContractReturnType, type HttpTransport, type PublicClient, getAddress, getContract } from 'viem';
9
- import type * as chains from 'viem/chains';
9
+ import { type GetContractReturnType, getAddress, getContract } from 'viem';
10
+
11
+ import { RollupCheatCodes } from './cheat_codes.js';
10
12
 
11
13
  /**
12
14
  * Represents a watcher for a rollup contract.
@@ -18,17 +20,21 @@ import type * as chains from 'viem/chains';
18
20
  export class AnvilTestWatcher {
19
21
  private isSandbox: boolean = false;
20
22
 
21
- private rollup: GetContractReturnType<typeof RollupAbi, PublicClient<HttpTransport, chains.Chain>>;
23
+ private rollup: GetContractReturnType<typeof RollupAbi, ViemPublicClient>;
24
+ private rollupCheatCodes: RollupCheatCodes;
22
25
 
23
26
  private filledRunningPromise?: RunningPromise;
24
27
  private mineIfOutdatedPromise?: RunningPromise;
28
+ private markingAsProvenRunningPromise?: RunningPromise;
25
29
 
26
30
  private logger: Logger = createLogger(`aztecjs:utils:watcher`);
27
31
 
32
+ private isMarkingAsProven = true;
33
+
28
34
  constructor(
29
35
  private cheatcodes: EthCheatCodes,
30
36
  rollupAddress: EthAddress,
31
- publicClient: PublicClient<HttpTransport, chains.Chain>,
37
+ publicClient: ViemPublicClient,
32
38
  private dateProvider?: TestDateProvider,
33
39
  ) {
34
40
  this.rollup = getContract({
@@ -37,9 +43,17 @@ export class AnvilTestWatcher {
37
43
  client: publicClient,
38
44
  });
39
45
 
46
+ this.rollupCheatCodes = new RollupCheatCodes(this.cheatcodes, {
47
+ rollupAddress,
48
+ });
49
+
40
50
  this.logger.debug(`Watcher created for rollup at ${rollupAddress}`);
41
51
  }
42
52
 
53
+ setIsMarkingAsProven(isMarkingAsProven: boolean) {
54
+ this.isMarkingAsProven = isMarkingAsProven;
55
+ }
56
+
43
57
  setIsSandbox(isSandbox: boolean) {
44
58
  this.isSandbox = isSandbox;
45
59
  }
@@ -60,6 +74,8 @@ export class AnvilTestWatcher {
60
74
  this.filledRunningPromise.start();
61
75
  this.mineIfOutdatedPromise = new RunningPromise(() => this.mineIfOutdated(), this.logger, 1000);
62
76
  this.mineIfOutdatedPromise.start();
77
+ this.markingAsProvenRunningPromise = new RunningPromise(() => this.markAsProven(), this.logger, 1000);
78
+ this.markingAsProvenRunningPromise.start();
63
79
  this.logger.info(`Watcher started for rollup at ${this.rollup.address}`);
64
80
  } else {
65
81
  this.logger.info(`Watcher not started because not auto mining`);
@@ -69,6 +85,14 @@ export class AnvilTestWatcher {
69
85
  async stop() {
70
86
  await this.filledRunningPromise?.stop();
71
87
  await this.mineIfOutdatedPromise?.stop();
88
+ await this.markingAsProvenRunningPromise?.stop();
89
+ }
90
+
91
+ async markAsProven() {
92
+ if (!this.isMarkingAsProven) {
93
+ return;
94
+ }
95
+ await this.rollupCheatCodes.markAsProven();
72
96
  }
73
97
 
74
98
  async mineIfOutdated() {
@@ -1,7 +1,7 @@
1
- import { type RollupContract } from '@aztec/ethereum/contracts';
1
+ import type { RollupContract } from '@aztec/ethereum/contracts';
2
2
  import { createLogger } from '@aztec/foundation/log';
3
3
 
4
- import { type PublicClient } from 'viem';
4
+ import type { PublicClient } from 'viem';
5
5
 
6
6
  /** Utility class that polls the chain on quick intervals and logs new L1 blocks, L2 blocks, and L2 proofs. */
7
7
  export class ChainMonitor {
@@ -14,6 +14,10 @@ export class ChainMonitor {
14
14
  public l2BlockNumber!: number;
15
15
  /** Current L2 proven block number */
16
16
  public l2ProvenBlockNumber!: number;
17
+ /** L1 timestamp for the current L2 block */
18
+ public l2BlockTimestamp!: bigint;
19
+ /** L1 timestamp for the proven L2 block */
20
+ public l2ProvenBlockTimestamp!: bigint;
17
21
 
18
22
  constructor(
19
23
  private readonly rollup: RollupContract,
@@ -28,6 +32,7 @@ export class ChainMonitor {
28
32
  throw new Error('Chain monitor already started');
29
33
  }
30
34
  this.handle = setInterval(this.safeRun.bind(this), this.intervalMs);
35
+ return this;
31
36
  }
32
37
 
33
38
  stop() {
@@ -61,6 +66,7 @@ export class ChainMonitor {
61
66
  const epochNumber = await this.rollup.getEpochNumber(BigInt(newL2BlockNumber));
62
67
  msg += ` with new L2 block ${newL2BlockNumber} for epoch ${epochNumber}`;
63
68
  this.l2BlockNumber = newL2BlockNumber;
69
+ this.l2BlockTimestamp = timestamp;
64
70
  }
65
71
 
66
72
  const newL2ProvenBlockNumber = Number(await this.rollup.getProvenBlockNumber());
@@ -68,6 +74,7 @@ export class ChainMonitor {
68
74
  const epochNumber = await this.rollup.getEpochNumber(BigInt(newL2ProvenBlockNumber));
69
75
  msg += ` with proof up to L2 block ${newL2ProvenBlockNumber} for epoch ${epochNumber}`;
70
76
  this.l2ProvenBlockNumber = newL2ProvenBlockNumber;
77
+ this.l2ProvenBlockTimestamp = timestamp;
71
78
  }
72
79
 
73
80
  this.logger.info(msg, {
@@ -1,31 +1,27 @@
1
+ import type { ViemPublicClient } from '@aztec/ethereum';
1
2
  import { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes';
2
- import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
3
+ import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
4
+ import { EthAddress } from '@aztec/foundation/eth-address';
3
5
  import { createLogger } from '@aztec/foundation/log';
4
6
  import { RollupAbi } from '@aztec/l1-artifacts';
5
7
 
6
- import {
7
- type GetContractReturnType,
8
- type Hex,
9
- type PublicClient,
10
- type WalletClient,
11
- createWalletClient,
12
- getContract,
13
- http,
14
- publicActions,
15
- } from 'viem';
8
+ import { type GetContractReturnType, type Hex, createPublicClient, fallback, getContract, http, keccak256 } from 'viem';
16
9
  import { foundry } from 'viem/chains';
17
10
 
18
11
  export { EthCheatCodes };
19
12
 
20
13
  /** Cheat codes for the L1 rollup contract. */
21
14
  export class RollupCheatCodes {
22
- private client: WalletClient & PublicClient;
23
- private rollup: GetContractReturnType<typeof RollupAbi, WalletClient>;
15
+ private client: ViemPublicClient;
16
+ private rollup: GetContractReturnType<typeof RollupAbi, ViemPublicClient>;
24
17
 
25
18
  private logger = createLogger('aztecjs:cheat_codes');
26
19
 
27
20
  constructor(private ethCheatCodes: EthCheatCodes, addresses: Pick<L1ContractAddresses, 'rollupAddress'>) {
28
- this.client = createWalletClient({ chain: foundry, transport: http(ethCheatCodes.rpcUrl) }).extend(publicActions);
21
+ this.client = createPublicClient({
22
+ chain: foundry,
23
+ transport: fallback(ethCheatCodes.rpcUrls.map(url => http(url))),
24
+ });
29
25
  this.rollup = getContract({
30
26
  abi: RollupAbi,
31
27
  address: addresses.rollupAddress.toString(),
@@ -110,14 +106,36 @@ export class RollupCheatCodes {
110
106
  * @param maybeBlockNumber - The block number to mark as proven (defaults to latest pending)
111
107
  */
112
108
  public async markAsProven(maybeBlockNumber?: number | bigint) {
113
- const blockNumber = maybeBlockNumber
114
- ? BigInt(maybeBlockNumber)
115
- : await this.rollup.read.getTips().then(({ pendingBlockNumber }) => pendingBlockNumber);
116
-
117
- await this.asOwner(async account => {
118
- await this.rollup.write.setAssumeProvenThroughBlockNumber([blockNumber], { account, chain: this.client.chain });
119
- this.logger.warn(`Marked ${blockNumber} as proven`);
120
- });
109
+ const { pending, proven } = await this.getTips();
110
+
111
+ let blockNumber = maybeBlockNumber;
112
+ if (blockNumber === undefined || blockNumber > pending) {
113
+ blockNumber = pending;
114
+ }
115
+ if (blockNumber <= proven) {
116
+ this.logger.warn(`Block ${blockNumber} is already proven`);
117
+ return;
118
+ }
119
+
120
+ // @note @LHerskind this is heavily dependent on the storage layout and size of values
121
+ // The rollupStore is a struct and if the size of elements or the struct changes, this can break
122
+
123
+ // Convert string to bytes and then compute keccak256
124
+ const storageSlot = keccak256(Buffer.from('aztec.stf.storage', 'utf-8'));
125
+ const provenBlockNumberSlot = BigInt(storageSlot) + 1n;
126
+
127
+ const tipsBefore = await this.getTips();
128
+
129
+ await this.ethCheatCodes.store(
130
+ EthAddress.fromString(this.rollup.address),
131
+ provenBlockNumberSlot,
132
+ BigInt(blockNumber),
133
+ );
134
+
135
+ const tipsAfter = await this.getTips();
136
+ this.logger.info(
137
+ `Proven tip moved: ${tipsBefore.proven} -> ${tipsAfter.proven}. Pending tip: ${tipsAfter.pending}.`,
138
+ );
121
139
  }
122
140
 
123
141
  /**
@@ -125,7 +143,7 @@ export class RollupCheatCodes {
125
143
  * @param action - The action to execute
126
144
  */
127
145
  public async asOwner(
128
- action: (owner: Hex, rollup: GetContractReturnType<typeof RollupAbi, WalletClient>) => Promise<void>,
146
+ action: (owner: Hex, rollup: GetContractReturnType<typeof RollupAbi, ViemPublicClient>) => Promise<void>,
129
147
  ) {
130
148
  const owner = await this.rollup.read.owner();
131
149
  await this.ethCheatCodes.startImpersonating(owner);
@@ -136,8 +154,31 @@ export class RollupCheatCodes {
136
154
  /** Directly calls the L1 gas fee oracle. */
137
155
  public async updateL1GasFeeOracle() {
138
156
  await this.asOwner(async (account, rollup) => {
139
- await rollup.write.updateL1GasFeeOracle({ account, chain: this.client.chain });
157
+ const hash = await rollup.write.updateL1GasFeeOracle({ account, chain: this.client.chain });
158
+ await this.client.waitForTransactionReceipt({ hash });
140
159
  this.logger.warn(`Updated L1 gas fee oracle`);
141
160
  });
142
161
  }
162
+
163
+ /**
164
+ * Bumps proving cost per mana.
165
+ * @param bumper - Callback to calculate the new proving cost per mana based on current value.
166
+ */
167
+ public async bumpProvingCostPerMana(bumper: (before: bigint) => bigint) {
168
+ const currentCost = await this.rollup.read.getProvingCostPerManaInEth();
169
+ const newCost = bumper(currentCost);
170
+ await this.setProvingCostPerMana(newCost);
171
+ }
172
+
173
+ /**
174
+ * Directly updates proving cost per mana.
175
+ * @param ethValue - The new proving cost per mana in ETH
176
+ */
177
+ public async setProvingCostPerMana(ethValue: bigint) {
178
+ await this.asOwner(async (account, rollup) => {
179
+ const hash = await rollup.write.setProvingCostPerMana([ethValue], { account, chain: this.client.chain });
180
+ await this.client.waitForTransactionReceipt({ hash });
181
+ this.logger.warn(`Updated proving cost per mana to ${ethValue}`);
182
+ });
183
+ }
143
184
  }
@@ -12,4 +12,8 @@ export { getL1ContractAddresses } from './l1_contracts.js';
12
12
  export { RollupCheatCodes, EthCheatCodes } from './cheat_codes.js';
13
13
  export { ChainMonitor } from './chain_monitor.js';
14
14
  export { AnvilTestWatcher } from './anvil_test_watcher.js';
15
- export { deployL1Contract, deployL1Contracts, DeployL1Contracts } from '@aztec/ethereum/deploy-l1-contracts';
15
+ export {
16
+ deployL1Contract,
17
+ deployL1Contracts,
18
+ type DeployL1ContractsReturnType,
19
+ } from '@aztec/ethereum/deploy-l1-contracts';