@aztec/protocol-contracts 0.76.4-devnet-test-rc3 → 0.77.0-testnet-ignition.17

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 (121) hide show
  1. package/artifacts/AuthRegistry.d.json.ts +1 -1
  2. package/artifacts/AuthRegistry.json +354 -422
  3. package/artifacts/ContractClassRegisterer.d.json.ts +1 -1
  4. package/artifacts/ContractClassRegisterer.json +395 -422
  5. package/artifacts/ContractInstanceDeployer.d.json.ts +1 -1
  6. package/artifacts/ContractInstanceDeployer.json +545 -138
  7. package/artifacts/FeeJuice.d.json.ts +1 -1
  8. package/artifacts/FeeJuice.json +360 -540
  9. package/artifacts/MultiCallEntrypoint.d.json.ts +1 -1
  10. package/artifacts/MultiCallEntrypoint.json +110 -190
  11. package/artifacts/Router.d.json.ts +1 -1
  12. package/artifacts/Router.json +217 -291
  13. package/dest/auth-registry/index.d.ts +2 -2
  14. package/dest/auth-registry/index.d.ts.map +1 -1
  15. package/dest/auth-registry/index.js +5 -5
  16. package/dest/auth-registry/lazy.d.ts +6 -0
  17. package/dest/auth-registry/lazy.d.ts.map +1 -0
  18. package/dest/auth-registry/lazy.js +23 -0
  19. package/dest/build_protocol_contract_tree.d.ts +5 -1
  20. package/dest/build_protocol_contract_tree.d.ts.map +1 -1
  21. package/dest/build_protocol_contract_tree.js +9 -5
  22. package/dest/class-registerer/contract_class_registered_event.d.ts +4 -3
  23. package/dest/class-registerer/contract_class_registered_event.d.ts.map +1 -1
  24. package/dest/class-registerer/contract_class_registered_event.js +21 -18
  25. package/dest/class-registerer/index.d.ts +2 -2
  26. package/dest/class-registerer/index.d.ts.map +1 -1
  27. package/dest/class-registerer/index.js +5 -5
  28. package/dest/class-registerer/lazy.d.ts +9 -0
  29. package/dest/class-registerer/lazy.d.ts.map +1 -0
  30. package/dest/class-registerer/lazy.js +26 -0
  31. package/dest/class-registerer/private_function_broadcasted_event.d.ts +10 -7
  32. package/dest/class-registerer/private_function_broadcasted_event.d.ts.map +1 -1
  33. package/dest/class-registerer/private_function_broadcasted_event.js +46 -48
  34. package/dest/class-registerer/unconstrained_function_broadcasted_event.d.ts +10 -7
  35. package/dest/class-registerer/unconstrained_function_broadcasted_event.d.ts.map +1 -1
  36. package/dest/class-registerer/unconstrained_function_broadcasted_event.js +39 -41
  37. package/dest/fee-juice/index.d.ts +12 -2
  38. package/dest/fee-juice/index.d.ts.map +1 -1
  39. package/dest/fee-juice/index.js +18 -5
  40. package/dest/fee-juice/lazy.d.ts +6 -0
  41. package/dest/fee-juice/lazy.d.ts.map +1 -0
  42. package/dest/fee-juice/lazy.js +23 -0
  43. package/dest/index.js +0 -1
  44. package/dest/instance-deployer/contract_instance_deployed_event.d.ts +4 -2
  45. package/dest/instance-deployer/contract_instance_deployed_event.d.ts.map +1 -1
  46. package/dest/instance-deployer/contract_instance_deployed_event.js +14 -8
  47. package/dest/instance-deployer/contract_instance_updated_event.d.ts +16 -0
  48. package/dest/instance-deployer/contract_instance_updated_event.d.ts.map +1 -0
  49. package/dest/instance-deployer/contract_instance_updated_event.js +36 -0
  50. package/dest/instance-deployer/index.d.ts +3 -2
  51. package/dest/instance-deployer/index.d.ts.map +1 -1
  52. package/dest/instance-deployer/index.js +6 -5
  53. package/dest/instance-deployer/lazy.d.ts +8 -0
  54. package/dest/instance-deployer/lazy.d.ts.map +1 -0
  55. package/dest/instance-deployer/lazy.js +25 -0
  56. package/dest/make_protocol_contract.d.ts +2 -2
  57. package/dest/make_protocol_contract.d.ts.map +1 -1
  58. package/dest/make_protocol_contract.js +10 -7
  59. package/dest/multi-call-entrypoint/index.d.ts +2 -2
  60. package/dest/multi-call-entrypoint/index.d.ts.map +1 -1
  61. package/dest/multi-call-entrypoint/index.js +5 -5
  62. package/dest/multi-call-entrypoint/lazy.d.ts +6 -0
  63. package/dest/multi-call-entrypoint/lazy.d.ts.map +1 -0
  64. package/dest/multi-call-entrypoint/lazy.js +23 -0
  65. package/dest/protocol_contract.d.ts +4 -2
  66. package/dest/protocol_contract.d.ts.map +1 -1
  67. package/dest/protocol_contract.js +1 -2
  68. package/dest/protocol_contract_data.d.ts +4 -2
  69. package/dest/protocol_contract_data.d.ts.map +1 -1
  70. package/dest/protocol_contract_data.js +16 -15
  71. package/dest/protocol_contract_tree.d.ts +4 -3
  72. package/dest/protocol_contract_tree.d.ts.map +1 -1
  73. package/dest/protocol_contract_tree.js +14 -12
  74. package/dest/provider/bundle.d.ts +9 -0
  75. package/dest/provider/bundle.d.ts.map +1 -0
  76. package/dest/provider/bundle.js +20 -0
  77. package/dest/provider/lazy.d.ts +7 -0
  78. package/dest/provider/lazy.d.ts.map +1 -0
  79. package/dest/provider/lazy.js +26 -0
  80. package/dest/provider/protocol_contracts_provider.d.ts +7 -0
  81. package/dest/provider/protocol_contracts_provider.d.ts.map +1 -0
  82. package/dest/provider/protocol_contracts_provider.js +1 -0
  83. package/dest/router/index.d.ts +2 -2
  84. package/dest/router/index.d.ts.map +1 -1
  85. package/dest/router/index.js +5 -5
  86. package/dest/router/lazy.d.ts +6 -0
  87. package/dest/router/lazy.d.ts.map +1 -0
  88. package/dest/router/lazy.js +23 -0
  89. package/dest/scripts/cleanup_artifacts.js +16 -0
  90. package/dest/scripts/generate_data.js +173 -0
  91. package/dest/tests/fixtures.js +0 -1
  92. package/package.json +12 -10
  93. package/src/auth-registry/index.ts +3 -3
  94. package/src/auth-registry/lazy.ts +29 -0
  95. package/src/build_protocol_contract_tree.ts +5 -9
  96. package/src/class-registerer/contract_class_registered_event.ts +15 -18
  97. package/src/class-registerer/index.ts +3 -3
  98. package/src/class-registerer/lazy.ts +33 -0
  99. package/src/class-registerer/private_function_broadcasted_event.ts +34 -44
  100. package/src/class-registerer/unconstrained_function_broadcasted_event.ts +31 -41
  101. package/src/fee-juice/index.ts +22 -3
  102. package/src/fee-juice/lazy.ts +29 -0
  103. package/src/instance-deployer/contract_instance_deployed_event.ts +6 -3
  104. package/src/instance-deployer/contract_instance_updated_event.ts +44 -0
  105. package/src/instance-deployer/index.ts +4 -3
  106. package/src/instance-deployer/lazy.ts +32 -0
  107. package/src/make_protocol_contract.ts +3 -3
  108. package/src/multi-call-entrypoint/index.ts +3 -3
  109. package/src/multi-call-entrypoint/lazy.ts +29 -0
  110. package/src/protocol_contract.ts +5 -7
  111. package/src/protocol_contract_data.ts +63 -57
  112. package/src/protocol_contract_tree.ts +12 -10
  113. package/src/provider/bundle.ts +27 -0
  114. package/src/provider/lazy.ts +30 -0
  115. package/src/provider/protocol_contracts_provider.ts +7 -0
  116. package/src/router/index.ts +3 -3
  117. package/src/router/lazy.ts +29 -0
  118. package/dest/bundle/index.d.ts +0 -7
  119. package/dest/bundle/index.d.ts.map +0 -1
  120. package/dest/bundle/index.js +0 -32
  121. package/src/bundle/index.ts +0 -36
