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

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 +981 -2282
  2. package/artifacts/HandshakeRegistry.d.json.ts +5 -0
  3. package/artifacts/HandshakeRegistry.json +13258 -0
  4. package/artifacts/MultiCallEntrypoint.json +754 -2417
  5. package/artifacts/PublicChecks.json +645 -1932
  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 +2 -2
  9. package/dest/contract_data.d.ts.map +1 -1
  10. package/dest/contract_data.js +10 -6
  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 +10 -8
  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
@@ -0,0 +1,35 @@
1
+ import { type ContractArtifact, loadContractArtifact } from '@aztec/stdlib/abi';
2
+
3
+ import { makeStandardContract } from '../make_standard_contract.js';
4
+ import type { StandardContract } from '../standard_contract.js';
5
+
6
+ export {
7
+ STANDARD_HANDSHAKE_REGISTRY_ADDRESS,
8
+ STANDARD_HANDSHAKE_REGISTRY_CLASS_ID,
9
+ STANDARD_HANDSHAKE_REGISTRY_SALT,
10
+ } from './constants.js';
11
+
12
+ let standardContract: StandardContract;
13
+ let standardContractArtifact: ContractArtifact;
14
+
15
+ export async function getHandshakeRegistryArtifact(): Promise<ContractArtifact> {
16
+ if (!standardContractArtifact) {
17
+ // Cannot assert this import as it's incompatible with bundlers like vite
18
+ // https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
19
+ // Even if now supported by all major browsers, the MIME type is replaced with
20
+ // "text/javascript"
21
+ // In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
22
+ const { default: handshakeRegistryJson } = await import('../../artifacts/HandshakeRegistry.json');
23
+ standardContractArtifact = loadContractArtifact(handshakeRegistryJson);
24
+ }
25
+ return standardContractArtifact;
26
+ }
27
+
28
+ /** Returns the standard deployment of the handshake registry. */
29
+ export async function getStandardHandshakeRegistry(): Promise<StandardContract> {
30
+ if (!standardContract) {
31
+ const artifact = await getHandshakeRegistryArtifact();
32
+ standardContract = makeStandardContract('HandshakeRegistry', artifact);
33
+ }
34
+ return standardContract;
35
+ }
package/src/index.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from './auth-registry/index.js';
2
+ export * from './handshake-registry/index.js';
2
3
  export * from './multi-call-entrypoint/index.js';
3
4
  export * from './public-checks/index.js';
5
+ export * from './publishable_standard_contracts.js';
@@ -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('0x1fe01dde371ec27308a4e5d1f08d2e734b773352c1f47d9d5b0974c1729ac16e'),
24
+ MultiCallEntrypoint: AztecAddress.fromStringUnsafe(
25
+ '0x124b09dd9229a0e476e5d5affcbd917c16400d7673a6b589497650afc18456da',
26
+ ),
27
+ PublicChecks: AztecAddress.fromStringUnsafe('0x0de6d5fa41576a2289a289180c5ba3b1b75d19a630c779cfbef4480e27ac3e28'),
28
+ HandshakeRegistry: AztecAddress.fromStringUnsafe(
29
+ '0x1f81756ef59026857b437350d1123ea317cacf3a20b95c77586d618591b8bb93',
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('0x07429c3c22c191987452fe7c8daeb56b8a4ada6d94fed30e7fb6659da36c5099'),
35
+ MultiCallEntrypoint: Fr.fromString('0x28aa32d375f8c4acb57cf9ee899bd3b08a5a148cecf2064602fe818aafdf6e33'),
36
+ PublicChecks: Fr.fromString('0x0ac1bd3e46990fdcd9c4182ca9dab6d9b22dda5ee1a9fe581dde36a6ea639596'),
37
+ HandshakeRegistry: Fr.fromString('0x1544fd83a3880eca21d17789665e5281318ea4f9395aef53217463deb5b82619'),
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('0x0d029bbbf1f83e4c8c088213c7b7d200d2e89d2085183f53151d59ba369e1fab'),
46
+ privateFunctionsRoot: Fr.fromString('0x211b33685bcb41a5d3a2a84d8ec021c7280392cb4aae5a778eafe5282dbba740'),
47
+ publicBytecodeCommitment: Fr.fromString('0x0c7984b020afc901da3b5898b8f94d1d9a09ea2b37d6e0043409abc0b0332906'),
36
48
  },
