@aztec/standard-contracts 0.0.1-commit.8655d4a → 0.0.1-commit.a5db02d

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 (45) hide show
  1. package/artifacts/AuthRegistry.json +2253 -1314
  2. package/artifacts/HandshakeRegistry.d.json.ts +5 -0
  3. package/artifacts/HandshakeRegistry.json +13242 -0
  4. package/artifacts/MultiCallEntrypoint.json +1762 -1033
  5. package/artifacts/PublicChecks.json +1726 -927
  6. package/dest/auth-registry/constants.d.ts +3 -2
  7. package/dest/auth-registry/constants.d.ts.map +1 -1
  8. package/dest/contract_data.d.ts +1 -1
  9. package/dest/contract_data.d.ts.map +1 -1
  10. package/dest/contract_data.js +9 -5
  11. package/dest/drift.js +1 -1
  12. package/dest/handshake-registry/constants.d.ts +11 -0
  13. package/dest/handshake-registry/constants.d.ts.map +1 -0
  14. package/dest/handshake-registry/constants.js +17 -0
  15. package/dest/handshake-registry/index.d.ts +6 -0
  16. package/dest/handshake-registry/index.d.ts.map +1 -0
  17. package/dest/handshake-registry/index.js +14 -0
  18. package/dest/handshake-registry/lazy.d.ts +7 -0
  19. package/dest/handshake-registry/lazy.d.ts.map +1 -0
  20. package/dest/handshake-registry/lazy.js +24 -0
  21. package/dest/index.d.ts +3 -1
  22. package/dest/index.d.ts.map +1 -1
  23. package/dest/index.js +2 -0
  24. package/dest/multi-call-entrypoint/constants.d.ts +3 -2
  25. package/dest/multi-call-entrypoint/constants.d.ts.map +1 -1
  26. package/dest/public-checks/constants.d.ts +3 -2
  27. package/dest/public-checks/constants.d.ts.map +1 -1
  28. package/dest/publishable_standard_contracts.d.ts +17 -0
  29. package/dest/publishable_standard_contracts.d.ts.map +1 -0
  30. package/dest/publishable_standard_contracts.js +23 -0
  31. package/dest/standard_contract_data.d.ts +2 -2
  32. package/dest/standard_contract_data.d.ts.map +1 -1
  33. package/dest/standard_contract_data.js +42 -18
  34. package/package.json +5 -4
  35. package/src/auth-registry/constants.ts +3 -1
  36. package/src/contract_data.ts +9 -7
  37. package/src/drift.ts +1 -1
  38. package/src/handshake-registry/constants.ts +23 -0
  39. package/src/handshake-registry/index.ts +25 -0
  40. package/src/handshake-registry/lazy.ts +35 -0
  41. package/src/index.ts +2 -0
  42. package/src/multi-call-entrypoint/constants.ts +3 -1
  43. package/src/public-checks/constants.ts +3 -1
  44. package/src/publishable_standard_contracts.ts +22 -0
  45. package/src/standard_contract_data.ts +53 -15
@@ -1,8 +1,10 @@
1
1
  // Lightweight metadata leaf export for browser bundles: importing from
2
2
  // `@aztec/standard-contracts/multi-call-entrypoint/constants` avoids dragging in the
3
3
  // `MultiCallEntrypoint.json` static import.
4
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+
4
6
  import { StandardContractAddress, StandardContractClassId, StandardContractSalt } from '../standard_contract_data.js';
5
7
 
6
- export const STANDARD_MULTI_CALL_ENTRYPOINT_ADDRESS = StandardContractAddress.MultiCallEntrypoint;
8
+ export const STANDARD_MULTI_CALL_ENTRYPOINT_ADDRESS: AztecAddress = StandardContractAddress.MultiCallEntrypoint;
7
9
  export const STANDARD_MULTI_CALL_ENTRYPOINT_CLASS_ID = StandardContractClassId.MultiCallEntrypoint;
8
10
  export const STANDARD_MULTI_CALL_ENTRYPOINT_SALT = StandardContractSalt.MultiCallEntrypoint;