@@ -1,57 +1,63 @@
1
- // GENERATED FILE - DO NOT EDIT. RUN `yarn generate` or `yarn generate:data`
2
- import { AztecAddress, Fr } from '@aztec/circuits.js';
3
-
4
- export const protocolContractNames = [
5
- 'AuthRegistry',
6
- 'ContractInstanceDeployer',
7
- 'ContractClassRegisterer',
8
- 'MultiCallEntrypoint',
9
- 'FeeJuice',
10
- 'Router',
11
- ] as const;
12
-
13
- export type ProtocolContractName = (typeof protocolContractNames)[number];
14
-
15
- export const ProtocolContractSalt: Record<ProtocolContractName, Fr> = {
16
- AuthRegistry: new Fr(1),
17
- ContractInstanceDeployer: new Fr(1),
18
- ContractClassRegisterer: new Fr(1),
19
- MultiCallEntrypoint: new Fr(1),
20
- FeeJuice: new Fr(1),
21
- Router: new Fr(1),
22
- };
23
-
24
- export const ProtocolContractAddress: Record<ProtocolContractName, AztecAddress> = {
25
- AuthRegistry: AztecAddress.fromBigInt(1n),
26
- ContractInstanceDeployer: AztecAddress.fromBigInt(2n),
27
- ContractClassRegisterer: AztecAddress.fromBigInt(3n),
28
- MultiCallEntrypoint: AztecAddress.fromBigInt(4n),
29
- FeeJuice: AztecAddress.fromBigInt(5n),
30
- Router: AztecAddress.fromBigInt(6n),
31
- };
32
-
33
- export const ProtocolContractLeaves = {
34
- AuthRegistry: Fr.fromHexString('0x2e9b53693d0b765a2b3ba243a294d01280ad7cd80014562779c0e3fa7769c6c0'),
35
- ContractInstanceDeployer: Fr.fromHexString('0x1665c5fbc1e58ba19c82f64c0402d29e8bbf94b1fde1a056280d081c15b0dac1'),
36
- ContractClassRegisterer: Fr.fromHexString('0x1a11045c0895e4ba1d6bd55c52e7b493c301c079234354dd85f113903f0a8270'),
37
- MultiCallEntrypoint: Fr.fromHexString('0x237a0bac451ebac796b96dbe27ccfda5230e8c962b391b84b0304c3775e9e0c0'),
38
- FeeJuice: Fr.fromHexString('0x0bd5f44eb8429a4ea8ca193232e5ee576b300995ce5f88935aa03b0869fe13d5'),
39
- Router: Fr.fromHexString('0x1281e0c1842212e79fa2249877524dda4f07f3d42cb502097302737bd3177550'),
40
- };
41
-
42
- export const protocolContractTreeRoot = Fr.fromHexString(
43
- '0x26d63d5bcf09b75cc6e123b591dd3e327347d30fe236061f7613ba8d7c5fdac6',
44
- );
45
-
46
- export const REGISTERER_CONTRACT_CLASS_REGISTERED_TAG = new Fr(
47
- 11121068431693264234253912047066709627593769337094408533543930778360n,
48
- );
49
- export const REGISTERER_PRIVATE_FUNCTION_BROADCASTED_TAG = new Fr(
50
- 2889881020989534926461066592611988634597302675057895885580456197069n,
51
- );
52
- export const REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_TAG = new Fr(
53
- 24399338136397901754495080759185489776044879232766421623673792970137n,
54
- );
55
- export const DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_TAG = Fr.fromHexString(
56
- '0x2ec28b91a5f838506d6042915005ff55cf7a0a5f889a83b11faed33a31b486f2',
57
- );
1
+
2
+ // GENERATED FILE - DO NOT EDIT. RUN `yarn generate` or `yarn generate:data`
3
+ import { Fr } from '@aztec/foundation/fields';
4
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+
6
+
7
+ export const protocolContractNames = [
8
+ 'AuthRegistry',
9
+ 'ContractInstanceDeployer',
10
+ 'ContractClassRegisterer',
11
+ 'MultiCallEntrypoint',
12
+ 'FeeJuice',
13
+ 'Router'
14
+ ] as const;
15
+
16
+ export type ProtocolContractName = typeof protocolContractNames[number];
17
+
18
+
19
+
20
+ export const ProtocolContractSalt: Record<ProtocolContractName, Fr> = {
21
+ AuthRegistry: new Fr(1),
22
+ ContractInstanceDeployer: new Fr(1),
23
+ ContractClassRegisterer: new Fr(1),
24
+ MultiCallEntrypoint: new Fr(1),
25
+ FeeJuice: new Fr(1),
26
+ Router: new Fr(1)
27
+ };
28
+
29
+
30
+
31
+ export const ProtocolContractAddress: Record<ProtocolContractName, AztecAddress> = {
32
+ AuthRegistry: AztecAddress.fromBigInt(1n),
33
+ ContractInstanceDeployer: AztecAddress.fromBigInt(2n),
34
+ ContractClassRegisterer: AztecAddress.fromBigInt(3n),
35
+ MultiCallEntrypoint: AztecAddress.fromBigInt(4n),
36
+ FeeJuice: AztecAddress.fromBigInt(5n),
37
+ Router: AztecAddress.fromBigInt(6n)
38
+ };
39
+
40
+
41
+
42
+ export const ProtocolContractLeaves = {
43
+ AuthRegistry: Fr.fromHexString('0x2e21b68d7ba0d9a47965a892c304e1906e9ff3309fd1a19f2d6d20764ad0904d'),
44
+ ContractInstanceDeployer: Fr.fromHexString('0x1cd18d02cf497df9523f3c8aed73075e93210f448a3d1a22aaf2787b2fcc3156'),
45
+ ContractClassRegisterer: Fr.fromHexString('0x1e50aba05fd759d9225eb756d17ba4f79a7b607ba8e0bb753e35456983b10d5a'),
46
+ MultiCallEntrypoint: Fr.fromHexString('0x121f834b03a64d38463ae18ddebceeb4dce8192cc289052e175ad754a883a7fe'),
47
+ FeeJuice: Fr.fromHexString('0x26824d7dd736eb4ed60e4f920de3183e071223a769a533a0b422a3da9bbe2e57'),
48
+ Router: Fr.fromHexString('0x26924a7b4fb3f63e61ed0bd53bca870f66660c18e032973ac063ba3f1d4a9b4d')
49
+ };
50
+
51
+
52
+
53
+ export const protocolContractTreeRoot = Fr.fromHexString('0x2c8fc46351bda26dff22c6f7d13f51ef1b7b7245475ed6f0857b8aeac417b36f');
54
+
55
+
56
+
57
+ export const REGISTERER_CONTRACT_CLASS_REGISTERED_TAG = Fr.fromHexString('0x20cd27645f65c15a38720ca984aef936592f3938a705db706d068ad13fc58ae9');
58
+ export const REGISTERER_PRIVATE_FUNCTION_BROADCASTED_TAG = Fr.fromHexString('0x0abf338154e355442d9916d630da0491036d5a7b23c42b477c1395ba3bf9b42d');
59
+ export const REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_TAG = Fr.fromHexString('0x27774539896271d6dbe0c1de45ddc44709d1e8d9a9fb686ca3c105d87c417bb8');
60
+ export const DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_TAG = Fr.fromHexString('0x2ec28b91a5f838506d6042915005ff55cf7a0a5f889a83b11faed33a31b486f2');
61
+ export const DEPLOYER_CONTRACT_INSTANCE_UPDATED_TAG = new Fr(1534834688047131268740281708431107902615560100979874281215533519862n);
62
+
63
+
@@ -1,10 +1,8 @@
1
- import {
2
- type AztecAddress,
3
- type IndexedMerkleTree,
4
- type PROTOCOL_CONTRACT_TREE_HEIGHT,
5
- type ProtocolContractLeafPreimage,
6
- } from '@aztec/circuits.js';
1
+ import type { PROTOCOL_CONTRACT_TREE_HEIGHT } from '@aztec/constants';
7
2
  import { poseidon2Hash } from '@aztec/foundation/crypto';
