@aztec/standard-contracts 0.0.1-commit.d58ff9d0 → 0.0.1-commit.f5a9928
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.
- package/artifacts/AuthRegistry.json +2469 -229
- package/artifacts/HandshakeRegistry.json +162 -158
- package/artifacts/MultiCallEntrypoint.json +2830 -438
- package/artifacts/PublicChecks.json +2751 -665
- package/artifacts-historical/HandshakeRegistry-5.0.1.d.json.ts +4 -0
- package/artifacts-historical/HandshakeRegistry-5.0.1.json +1 -0
- package/dest/handshake-registry/constants.d.ts +2 -1
- package/dest/handshake-registry/constants.d.ts.map +1 -1
- package/dest/handshake-registry/constants.js +1 -0
- package/dest/handshake-registry/historical.d.ts +11 -0
- package/dest/handshake-registry/historical.d.ts.map +1 -0
- package/dest/handshake-registry/historical.js +38 -0
- package/dest/handshake-registry/index.d.ts +4 -2
- package/dest/handshake-registry/index.d.ts.map +1 -1
- package/dest/handshake-registry/index.js +15 -2
- package/dest/handshake-registry/lazy.d.ts +4 -2
- package/dest/handshake-registry/lazy.d.ts.map +1 -1
- package/dest/handshake-registry/lazy.js +14 -2
- package/dest/index.d.ts +3 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +2 -0
- package/dest/make_standard_contract.d.ts +13 -1
- package/dest/make_standard_contract.d.ts.map +1 -1
- package/dest/make_standard_contract.js +18 -5
- package/dest/preloaded/index.d.ts +8 -0
- package/dest/preloaded/index.d.ts.map +1 -0
- package/dest/preloaded/index.js +21 -0
- package/dest/preloaded/lazy.d.ts +8 -0
- package/dest/preloaded/lazy.d.ts.map +1 -0
- package/dest/preloaded/lazy.js +21 -0
- package/dest/publishable_standard_contracts.d.ts +17 -0
- package/dest/publishable_standard_contracts.d.ts.map +1 -0
- package/dest/publishable_standard_contracts.js +23 -0
- package/dest/standard_contract_data.js +20 -20
- package/package.json +4 -3
- package/src/handshake-registry/constants.ts +2 -0
- package/src/handshake-registry/historical.ts +44 -0
- package/src/handshake-registry/index.ts +19 -1
- package/src/handshake-registry/lazy.ts +19 -1
- package/src/index.ts +2 -0
- package/src/make_standard_contract.ts +28 -5
- package/src/preloaded/index.ts +19 -0
- package/src/preloaded/lazy.ts +19 -0
- package/src/publishable_standard_contracts.ts +22 -0
- package/src/standard_contract_data.ts +20 -20
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type ContractArtifact, loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
|
|
3
|
-
import { makeStandardContract } from '../make_standard_contract.js';
|
|
3
|
+
import { makeStandardContract, makeStandardContractFromData } from '../make_standard_contract.js';
|
|
4
4
|
import type { StandardContract } from '../standard_contract.js';
|
|
5
|
+
import { HANDSHAKE_REGISTRY_V5_0_1_DATA } from './historical.js';
|
|
5
6
|
|
|
6
7
|
export {
|
|
8
|
+
HISTORICAL_STANDARD_HANDSHAKE_REGISTRY_ADDRESSES,
|
|
7
9
|
STANDARD_HANDSHAKE_REGISTRY_ADDRESS,
|
|
8
10
|
STANDARD_HANDSHAKE_REGISTRY_CLASS_ID,
|
|
9
11
|
STANDARD_HANDSHAKE_REGISTRY_SALT,
|
|
@@ -33,3 +35,19 @@ export async function getStandardHandshakeRegistry(): Promise<StandardContract>
|
|
|
33
35
|
}
|
|
34
36
|
return standardContract;
|
|
35
37
|
}
|
|
38
|
+
|
|
39
|
+
let historicalStandardContracts: StandardContract[];
|
|
40
|
+
|
|
41
|
+
/** Returns superseded standard deployments of the handshake registry that remain live onchain. */
|
|
42
|
+
export async function getHistoricalStandardHandshakeRegistries(): Promise<StandardContract[]> {
|
|
43
|
+
if (!historicalStandardContracts) {
|
|
44
|
+
// Same bundler-compatible lazy import as `getHandshakeRegistryArtifact` above.
|
|
45
|
+
const { default: handshakeRegistryV501Json } = await import(
|
|
46
|
+
'../../artifacts-historical/HandshakeRegistry-5.0.1.json'
|
|
47
|
+
);
|
|
48
|
+
historicalStandardContracts = [
|
|
49
|
+
makeStandardContractFromData(HANDSHAKE_REGISTRY_V5_0_1_DATA, loadContractArtifact(handshakeRegistryV501Json)),
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
return historicalStandardContracts;
|
|
53
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from './auth-registry/index.js';
|
|
2
2
|
export * from './handshake-registry/index.js';
|
|
3
3
|
export * from './multi-call-entrypoint/index.js';
|
|
4
|
+
export * from './preloaded/index.js';
|
|
4
5
|
export * from './public-checks/index.js';
|
|
6
|
+
export * from './publishable_standard_contracts.js';
|
|
@@ -3,6 +3,7 @@ import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
5
5
|
|
|
6
|
+
import type { ContractData } from './contract_data.js';
|
|
6
7
|
import type { StandardContract } from './standard_contract.js';
|
|
7
8
|
import {
|
|
8
9
|
StandardContractAddress,
|
|
@@ -14,16 +15,38 @@ import {
|
|
|
14
15
|
StandardContractSalt,
|
|
15
16
|
} from './standard_contract_data.js';
|
|
16
17
|
|
|
18
|
+
/** Precomputed deployment values of a standard contract, enough to reconstruct it without any hash computations. */
|
|
19
|
+
export type StandardContractData = ContractData & { salt: Fr };
|
|
20
|
+
|
|
17
21
|
/**
|
|
18
22
|
* Reconstructs a StandardContract from precomputed data without performing any hash computations.
|
|
19
23
|
* Internal to the standard-contracts package — not part of the public API.
|
|
20
24
|
*/
|
|
21
25
|
export function makeStandardContract(name: StandardContractName, artifact: ContractArtifact): StandardContract {
|
|
22
|
-
const address = StandardContractAddress[name];
|
|
23
|
-
const salt = StandardContractSalt[name];
|
|
24
|
-
const classId = StandardContractClassId[name];
|
|
25
26
|
const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment } = StandardContractClassIdPreimage[name];
|
|
26
|
-
|
|
27
|
+
return makeStandardContractFromData(
|
|
28
|
+
{
|
|
29
|
+
address: StandardContractAddress[name],
|
|
30
|
+
salt: StandardContractSalt[name],
|
|
31
|
+
classId: StandardContractClassId[name],
|
|
32
|
+
artifactHash,
|
|
33
|
+
privateFunctionsRoot,
|
|
34
|
+
publicBytecodeCommitment,
|
|
35
|
+
initializationHash: StandardContractInitializationHash[name],
|
|
36
|
+
privateFunctions: StandardContractPrivateFunctions[name],
|
|
37
|
+
},
|
|
38
|
+
artifact,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Reconstructs a StandardContract from explicit precomputed data, for deployments not covered by the generated
|
|
44
|
+
* `standard_contract_data.ts` records (namely historical deployments from previous releases).
|
|
45
|
+
* Internal to the standard-contracts package, not part of the public API.
|
|
46
|
+
*/
|
|
47
|
+
export function makeStandardContractFromData(data: StandardContractData, artifact: ContractArtifact): StandardContract {
|
|
48
|
+
const { address, salt, classId, artifactHash, privateFunctionsRoot, publicBytecodeCommitment, initializationHash } =
|
|
49
|
+
data;
|
|
27
50
|
|
|
28
51
|
const contractClass = {
|
|
29
52
|
id: classId,
|
|
@@ -32,7 +55,7 @@ export function makeStandardContract(name: StandardContractName, artifact: Contr
|
|
|
32
55
|
privateFunctionsRoot,
|
|
33
56
|
publicBytecodeCommitment,
|
|
34
57
|
packedBytecode: artifact.functions.find(f => f.name === 'public_dispatch')?.bytecode ?? Buffer.alloc(0),
|
|
35
|
-
privateFunctions:
|
|
58
|
+
privateFunctions: data.privateFunctions,
|
|
36
59
|
};
|
|
37
60
|
|
|
38
61
|
const instance = {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getStandardAuthRegistry } from '../auth-registry/index.js';
|
|
2
|
+
import { getHistoricalStandardHandshakeRegistries, getStandardHandshakeRegistry } from '../handshake-registry/index.js';
|
|
3
|
+
import { getStandardMultiCallEntrypoint } from '../multi-call-entrypoint/index.js';
|
|
4
|
+
import type { StandardContract } from '../standard_contract.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Returns the standard contracts every PXE registers by default: the MultiCallEntrypoint, the AuthRegistry, and the
|
|
8
|
+
* HandshakeRegistry, plus superseded HandshakeRegistry deployments that remain live onchain so contracts compiled
|
|
9
|
+
* against older releases keep resolving the registry version they were built for.
|
|
10
|
+
*/
|
|
11
|
+
export async function getDefaultStandardPreloadedContracts(): Promise<StandardContract[]> {
|
|
12
|
+
const [multiCallEntrypoint, authRegistry, handshakeRegistry, historicalHandshakeRegistries] = await Promise.all([
|
|
13
|
+
getStandardMultiCallEntrypoint(),
|
|
14
|
+
getStandardAuthRegistry(),
|
|
15
|
+
getStandardHandshakeRegistry(),
|
|
16
|
+
getHistoricalStandardHandshakeRegistries(),
|
|
17
|
+
]);
|
|
18
|
+
return [multiCallEntrypoint, authRegistry, handshakeRegistry, ...historicalHandshakeRegistries];
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getStandardAuthRegistry } from '../auth-registry/lazy.js';
|
|
2
|
+
import { getHistoricalStandardHandshakeRegistries, getStandardHandshakeRegistry } from '../handshake-registry/lazy.js';
|
|
3
|
+
import { getStandardMultiCallEntrypoint } from '../multi-call-entrypoint/lazy.js';
|
|
4
|
+
import type { StandardContract } from '../standard_contract.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Returns the standard contracts every PXE registers by default: the MultiCallEntrypoint, the AuthRegistry, and the
|
|
8
|
+
* HandshakeRegistry, plus superseded HandshakeRegistry deployments that remain live onchain so contracts compiled
|
|
9
|
+
* against older releases keep resolving the registry version they were built for.
|
|
10
|
+
*/
|
|
11
|
+
export async function getDefaultStandardPreloadedContracts(): Promise<StandardContract[]> {
|
|
12
|
+
const [multiCallEntrypoint, authRegistry, handshakeRegistry, historicalHandshakeRegistries] = await Promise.all([
|
|
13
|
+
getStandardMultiCallEntrypoint(),
|
|
14
|
+
getStandardAuthRegistry(),
|
|
15
|
+
getStandardHandshakeRegistry(),
|
|
16
|
+
getHistoricalStandardHandshakeRegistries(),
|
|
17
|
+
]);
|
|
18
|
+
return [multiCallEntrypoint, authRegistry, handshakeRegistry, ...historicalHandshakeRegistries];
|
|
19
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -20,21 +20,21 @@ export const StandardContractSalt: Record<StandardContractName, Fr> = {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export const StandardContractAddress: Record<StandardContractName, AztecAddress> = {
|
|
23
|
-
AuthRegistry: AztecAddress.fromStringUnsafe('
|
|
23
|
+
AuthRegistry: AztecAddress.fromStringUnsafe('0x1e8e7e73c592a1b1c9199b4b655ddc7a16fa8a8488df595610b71d3dc1cc666c'),
|
|
24
24
|
MultiCallEntrypoint: AztecAddress.fromStringUnsafe(
|
|
25
|
-
'
|
|
25
|
+
'0x246d60af8b79a5dceece7d2388921203401c0df02ce674c5781c6c2162922986',
|
|
26
26
|
),
|
|
27
|
-
PublicChecks: AztecAddress.fromStringUnsafe('
|
|
27
|
+
PublicChecks: AztecAddress.fromStringUnsafe('0x031b75e2c220f6a6f27da5d61f7b2a12756a127fd25b95fad5da1c5520994b18'),
|
|
28
28
|
HandshakeRegistry: AztecAddress.fromStringUnsafe(
|
|
29
|
-
'
|
|
29
|
+
'0x06127814dca78709650de6629637194f7381d2e05b35eb9d53a4746636c9aa9d',
|
|
30
30
|
),
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const StandardContractClassId: Record<StandardContractName, Fr> = {
|
|
34
|
-
AuthRegistry: Fr.fromString('
|
|
35
|
-
MultiCallEntrypoint: Fr.fromString('
|
|
36
|
-
PublicChecks: Fr.fromString('
|
|
37
|
-
HandshakeRegistry: Fr.fromString('
|
|
34
|
+
AuthRegistry: Fr.fromString('0x04182c4b482c8e60c386e473f6dbb6bb3e2ef18e5156f7c9db5ac46af81abdcf'),
|
|
35
|
+
MultiCallEntrypoint: Fr.fromString('0x2f20566eaff9091697f8f5c43a19041267c7591d54074b57043eae90fca8ea64'),
|
|
36
|
+
PublicChecks: Fr.fromString('0x04bc93d415c4d48acab6063b6410f74e1cc257ba8e519020f8773b4ce8ccd31e'),
|
|
37
|
+
HandshakeRegistry: Fr.fromString('0x2e04c07c83ee8107e921c3ae4ade010ee183860a89b7534ea3367efb561d2c3b'),
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export const StandardContractClassIdPreimage: Record<
|
|
@@ -42,23 +42,23 @@ export const StandardContractClassIdPreimage: Record<
|
|
|
42
42
|
{ artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }
|
|
43
43
|
> = {
|
|
44
44
|
AuthRegistry: {
|
|
45
|
-
artifactHash: Fr.fromString('
|
|
46
|
-
privateFunctionsRoot: Fr.fromString('
|
|
45
|
+
artifactHash: Fr.fromString('0x0f050d2517afac6974e02937314e095569f4c7bb70d98cea097c562313872c8c'),
|
|
46
|
+
privateFunctionsRoot: Fr.fromString('0x1b16157ab0b322bcaf3de5cb197b276c5e29ca3668a0c440668ca56aa7dfff77'),
|
|
47
47
|
publicBytecodeCommitment: Fr.fromString('0x0c7984b020afc901da3b5898b8f94d1d9a09ea2b37d6e0043409abc0b0332906'),
|
|
48
48
|
},
|
|
49
49
|
MultiCallEntrypoint: {
|
|
50
|
-
artifactHash: Fr.fromString('
|
|
51
|
-
privateFunctionsRoot: Fr.fromString('
|
|
50
|
+
artifactHash: Fr.fromString('0x2c0df1970a0307e54c4445670a7f915a77ed57650ffd37a76c47e512c88e0302'),
|
|
51
|
+
privateFunctionsRoot: Fr.fromString('0x10228bc99b6715f15c866a1df0d9cb63c31920cb8e61a6b79058bf98658d7f39'),
|
|
52
52
|
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
53
53
|
},
|
|
54
54
|
PublicChecks: {
|
|
55
|
-
artifactHash: Fr.fromString('
|
|
55
|
+
artifactHash: Fr.fromString('0x0e6f595db5f0830c2f52f1a5aec5cc85193b89a47408cfbbb2d6ad8f3a7c8a52'),
|
|
56
56
|
privateFunctionsRoot: Fr.fromString('0x202860adb1b8975971eeaf571aaaa88a27f4035290d58532ae7d60b0dfaad54c'),
|
|
57
57
|
publicBytecodeCommitment: Fr.fromString('0x013c4f854a5c87c9daf86c5f9bc07a42c2a061f1d924a5b3564ec7edc8e18cb7'),
|
|
58
58
|
},
|
|
59
59
|
HandshakeRegistry: {
|
|
60
|
-
artifactHash: Fr.fromString('
|
|
61
|
-
privateFunctionsRoot: Fr.fromString('
|
|
60
|
+
artifactHash: Fr.fromString('0x005a9c5db229999895a873e4c2bcaf6ca2523522b5c520c52c39b1bdb1b5faee'),
|
|
61
|
+
privateFunctionsRoot: Fr.fromString('0x1bb83fa540ba6654ffe4a4c75ec9349180a2f0ecd0d3851ca28d665ab2926c73'),
|
|
62
62
|
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
63
63
|
},
|
|
64
64
|
};
|
|
@@ -79,7 +79,7 @@ export const StandardContractPrivateFunctions: Record<
|
|
|
79
79
|
selector: FunctionSelector.fromField(
|
|
80
80
|
Fr.fromString('0x0000000000000000000000000000000000000000000000000000000079a3d418'),
|
|
81
81
|
),
|
|
82
|
-
vkHash: Fr.fromString('
|
|
82
|
+
vkHash: Fr.fromString('0x2d46cdec4cc2afd813ba2b50106dba455821e4c7b3c10f1c7293bbc759dccf64'),
|
|
83
83
|
},
|
|
84
84
|
],
|
|
85
85
|
MultiCallEntrypoint: [
|
|
@@ -87,7 +87,7 @@ export const StandardContractPrivateFunctions: Record<
|
|
|
87
87
|
selector: FunctionSelector.fromField(
|
|
88
88
|
Fr.fromString('0x00000000000000000000000000000000000000000000000000000000f04908a9'),
|
|
89
89
|
),
|
|
90
|
-
vkHash: Fr.fromString('
|
|
90
|
+
vkHash: Fr.fromString('0x0699bae67183ce084da1cd76ce05d18f45f796237f2baafaf7d4bfbf9663c433'),
|
|
91
91
|
},
|
|
92
92
|
],
|
|
93
93
|
PublicChecks: [],
|
|
@@ -96,19 +96,19 @@ export const StandardContractPrivateFunctions: Record<
|
|
|
96
96
|
selector: FunctionSelector.fromField(
|
|
97
97
|
Fr.fromString('0x0000000000000000000000000000000000000000000000000000000019f8b409'),
|
|
98
98
|
),
|
|
99
|
-
vkHash: Fr.fromString('
|
|
99
|
+
vkHash: Fr.fromString('0x195d78c4fa1f3f8accaa2dcc45115c5b0536e68cdd4c06f5999185554f7b73e4'),
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
selector: FunctionSelector.fromField(
|
|
103
103
|
Fr.fromString('0x00000000000000000000000000000000000000000000000000000000db548fcf'),
|
|
104
104
|
),
|
|
105
|
-
vkHash: Fr.fromString('
|
|
105
|
+
vkHash: Fr.fromString('0x06ea812f1c792a864a36003312327d78995fdd894fbf48d54928a315e84df342'),
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
108
|
selector: FunctionSelector.fromField(
|
|
109
109
|
Fr.fromString('0x00000000000000000000000000000000000000000000000000000000f1ff839b'),
|
|
110
110
|
),
|
|
111
|
-
vkHash: Fr.fromString('
|
|
111
|
+
vkHash: Fr.fromString('0x049120d4c9a12a2286c83df31064637b53746ea13868b0756174dcb3e036bb9d'),
|
|
112
112
|
},
|
|
113
113
|
],
|
|
114
114
|
};
|