@@ -1,8 +1,10 @@
1
1
  // Lightweight metadata leaf export for browser bundles: importing from
2
2
  // `@aztec/standard-contracts/public-checks/constants` avoids dragging in the
3
3
  // `PublicChecks.json` static import.
4
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+
4
6
  import { StandardContractAddress, StandardContractClassId, StandardContractSalt } from '../standard_contract_data.js';
5
7
 
6
- export const STANDARD_PUBLIC_CHECKS_ADDRESS = StandardContractAddress.PublicChecks;
8
+ export const STANDARD_PUBLIC_CHECKS_ADDRESS: AztecAddress = StandardContractAddress.PublicChecks;
7
9
  export const STANDARD_PUBLIC_CHECKS_CLASS_ID = StandardContractClassId.PublicChecks;
8
10
  export const STANDARD_PUBLIC_CHECKS_SALT = StandardContractSalt.PublicChecks;
@@ -0,0 +1,22 @@
1
+ import { getStandardAuthRegistry } from './auth-registry/index.js';
2
+ import { getStandardHandshakeRegistry } from './handshake-registry/index.js';
3
+ import { getStandardPublicChecks } from './public-checks/index.js';
4
+ import type { StandardContract } from './standard_contract.js';
5
+
6
+ /**
7
+ * Returns the standard contracts that are published on-chain (class registration + instance
8
+ * publication) before their public functions can be called: AuthRegistry, PublicChecks, and
9
+ * HandshakeRegistry. These are exactly the contracts guarded by the `ensure*Published` e2e setup
10
+ * helpers.
11
+ *
12
+ * MultiCallEntrypoint is deliberately excluded: it is a client-side entrypoint used to encode
13
+ * batched private calls and is never published for public execution.
14
+ *
15
+ * This is the single source of truth for the set of standard contracts that test environments seed
16
+ * at genesis (registration/deployment nullifiers) and preload into the archiver contract store, so
17
+ * the two stay consistent — preloading a class whose nullifier is not seeded would recreate the
18
+ * publish-collision bug that genesis seeding avoids.
19
+ */
20
+ export function getPublishableStandardContracts(): Promise<StandardContract[]> {
21
+ return Promise.all([getStandardAuthRegistry(), getStandardPublicChecks(), getStandardHandshakeRegistry()]);
22
+ }
@@ -3,7 +3,12 @@ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import { FunctionSelector } from '@aztec/stdlib/abi';
4
4
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
5
 
6
- export const standardContractNames = ['AuthRegistry', 'MultiCallEntrypoint', 'PublicChecks'] as const;
6
+ export const standardContractNames = [
7
+ 'AuthRegistry',
8
+ 'MultiCallEntrypoint',
9
+ 'PublicChecks',
10
+ 'HandshakeRegistry',
11
+ ] as const;
7
12
 
8
13
  export type StandardContractName = (typeof standardContractNames)[number];
9
14
 
@@ -11,18 +16,25 @@ export const StandardContractSalt: Record<StandardContractName, Fr> = {
11
16
  AuthRegistry: new Fr(1),
12
17
  MultiCallEntrypoint: new Fr(1),
13
18
  PublicChecks: new Fr(1),
19
+ HandshakeRegistry: new Fr(1),
14
20
  };
15
21
 
16
22
  export const StandardContractAddress: Record<StandardContractName, AztecAddress> = {
17
- AuthRegistry: AztecAddress.fromString('0x01de9d215d1845808cf388d3a88f9066af1e73ec280e979c3b1aec8ba6b149ea'),
18
- MultiCallEntrypoint: AztecAddress.fromString('0x09a72c4cb473b087f59f28f913aa103c214b4f9bbf10d4157e06745169359210'),
19
- PublicChecks: AztecAddress.fromString('0x05d900a6ed1b4ad3ff52cbe5f98d9b291b0f35c6dd5c41b1642659344d234bfe'),
23
+ AuthRegistry: AztecAddress.fromStringUnsafe('0x1e8e7e73c592a1b1c9199b4b655ddc7a16fa8a8488df595610b71d3dc1cc666c'),
24
+ MultiCallEntrypoint: AztecAddress.fromStringUnsafe(
25
+ '0x246d60af8b79a5dceece7d2388921203401c0df02ce674c5781c6c2162922986',
26
+ ),
27
+ PublicChecks: AztecAddress.fromStringUnsafe('0x031b75e2c220f6a6f27da5d61f7b2a12756a127fd25b95fad5da1c5520994b18'),
28
+ HandshakeRegistry: AztecAddress.fromStringUnsafe(
29
+ '0x086c3c67589e1141c70ed0ed8ae324c51d3bf7c5637043fd84c424ffb625831d',
30
+ ),
20
31
  };