3
+ import type { IndexedMerkleTree } from '@aztec/foundation/trees';
4
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+ import type { ProtocolContractLeafPreimage } from '@aztec/stdlib/trees';
8
6
 
9
7
  import { buildProtocolContractTree } from './build_protocol_contract_tree.js';
10
8
  import { isProtocolContract } from './protocol_contract.js';
@@ -25,16 +23,20 @@ async function getTree() {
25
23
  return protocolContractTree;
26
24
  }
27
25
 
28
- export async function getProtocolContractLeafAndMembershipWitness(address: AztecAddress) {
26
+ // Computed address can be different from contract address due to upgrades
27
+ export async function getProtocolContractLeafAndMembershipWitness(
28
+ contractAddress: AztecAddress,
29
+ computedAddress: AztecAddress,
30
+ ) {
29
31
  const tree = await getTree();
30
32
  let lowLeaf;
31
33
  let witness;
32
- if (isProtocolContract(address)) {
33
- const index = address.toField().toNumber();
34
+ if (isProtocolContract(contractAddress)) {
35
+ const index = contractAddress.toField().toNumber();
34
36
  lowLeaf = tree.leafPreimages[index];
35
37
  witness = tree.getMembershipWitness(index);
36
38
  } else {
37
- lowLeaf = tree.getLowLeaf(address.toBigInt());
39
+ lowLeaf = tree.getLowLeaf(computedAddress.toBigInt());
38
40
  const hashed = (await poseidon2Hash(lowLeaf.toHashInputs())).toBuffer();
39
41
  witness = tree.getMembershipWitness(hashed);
40
42
  }
@@ -0,0 +1,27 @@
1
+ import type { ContractArtifact } from '@aztec/stdlib/abi';
2
+
3
+ import { AuthRegistryArtifact } from '../auth-registry/index.js';
4
+ import { ContractClassRegistererArtifact } from '../class-registerer/index.js';
5
+ import { FeeJuiceArtifact } from '../fee-juice/index.js';
6
+ import { ContractInstanceDeployerArtifact } from '../instance-deployer/index.js';
7
+ import { makeProtocolContract } from '../make_protocol_contract.js';
8
+ import { MultiCallEntrypointArtifact } from '../multi-call-entrypoint/index.js';
9
+ import type { ProtocolContract } from '../protocol_contract.js';
10
+ import type { ProtocolContractName } from '../protocol_contract_data.js';
11
+ import { RouterArtifact } from '../router/index.js';
12
+ import type { ProtocolContractsProvider } from './protocol_contracts_provider.js';
13
+
14
+ export const ProtocolContractArtifact: Record<ProtocolContractName, ContractArtifact> = {
15
+ AuthRegistry: AuthRegistryArtifact,
16
+ ContractInstanceDeployer: ContractInstanceDeployerArtifact,
17
+ ContractClassRegisterer: ContractClassRegistererArtifact,
18
+ MultiCallEntrypoint: MultiCallEntrypointArtifact,
19
+ FeeJuice: FeeJuiceArtifact,
20
+ Router: RouterArtifact,
21
+ };
22
+
23
+ export class BundledProtocolContractsProvider implements ProtocolContractsProvider {
24
+ getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract> {
25
+ return makeProtocolContract(name, ProtocolContractArtifact[name]);
26
+ }
27
+ }
@@ -0,0 +1,30 @@
1
+ import { getCanonicalAuthRegistry } from '../auth-registry/lazy.js';
2
+ import { getCanonicalClassRegisterer } from '../class-registerer/lazy.js';
3
+ import { getCanonicalFeeJuice } from '../fee-juice/lazy.js';
4
+ import { getCanonicalInstanceDeployer } from '../instance-deployer/lazy.js';
5
+ import { getCanonicalMultiCallEntrypoint } from '../multi-call-entrypoint/lazy.js';
6
+ import type { ProtocolContract } from '../protocol_contract.js';
7
+ import type { ProtocolContractName } from '../protocol_contract_data.js';
8
+ import { getCanonicalRouter } from '../router/lazy.js';
9
+ import type { ProtocolContractsProvider } from './protocol_contracts_provider.js';
10
+
11
+ export class LazyProtocolContractsProvider implements ProtocolContractsProvider {
12
+ getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract> {
13
+ switch (name) {
14
+ case 'AuthRegistry':
15
+ return getCanonicalAuthRegistry();
16
+ case 'ContractInstanceDeployer':
17
+ return getCanonicalInstanceDeployer();
18
+ case 'ContractClassRegisterer':
19
+ return getCanonicalClassRegisterer();
20
+ case 'MultiCallEntrypoint':
21
+ return getCanonicalMultiCallEntrypoint();
22
+ case 'FeeJuice':
23
+ return getCanonicalFeeJuice();
24
+ case 'Router':
25
+ return getCanonicalRouter();
26
+ default:
27
+ throw new Error(`Unknown protocol contract name: ${name}`);
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,7 @@
1
+ import type { ProtocolContract } from '../protocol_contract.js';
2
+ import type { ProtocolContractName } from '../protocol_contract_data.js';
3
+
4
+ /** Returns the canonical deployment of a given artifact. */
5
+ export interface ProtocolContractsProvider {
6
+ getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract>;
7
+ }
@@ -1,9 +1,9 @@
1
- import { loadContractArtifact } from '@aztec/types/abi';
2
- import { type NoirCompiledContract } from '@aztec/types/noir';
1
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
2
+ import type { NoirCompiledContract } from '@aztec/stdlib/noir';
3
3
 
4
4
  import RouterJson from '../../artifacts/Router.json' assert { type: 'json' };
5
5
  import { makeProtocolContract } from '../make_protocol_contract.js';
6
- import { type ProtocolContract } from '../protocol_contract.js';
6
+ import type { ProtocolContract } from '../protocol_contract.js';
7
7
 
8
8
  export const RouterArtifact = loadContractArtifact(RouterJson as NoirCompiledContract);
9
9
 
@@ -0,0 +1,29 @@
1
+ import { type ContractArtifact, loadContractArtifact } from '@aztec/stdlib/abi';
2
+
3
+ import { makeProtocolContract } from '../make_protocol_contract.js';
4
+ import type { ProtocolContract } from '../protocol_contract.js';
5
+
6
+ let protocolContract: ProtocolContract;
7
+ let protocolContractArtifact: ContractArtifact;
8
+
9
+ export async function getRouterArtifact(): Promise<ContractArtifact> {
10
+ if (!protocolContractArtifact) {
11
+ // Cannot assert this import as it's incompatible with browsers
12
+ // https://caniuse.com/mdn-javascript_statements_import_import_assertions_type_json
13
+ // Use the new "with" syntax once supported by firefox
14
+ // https://caniuse.com/mdn-javascript_statements_import_import_attributes_type_json
15
+ // In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
16
+ const { default: routerJson } = await import('../../artifacts/Router.json');
17
+ protocolContractArtifact = loadContractArtifact(routerJson);
18
+ }
19
+ return protocolContractArtifact;
20
+ }
21
+
22
+ /** Returns the canonical deployment of the auth registry. */
23
+ export async function getCanonicalRouter(): Promise<ProtocolContract> {
24
+ if (!protocolContract) {
25
+ const routerArtifact = await getRouterArtifact();
26
+ protocolContract = await makeProtocolContract('Router', routerArtifact);
27
+ }
28
+ return protocolContract;
29
+ }
@@ -1,7 +0,0 @@
1
- import { type ContractArtifact } from '@aztec/foundation/abi';
2
- import { type ProtocolContract } from '../protocol_contract.js';
3
- import { type ProtocolContractName } from '../protocol_contract_data.js';
4
- /** Returns the canonical deployment a given artifact. */
5
- export declare function getCanonicalProtocolContract(name: ProtocolContractName): Promise<ProtocolContract>;
6
- export declare const ProtocolContractArtifact: Record<ProtocolContractName, ContractArtifact>;
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundle/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAO9D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAA2B,KAAK,oBAAoB,EAAwB,MAAM,8BAA8B,CAAC;AAGxH,yDAAyD;AACzD,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAaxG;AAED,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,oBAAoB,EAAE,gBAAgB,CAOnF,CAAC"}
@@ -1,32 +0,0 @@
1
- import { getContractClassFromArtifact, getContractInstanceFromDeployParams } from '@aztec/circuits.js';
2
- import { AuthRegistryArtifact } from '../auth-registry/index.js';
3
- import { ContractClassRegistererArtifact } from '../class-registerer/index.js';
4
- import { FeeJuiceArtifact } from '../fee-juice/index.js';
5
- import { ContractInstanceDeployerArtifact } from '../instance-deployer/index.js';
6
- import { MultiCallEntrypointArtifact } from '../multi-call-entrypoint/index.js';
7
- import { ProtocolContractAddress, ProtocolContractSalt } from '../protocol_contract_data.js';
8
- import { RouterArtifact } from '../router/index.js';
9
- /** Returns the canonical deployment a given artifact. */
10
- export async function getCanonicalProtocolContract(name) {
11
- const artifact = ProtocolContractArtifact[name];
12
- const address = ProtocolContractAddress[name];
13
- const salt = ProtocolContractSalt[name];
14
- // TODO(@spalladino): This computes the contract class from the artifact twice.
15
- const contractClass = await getContractClassFromArtifact(artifact);
16
- const instance = await getContractInstanceFromDeployParams(artifact, { salt });
17
- return {
18
- instance: { ...instance, address },
19
- contractClass,
20
- artifact,
21
- address,
22
- };
23
- }
24
- export const ProtocolContractArtifact = {
25
- AuthRegistry: AuthRegistryArtifact,
26
- ContractInstanceDeployer: ContractInstanceDeployerArtifact,
27
- ContractClassRegisterer: ContractClassRegistererArtifact,
28
- MultiCallEntrypoint: MultiCallEntrypointArtifact,
29
- FeeJuice: FeeJuiceArtifact,
30
- Router: RouterArtifact,
31
- };
32
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYnVuZGxlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSw0QkFBNEIsRUFBRSxtQ0FBbUMsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBR3ZHLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ2pFLE9BQU8sRUFBRSwrQkFBK0IsRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBQy9FLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ3pELE9BQU8sRUFBRSxnQ0FBZ0MsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQ2pGLE9BQU8sRUFBRSwyQkFBMkIsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBRWhGLE9BQU8sRUFBRSx1QkFBdUIsRUFBNkIsb0JBQW9CLEVBQUUsTUFBTSw4QkFBOEIsQ0FBQztBQUN4SCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFFcEQseURBQXlEO0FBQ3pELE1BQU0sQ0FBQyxLQUFLLFVBQVUsNEJBQTRCLENBQUMsSUFBMEI7SUFDM0UsTUFBTSxRQUFRLEdBQUcsd0JBQXdCLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDaEQsTUFBTSxPQUFPLEdBQUcsdUJBQXVCLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDOUMsTUFBTSxJQUFJLEdBQUcsb0JBQW9CLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDeEMsK0VBQStFO0lBQy9FLE1BQU0sYUFBYSxHQUFHLE1BQU0sNEJBQTRCLENBQUMsUUFBUSxDQUFDLENBQUM7SUFDbkUsTUFBTSxRQUFRLEdBQUcsTUFBTSxtQ0FBbUMsQ0FBQyxRQUFRLEVBQUUsRUFBRSxJQUFJLEVBQUUsQ0FBQyxDQUFDO0lBQy9FLE9BQU87UUFDTCxRQUFRLEVBQUUsRUFBRSxHQUFHLFFBQVEsRUFBRSxPQUFPLEVBQUU7UUFDbEMsYUFBYTtRQUNiLFFBQVE7UUFDUixPQUFPO0tBQ1IsQ0FBQztBQUNKLENBQUM7QUFFRCxNQUFNLENBQUMsTUFBTSx3QkFBd0IsR0FBbUQ7SUFDdEYsWUFBWSxFQUFFLG9CQUFvQjtJQUNsQyx3QkFBd0IsRUFBRSxnQ0FBZ0M7SUFDMUQsdUJBQXVCLEVBQUUsK0JBQStCO0lBQ3hELG1CQUFtQixFQUFFLDJCQUEyQjtJQUNoRCxRQUFRLEVBQUUsZ0JBQWdCO0lBQzFCLE1BQU0sRUFBRSxjQUFjO0NBQ3ZCLENBQUMifQ==
@@ -1,36 +0,0 @@
1
- import { getContractClassFromArtifact, getContractInstanceFromDeployParams } from '@aztec/circuits.js';
2
- import { type ContractArtifact } from '@aztec/foundation/abi';
3
-
4
- import { AuthRegistryArtifact } from '../auth-registry/index.js';
5
- import { ContractClassRegistererArtifact } from '../class-registerer/index.js';
6
- import { FeeJuiceArtifact } from '../fee-juice/index.js';
7
- import { ContractInstanceDeployerArtifact } from '../instance-deployer/index.js';
8
- import { MultiCallEntrypointArtifact } from '../multi-call-entrypoint/index.js';
9
- import { type ProtocolContract } from '../protocol_contract.js';
10
- import { ProtocolContractAddress, type ProtocolContractName, ProtocolContractSalt } from '../protocol_contract_data.js';
11
- import { RouterArtifact } from '../router/index.js';
12
-
13
- /** Returns the canonical deployment a given artifact. */
14
- export async function getCanonicalProtocolContract(name: ProtocolContractName): Promise<ProtocolContract> {
15
- const artifact = ProtocolContractArtifact[name];
16
- const address = ProtocolContractAddress[name];
17
- const salt = ProtocolContractSalt[name];
18
- // TODO(@spalladino): This computes the contract class from the artifact twice.
19
- const contractClass = await getContractClassFromArtifact(artifact);
20
- const instance = await getContractInstanceFromDeployParams(artifact, { salt });
21
- return {
22
- instance: { ...instance, address },
23
- contractClass,
24
- artifact,
25
- address,
26
- };
27
- }
28
-
29
- export const ProtocolContractArtifact: Record<ProtocolContractName, ContractArtifact> = {
30
- AuthRegistry: AuthRegistryArtifact,
31
- ContractInstanceDeployer: ContractInstanceDeployerArtifact,
32
- ContractClassRegisterer: ContractClassRegistererArtifact,
33
- MultiCallEntrypoint: MultiCallEntrypointArtifact,
34
- FeeJuice: FeeJuiceArtifact,
35
- Router: RouterArtifact,
36
- };