37
49
  MultiCallEntrypoint: {
38
- artifactHash: Fr.fromString('0x1f8c5717b0e478e63f462f9792969865684f8403b4608980b1a83324c03dd498'),
39
- privateFunctionsRoot: Fr.fromString('0x0e68dfbb256e80b08b3aef47aca1f2669e97a9c6259787893c1223ac083ad5d5'),
50
+ artifactHash: Fr.fromString('0x28f8874c4768c1072922ca41c49ba1f302aefb7f858ebb289dc17c993abc8528'),
51
+ privateFunctionsRoot: Fr.fromString('0x2cd2008a79f59c3f2caa996962b0b35889f5ee8fcf175282406a2a521550cc70'),
40
52
  publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
41
53
  },
42
54
  PublicChecks: {
43
- artifactHash: Fr.fromString('0x030776b58475bf6a0545eaa4f4002f5fe6701bd0d306b68065f4b40ef4fdbe60'),
55
+ artifactHash: Fr.fromString('0x1149d0cd4421cb20fccdcf2c73c79df4e773e30f6c4b8d24e8c1cd718d34d50b'),
44
56
  privateFunctionsRoot: Fr.fromString('0x202860adb1b8975971eeaf571aaaa88a27f4035290d58532ae7d60b0dfaad54c'),
45
57
  publicBytecodeCommitment: Fr.fromString('0x013c4f854a5c87c9daf86c5f9bc07a42c2a061f1d924a5b3564ec7edc8e18cb7'),
46
58
  },
59
+ HandshakeRegistry: {
60
+ artifactHash: Fr.fromString('0x1c02c2ba7d53ec4fd5450d6dc7f86ab1b17a6fcfa5a50850405e7529acc9638b'),
61
+ privateFunctionsRoot: Fr.fromString('0x10288478f6ce295fa9a831e0b712773f4c59287a6bc6ae57b5948519b94f7171'),
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('0x2979f430e7a6d4c2222a35a5e00f9c8c0e41c5ad9afa95d8d718f5c1f57ac4f2'),
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('0x1bc6ab9244a92fe2143e42a1856ea0b29415e0530eda89dd634a0b8630780593'),
73
91
  },
74
92
  ],
75
93
  PublicChecks: [],
94
+ HandshakeRegistry: [
95
+ {
96
+ selector: FunctionSelector.fromField(
97
+ Fr.fromString('0x0000000000000000000000000000000000000000000000000000000019f8b409'),
98
+ ),
99
+ vkHash: Fr.fromString('0x136fb94bf8b1bfdb25f4d6c6ced06b8db140a268330308027b32ced3151faa81'),
100
+ },
101
+ {
102
+ selector: FunctionSelector.fromField(
103
+ Fr.fromString('0x00000000000000000000000000000000000000000000000000000000db548fcf'),
104
+ ),
105
+ vkHash: Fr.fromString('0x06bfb80a0e8d1c8f941c7f91c233e56febcb60300c4dcbf878df87120aa9a89f'),
106
+ },
107
+ {
108
+ selector: FunctionSelector.fromField(
109
+ Fr.fromString('0x00000000000000000000000000000000000000000000000000000000f1ff839b'),
110
+ ),
111
+ vkHash: Fr.fromString('0x05eef6388f1678ef7a24ed7829a15abf8fb76922ed73477114ff4828e2772535'),
112
+ },
113
+ ],
76
114
  };