21
32
 
22
33
  export const StandardContractClassId: Record<StandardContractName, Fr> = {
23
- AuthRegistry: Fr.fromString('0x2cfbdd0ce7cc31b5cc5f4eb8f680e0e245882b2208bd67828e41a8bd24a19292'),
24
- MultiCallEntrypoint: Fr.fromString('0x188160c82cb3a9a24c6f156f270e962afa124cdd2dabce78aaa0bf04fdd799f6'),
25
- PublicChecks: Fr.fromString('0x022bbd3c085d6a09ec500110852441419c7b1e6dc21a8d459233b72a84d03a1f'),
34
+ AuthRegistry: Fr.fromString('0x04182c4b482c8e60c386e473f6dbb6bb3e2ef18e5156f7c9db5ac46af81abdcf'),
35
+ MultiCallEntrypoint: Fr.fromString('0x2f20566eaff9091697f8f5c43a19041267c7591d54074b57043eae90fca8ea64'),
36
+ PublicChecks: Fr.fromString('0x04bc93d415c4d48acab6063b6410f74e1cc257ba8e519020f8773b4ce8ccd31e'),
37
+ HandshakeRegistry: Fr.fromString('0x020ec1998d06036ddab4ba170e9b0d9b96e52beb58aa5ea83d72b22f589cbe6c'),
26
38
  };
27
39
 
28
40
  export const StandardContractClassIdPreimage: Record<
@@ -30,26 +42,32 @@ export const StandardContractClassIdPreimage: Record<
30
42
  { artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }
31
43
  > = {
32
44
  AuthRegistry: {
33
- artifactHash: Fr.fromString('0x0dd24a86cce5ff4ef33ca14f16359c5a154ce3f1ed91a9570dd5343569f5386f'),
34
- privateFunctionsRoot: Fr.fromString('0x17b584350f4c3ccafd8f688729afb9feab8976114fb40012e9dee65022c072a4'),
35
- publicBytecodeCommitment: Fr.fromString('0x2545f39893766508ce37bb5cea5e4dcab04c6f7f79f3089b1c076876e9d268b2'),
45
+ artifactHash: Fr.fromString('0x0f050d2517afac6974e02937314e095569f4c7bb70d98cea097c562313872c8c'),
46
+ privateFunctionsRoot: Fr.fromString('0x1b16157ab0b322bcaf3de5cb197b276c5e29ca3668a0c440668ca56aa7dfff77'),
47
+ publicBytecodeCommitment: Fr.fromString('0x0c7984b020afc901da3b5898b8f94d1d9a09ea2b37d6e0043409abc0b0332906'),
36
48
  },
37
49
  MultiCallEntrypoint: {
38
- artifactHash: Fr.fromString('0x1f8c5717b0e478e63f462f9792969865684f8403b4608980b1a83324c03dd498'),
39
- privateFunctionsRoot: Fr.fromString('0x0e68dfbb256e80b08b3aef47aca1f2669e97a9c6259787893c1223ac083ad5d5'),
50
+ artifactHash: Fr.fromString('0x2c0df1970a0307e54c4445670a7f915a77ed57650ffd37a76c47e512c88e0302'),
51
+ privateFunctionsRoot: Fr.fromString('0x10228bc99b6715f15c866a1df0d9cb63c31920cb8e61a6b79058bf98658d7f39'),
40
52
  publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
41
53
  },
42
54
  PublicChecks: {
43
- artifactHash: Fr.fromString('0x030776b58475bf6a0545eaa4f4002f5fe6701bd0d306b68065f4b40ef4fdbe60'),
55
+ artifactHash: Fr.fromString('0x0e6f595db5f0830c2f52f1a5aec5cc85193b89a47408cfbbb2d6ad8f3a7c8a52'),
44
56
  privateFunctionsRoot: Fr.fromString('0x202860adb1b8975971eeaf571aaaa88a27f4035290d58532ae7d60b0dfaad54c'),
45
57
  publicBytecodeCommitment: Fr.fromString('0x013c4f854a5c87c9daf86c5f9bc07a42c2a061f1d924a5b3564ec7edc8e18cb7'),
46
58
  },
59
+ HandshakeRegistry: {
60
+ artifactHash: Fr.fromString('0x2dd01b80cabc352f7d01799a6e5dd6255cc0d7f01fe42d270760d0bf0a0b5daf'),
61
+ privateFunctionsRoot: Fr.fromString('0x0c80100ee31d91778c8f3d4453d056a58467b50f86d446f3209b96d87acb354e'),
62
+ publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
63
+ },
47
64
  };
48
65
 
49
66
  export const StandardContractInitializationHash: Record<StandardContractName, Fr> = {
50
67
  AuthRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
51
68
  MultiCallEntrypoint: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
52
69
  PublicChecks: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
70
+ HandshakeRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
53
71
  };
54
72
 
55
73
  export const StandardContractPrivateFunctions: Record<
@@ -61,7 +79,7 @@ export const StandardContractPrivateFunctions: Record<
61
79
  selector: FunctionSelector.fromField(
62
80
  Fr.fromString('0x0000000000000000000000000000000000000000000000000000000079a3d418'),
63
81
  ),
64
- vkHash: Fr.fromString('0x06a5c1b3a636c954a90be43cb56a4bdd9dc8aec764151a012e0018753694ff54'),
82
+ vkHash: Fr.fromString('0x2d46cdec4cc2afd813ba2b50106dba455821e4c7b3c10f1c7293bbc759dccf64'),
65
83
  },
66
84
  ],
67
85
  MultiCallEntrypoint: [
@@ -69,8 +87,28 @@ export const StandardContractPrivateFunctions: Record<
69
87
  selector: FunctionSelector.fromField(
70
88
  Fr.fromString('0x00000000000000000000000000000000000000000000000000000000f04908a9'),
71
89
  ),
72
- vkHash: Fr.fromString('0x0b19b2f937f2581922c2ead5411ad9ff4ed9710efe9849bde494d9a0f94812ec'),
90
+ vkHash: Fr.fromString('0x0699bae67183ce084da1cd76ce05d18f45f796237f2baafaf7d4bfbf9663c433'),
73
91
  },
74
92
  ],
75
93
  PublicChecks: [],
94
+ HandshakeRegistry: [
95
+ {
96
+ selector: FunctionSelector.fromField(
97
+ Fr.fromString('0x0000000000000000000000000000000000000000000000000000000019f8b409'),
98
+ ),
99
+ vkHash: Fr.fromString('0x033a99c31fd390e320398efa03eb1a34d0db2f2e0201fbb0062aa915f406f3d7'),
100
+ },
101
+ {
102
+ selector: FunctionSelector.fromField(
103
+ Fr.fromString('0x00000000000000000000000000000000000000000000000000000000db548fcf'),
104
+ ),
105
+ vkHash: Fr.fromString('0x12964f25be85fded4079591a3871e85d15967c75fd70f3d0edf10d72abfea59c'),
106
+ },
107
+ {
108
+ selector: FunctionSelector.fromField(
109
+ Fr.fromString('0x00000000000000000000000000000000000000000000000000000000f1ff839b'),
110
+ ),
111
+ vkHash: Fr.fromString('0x049120d4c9a12a2286c83df31064637b53746ea13868b0756174dcb3e036bb9d'),
112
+ },
113
+ ],
76
114
  };