@aztec/protocol-contracts 0.0.0-test.0 → 0.0.1-commit.001888fc
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/README.md +2 -2
- package/artifacts/AuthRegistry.json +2602 -1590
- package/artifacts/ContractClassRegistry.json +2022 -0
- package/artifacts/ContractInstanceRegistry.json +2949 -0
- package/artifacts/FeeJuice.json +3040 -2987
- package/artifacts/MultiCallEntrypoint.json +2153 -1169
- package/artifacts/PublicChecks.json +1200 -0
- package/dest/auth-registry/index.d.ts +3 -2
- package/dest/auth-registry/index.d.ts.map +1 -1
- package/dest/auth-registry/index.js +4 -4
- package/dest/auth-registry/lazy.d.ts +1 -1
- package/dest/auth-registry/lazy.js +5 -5
- package/dest/class-registry/contract_class_published_event.d.ts +17 -0
- package/dest/class-registry/contract_class_published_event.d.ts.map +1 -0
- package/dest/{class-registerer/contract_class_registered_event.js → class-registry/contract_class_published_event.js} +15 -20
- package/dest/class-registry/index.d.ts +8 -0
- package/dest/class-registry/index.d.ts.map +1 -0
- package/dest/class-registry/index.js +17 -0
- package/dest/class-registry/lazy.d.ts +9 -0
- package/dest/class-registry/lazy.d.ts.map +1 -0
- package/dest/class-registry/lazy.js +26 -0
- package/dest/class-registry/private_function_broadcasted_event.d.ts +44 -0
- package/dest/class-registry/private_function_broadcasted_event.d.ts.map +1 -0
- package/dest/{class-registerer → class-registry}/private_function_broadcasted_event.js +11 -11
- package/dest/class-registry/utility_function_broadcasted_event.d.ts +38 -0
- package/dest/class-registry/utility_function_broadcasted_event.d.ts.map +1 -0
- package/dest/{class-registerer/unconstrained_function_broadcasted_event.js → class-registry/utility_function_broadcasted_event.js} +20 -20
- package/dest/fee-juice/index.d.ts +2 -2
- package/dest/fee-juice/index.d.ts.map +1 -1
- package/dest/fee-juice/index.js +4 -4
- package/dest/fee-juice/lazy.d.ts +1 -1
- package/dest/fee-juice/lazy.js +5 -5
- package/dest/index.d.ts +1 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +0 -1
- package/dest/instance-registry/contract_instance_published_event.d.ts +21 -0
- package/dest/instance-registry/contract_instance_published_event.d.ts.map +1 -0
- package/dest/{instance-deployer/contract_instance_deployed_event.js → instance-registry/contract_instance_published_event.js} +9 -6
- package/dest/instance-registry/contract_instance_updated_event.d.ts +17 -0
- package/dest/instance-registry/contract_instance_updated_event.d.ts.map +1 -0
- package/dest/instance-registry/contract_instance_updated_event.js +35 -0
- package/dest/instance-registry/index.d.ts +7 -0
- package/dest/instance-registry/index.d.ts.map +1 -0
- package/dest/instance-registry/index.js +15 -0
- package/dest/instance-registry/lazy.d.ts +8 -0
- package/dest/{instance-deployer → instance-registry}/lazy.d.ts.map +1 -1
- package/dest/instance-registry/lazy.js +25 -0
- package/dest/make_protocol_contract.d.ts +4 -4
- package/dest/make_protocol_contract.d.ts.map +1 -1
- package/dest/make_protocol_contract.js +28 -14
- package/dest/multi-call-entrypoint/index.d.ts +1 -1
- package/dest/multi-call-entrypoint/index.d.ts.map +1 -1
- package/dest/multi-call-entrypoint/index.js +4 -4
- package/dest/multi-call-entrypoint/lazy.d.ts +1 -1
- package/dest/multi-call-entrypoint/lazy.js +5 -5
- package/dest/protocol_contract.d.ts +1 -1
- package/dest/protocol_contract_data.d.ts +26 -16
- package/dest/protocol_contract_data.d.ts.map +1 -1
- package/dest/protocol_contract_data.js +119 -23
- package/dest/provider/bundle.d.ts +1 -1
- package/dest/provider/bundle.d.ts.map +1 -1
- package/dest/provider/bundle.js +7 -7
- package/dest/provider/lazy.d.ts +1 -1
- package/dest/provider/lazy.d.ts.map +1 -1
- package/dest/provider/lazy.js +9 -9
- package/dest/provider/protocol_contracts_provider.d.ts +1 -1
- package/dest/public-checks/index.d.ts +5 -0
- package/dest/public-checks/index.d.ts.map +1 -0
- package/dest/public-checks/index.js +13 -0
- package/dest/public-checks/lazy.d.ts +6 -0
- package/dest/public-checks/lazy.d.ts.map +1 -0
- package/dest/public-checks/lazy.js +23 -0
- package/dest/scripts/cleanup_artifacts.js +2 -2
- package/dest/scripts/generate_data.js +95 -53
- package/dest/tests/fixtures.d.ts +4 -6
- package/dest/tests/fixtures.d.ts.map +1 -1
- package/dest/tests/fixtures.js +6 -6
- package/package.json +23 -20
- package/src/auth-registry/index.ts +6 -6
- package/src/auth-registry/lazy.ts +5 -5
- package/src/class-registry/__snapshots__/README.md +9 -0
- package/src/{class-registerer/contract_class_registered_event.ts → class-registry/contract_class_published_event.ts} +23 -23
- package/src/class-registry/index.ts +23 -0
- package/src/class-registry/lazy.ts +33 -0
- package/src/{class-registerer → class-registry}/private_function_broadcasted_event.ts +13 -9
- package/src/{class-registerer/unconstrained_function_broadcasted_event.ts → class-registry/utility_function_broadcasted_event.ts} +26 -22
- package/src/fee-juice/index.ts +5 -5
- package/src/fee-juice/lazy.ts +5 -5
- package/src/index.ts +0 -1
- package/src/instance-registry/__snapshots__/README.md +9 -0
- package/src/{instance-deployer/contract_instance_deployed_event.ts → instance-registry/contract_instance_published_event.ts} +13 -7
- package/src/{instance-deployer → instance-registry}/contract_instance_updated_event.ts +15 -15
- package/src/instance-registry/index.ts +23 -0
- package/src/instance-registry/lazy.ts +32 -0
- package/src/make_protocol_contract.ts +37 -15
- package/src/multi-call-entrypoint/index.ts +4 -4
- package/src/multi-call-entrypoint/lazy.ts +5 -5
- package/src/protocol_contract_data.ts +97 -23
- package/src/provider/bundle.ts +7 -7
- package/src/provider/lazy.ts +9 -9
- package/src/{router → public-checks}/index.ts +5 -5
- package/src/public-checks/lazy.ts +29 -0
- package/src/tests/fixtures.ts +6 -6
- package/artifacts/ContractClassRegisterer.json +0 -7219
- package/artifacts/ContractInstanceDeployer.json +0 -2984
- package/artifacts/Router.json +0 -3798
- package/dest/build_protocol_contract_tree.d.ts +0 -10
- package/dest/build_protocol_contract_tree.d.ts.map +0 -1
- package/dest/build_protocol_contract_tree.js +0 -20
- package/dest/class-registerer/contract_class_registered_event.d.ts +0 -18
- package/dest/class-registerer/contract_class_registered_event.d.ts.map +0 -1
- package/dest/class-registerer/index.d.ts +0 -8
- package/dest/class-registerer/index.d.ts.map +0 -1
- package/dest/class-registerer/index.js +0 -17
- package/dest/class-registerer/lazy.d.ts +0 -9
- package/dest/class-registerer/lazy.d.ts.map +0 -1
- package/dest/class-registerer/lazy.js +0 -26
- package/dest/class-registerer/private_function_broadcasted_event.d.ts +0 -46
- package/dest/class-registerer/private_function_broadcasted_event.d.ts.map +0 -1
- package/dest/class-registerer/unconstrained_function_broadcasted_event.d.ts +0 -40
- package/dest/class-registerer/unconstrained_function_broadcasted_event.d.ts.map +0 -1
- package/dest/instance-deployer/contract_instance_deployed_event.d.ts +0 -20
- package/dest/instance-deployer/contract_instance_deployed_event.d.ts.map +0 -1
- package/dest/instance-deployer/contract_instance_updated_event.d.ts +0 -16
- package/dest/instance-deployer/contract_instance_updated_event.d.ts.map +0 -1
- package/dest/instance-deployer/contract_instance_updated_event.js +0 -36
- package/dest/instance-deployer/index.d.ts +0 -7
- package/dest/instance-deployer/index.d.ts.map +0 -1
- package/dest/instance-deployer/index.js +0 -15
- package/dest/instance-deployer/lazy.d.ts +0 -8
- package/dest/instance-deployer/lazy.js +0 -25
- package/dest/protocol_contract_tree.d.ts +0 -7
- package/dest/protocol_contract_tree.d.ts.map +0 -1
- package/dest/protocol_contract_tree.js +0 -34
- package/dest/router/index.d.ts +0 -5
- package/dest/router/index.d.ts.map +0 -1
- package/dest/router/index.js +0 -13
- package/dest/router/lazy.d.ts +0 -6
- package/dest/router/lazy.d.ts.map +0 -1
- package/dest/router/lazy.js +0 -23
- package/src/build_protocol_contract_tree.ts +0 -29
- package/src/class-registerer/index.ts +0 -25
- package/src/class-registerer/lazy.ts +0 -33
- package/src/instance-deployer/index.ts +0 -23
- package/src/instance-deployer/lazy.ts +0 -32
- package/src/protocol_contract_tree.ts +0 -44
- package/src/router/lazy.ts +0 -29
- /package/artifacts/{ContractClassRegisterer.d.json.ts → ContractClassRegistry.d.json.ts} +0 -0
- /package/artifacts/{ContractInstanceDeployer.d.json.ts → ContractInstanceRegistry.d.json.ts} +0 -0
- /package/artifacts/{Router.d.json.ts → PublicChecks.d.json.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
import type { NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
3
3
|
|
|
4
|
-
import MultiCallEntrypointJson from '../../artifacts/MultiCallEntrypoint.json'
|
|
4
|
+
import MultiCallEntrypointJson from '../../artifacts/MultiCallEntrypoint.json' with { type: 'json' };
|
|
5
5
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
6
6
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
7
7
|
|
|
@@ -10,9 +10,9 @@ export const MultiCallEntrypointArtifact = loadContractArtifact(MultiCallEntrypo
|
|
|
10
10
|
let protocolContract: ProtocolContract;
|
|
11
11
|
|
|
12
12
|
/** Returns the canonical deployment of the contract. */
|
|
13
|
-
export
|
|
13
|
+
export function getCanonicalMultiCallEntrypoint(): Promise<ProtocolContract> {
|
|
14
14
|
if (!protocolContract) {
|
|
15
|
-
protocolContract =
|
|
15
|
+
protocolContract = makeProtocolContract('MultiCallEntrypoint', MultiCallEntrypointArtifact);
|
|
16
16
|
}
|
|
17
|
-
return protocolContract;
|
|
17
|
+
return Promise.resolve(protocolContract);
|
|
18
18
|
}
|
|
@@ -8,10 +8,10 @@ let protocolContractArtifact: ContractArtifact;
|
|
|
8
8
|
|
|
9
9
|
export async function getMultiCallEntrypointArtifact(): Promise<ContractArtifact> {
|
|
10
10
|
if (!protocolContractArtifact) {
|
|
11
|
-
// Cannot assert this import as it's incompatible with
|
|
12
|
-
// https://
|
|
13
|
-
//
|
|
14
|
-
//
|
|
11
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
12
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
13
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
14
|
+
// "text/javascript"
|
|
15
15
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
16
16
|
const { default: multiCallEntrypointJson } = await import('../../artifacts/MultiCallEntrypoint.json');
|
|
17
17
|
protocolContractArtifact = loadContractArtifact(multiCallEntrypointJson);
|
|
@@ -23,7 +23,7 @@ export async function getMultiCallEntrypointArtifact(): Promise<ContractArtifact
|
|
|
23
23
|
export async function getCanonicalMultiCallEntrypoint(): Promise<ProtocolContract> {
|
|
24
24
|
if (!protocolContract) {
|
|
25
25
|
const multiCallEntrypointArtifact = await getMultiCallEntrypointArtifact();
|
|
26
|
-
protocolContract =
|
|
26
|
+
protocolContract = makeProtocolContract('MultiCallEntrypoint', multiCallEntrypointArtifact);
|
|
27
27
|
}
|
|
28
28
|
return protocolContract;
|
|
29
29
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
|
|
2
2
|
// GENERATED FILE - DO NOT EDIT. RUN `yarn generate` or `yarn generate:data`
|
|
3
|
-
import { Fr } from '@aztec/foundation/
|
|
3
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
+
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
4
5
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
+
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
export const protocolContractNames = [
|
|
8
10
|
'AuthRegistry',
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
+
'ContractInstanceRegistry',
|
|
12
|
+
'ContractClassRegistry',
|
|
11
13
|
'MultiCallEntrypoint',
|
|
12
14
|
'FeeJuice',
|
|
13
|
-
'
|
|
15
|
+
'PublicChecks'
|
|
14
16
|
] as const;
|
|
15
17
|
|
|
16
18
|
export type ProtocolContractName = typeof protocolContractNames[number];
|
|
@@ -19,45 +21,117 @@
|
|
|
19
21
|
|
|
20
22
|
export const ProtocolContractSalt: Record<ProtocolContractName, Fr> = {
|
|
21
23
|
AuthRegistry: new Fr(1),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
ContractInstanceRegistry: new Fr(1),
|
|
25
|
+
ContractClassRegistry: new Fr(1),
|
|
24
26
|
MultiCallEntrypoint: new Fr(1),
|
|
25
27
|
FeeJuice: new Fr(1),
|
|
26
|
-
|
|
28
|
+
PublicChecks: new Fr(1)
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
|
|
31
33
|
export const ProtocolContractAddress: Record<ProtocolContractName, AztecAddress> = {
|
|
32
34
|
AuthRegistry: AztecAddress.fromBigInt(1n),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
ContractInstanceRegistry: AztecAddress.fromBigInt(2n),
|
|
36
|
+
ContractClassRegistry: AztecAddress.fromBigInt(3n),
|
|
35
37
|
MultiCallEntrypoint: AztecAddress.fromBigInt(4n),
|
|
36
38
|
FeeJuice: AztecAddress.fromBigInt(5n),
|
|
37
|
-
|
|
39
|
+
PublicChecks: AztecAddress.fromBigInt(6n)
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
|
|
41
43
|
|
|
42
|
-
export const
|
|
43
|
-
AuthRegistry:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
MultiCallEntrypoint:
|
|
47
|
-
FeeJuice:
|
|
48
|
-
|
|
44
|
+
export const ProtocolContractDerivedAddress = {
|
|
45
|
+
AuthRegistry: AztecAddress.fromString('0x09c8a09596c929e5de31974d4dd4860eb2026c55049049dfb6d9d6b3e3746f6a'),
|
|
46
|
+
ContractInstanceRegistry: AztecAddress.fromString('0x22386fb447ebce0f427e15bb437538db7e16c4b8c07a099cbd8d46a7c6e40d0e'),
|
|
47
|
+
ContractClassRegistry: AztecAddress.fromString('0x071ff7f82ab52af87c4c0e59fc9d40a87e037a4ddf0ff91023723a612507db6d'),
|
|
48
|
+
MultiCallEntrypoint: AztecAddress.fromString('0x2412c70062c4008d0443b831c0acace57116a50444e970704f080b885fc77af1'),
|
|
49
|
+
FeeJuice: AztecAddress.fromString('0x304dbe6918292846f019fa304efee2f984ab54d159034173e672a9929e9d47a5'),
|
|
50
|
+
PublicChecks: AztecAddress.fromString('0x0b14ac0c8027668240350e9bb8a72b55214fc0b6d8c6a9c88f10bde7b09e7afc')
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
|
|
52
54
|
|
|
53
|
-
export const
|
|
55
|
+
export const ProtocolContractClassId: Record<ProtocolContractName, Fr> = {
|
|
56
|
+
AuthRegistry: Fr.fromString('0x13a3db24f5f462c3cd89ea23f4acd36051440ac98144d298cd1865cd867f1b5a'),
|
|
57
|
+
ContractInstanceRegistry: Fr.fromString('0x09b7b1114eb9aceeaddeaeb64a28f6aeea476148b59b1132a590108555f59993'),
|
|
58
|
+
ContractClassRegistry: Fr.fromString('0x2205b1885eaa2efe3ddf7e4644db142cd4211070bdf474621e7812b12fa31956'),
|
|
59
|
+
MultiCallEntrypoint: Fr.fromString('0x0dc7fac30e0a20648980dff08ad3078284db64722468b135d3e0544f16aaef7a'),
|
|
60
|
+
FeeJuice: Fr.fromString('0x223e5babff493c0ff3f2b3917754359696220b0cbec275079585ff4ea8e838a6'),
|
|
61
|
+
PublicChecks: Fr.fromString('0x2eea7cd6ae7a666c535570d9bef3e0074eafd9fe2c17c1305f658286bcdcdf80')
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const ProtocolContractClassIdPreimage: Record<ProtocolContractName, { artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }> = {
|
|
65
|
+
AuthRegistry: {
|
|
66
|
+
artifactHash: Fr.fromString('0x0df932933123adf0691a460cec66a5b178751b54a636aa9b2e08947b4b14ed54'),
|
|
67
|
+
privateFunctionsRoot: Fr.fromString('0x11900a485e3ffa03da98d89abb0c9419200644aaf17f5caa863953fccf1ed88f'),
|
|
68
|
+
publicBytecodeCommitment: Fr.fromString('0x273e5247744c970249667a6c7a843323211bdaa8d8b257e763d2ff3b6a9971f0'),
|
|
69
|
+
},
|
|
70
|
+
ContractInstanceRegistry: {
|
|
71
|
+
artifactHash: Fr.fromString('0x109a0eaac50d7676632208084aa69f3b294531e04e76b75d246f7e5315569352'),
|
|
72
|
+
privateFunctionsRoot: Fr.fromString('0x136a6705c7ad1d47f65cb881a56909d4c78d3fa8944f5b103734cd91e654ed63'),
|
|
73
|
+
publicBytecodeCommitment: Fr.fromString('0x1d40fc843cc358dc36f3646e376b190e36a2a1090acd2d7578918e84aa1d40c3'),
|
|
74
|
+
},
|
|
75
|
+
ContractClassRegistry: {
|
|
76
|
+
artifactHash: Fr.fromString('0x265eec6019f7d778c5d52701009053a6f38aba6813fe4be7b13d7527cf363081'),
|
|
77
|
+
privateFunctionsRoot: Fr.fromString('0x2ac3bf890a7d534a768079aa86889caa1a86373c8e6fc2db48215b11bbb79106'),
|
|
78
|
+
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
79
|
+
},
|
|
80
|
+
MultiCallEntrypoint: {
|
|
81
|
+
artifactHash: Fr.fromString('0x2056b21e3fd345dc353e05a273fe31dd06ed67e59faaf16e264e4a1fd7e2f596'),
|
|
82
|
+
privateFunctionsRoot: Fr.fromString('0x266505ecb7c02ce6e227227c0b6bdb44713c8ecd43164ee7bb00b8fb340e8b03'),
|
|
83
|
+
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
84
|
+
},
|
|
85
|
+
FeeJuice: {
|
|
86
|
+
artifactHash: Fr.fromString('0x13afeaff15ebd30235f8e465a0f45e8c89f6de79980a4e00cf864304b69e163e'),
|
|
87
|
+
privateFunctionsRoot: Fr.fromString('0x0abef3cfc6ae314886c841b42dc33d3eed255ad3dee7773daabf05b229573759'),
|
|
88
|
+
publicBytecodeCommitment: Fr.fromString('0x24c51926e5946d4ab6bc111b0f6a30690d25817f983948fa10a3ce0434cb0419'),
|
|
89
|
+
},
|
|
90
|
+
PublicChecks: {
|
|
91
|
+
artifactHash: Fr.fromString('0x2a23e0ac8db7583eeab97163992978cd24b8a272e4e5862b3e909be1aa8723ec'),
|
|
92
|
+
privateFunctionsRoot: Fr.fromString('0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1'),
|
|
93
|
+
publicBytecodeCommitment: Fr.fromString('0x1fb8fae63fa9e9f34dda88dc2ed06e32fb225f7e8228a1bfb3411c3eed9364e9'),
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const ProtocolContractInitializationHash: Record<ProtocolContractName, Fr> = {
|
|
98
|
+
AuthRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
99
|
+
ContractInstanceRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
100
|
+
ContractClassRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
101
|
+
MultiCallEntrypoint: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
102
|
+
FeeJuice: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
103
|
+
PublicChecks: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const ProtocolContractPrivateFunctions: Record<ProtocolContractName, { selector: FunctionSelector; vkHash: Fr }[]> = {
|
|
107
|
+
AuthRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000079a3d418')), vkHash: Fr.fromString('0x185a64e85b31ece67103f33ec67ddef374308c0a5dc2b7f37e016bca0dce63fb') }],
|
|
108
|
+
ContractInstanceRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000016ec12aa')), vkHash: Fr.fromString('0x262f7a90ecf055779001b67dad01a3add1e549f6c27931f0e71e463ce2142b57') }],
|
|
109
|
+
ContractClassRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x000000000000000000000000000000000000000000000000000000006934ed0d')), vkHash: Fr.fromString('0x1163f31e191528254c877fce0c7f62dd738f5552bbd2dda97512fe4777377f5b') }],
|
|
110
|
+
MultiCallEntrypoint: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000f04908a9')), vkHash: Fr.fromString('0x21732ab3cecf633e4c31a030df62c93e35a005b89941fdab568d2818c1355192') }],
|
|
111
|
+
FeeJuice: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000cbe67243')), vkHash: Fr.fromString('0x2ad6083b4595f8076c014e5152191013167ab1b5a31ad0cbb06490054c7c59ae') }, { selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000e8d374b6')), vkHash: Fr.fromString('0x05aaffffdf797625ff24575d939339303775c5db77fb6bdcecbf955f726fd071') }],
|
|
112
|
+
PublicChecks: []
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
export const ProtocolContractsList = new ProtocolContracts([
|
|
118
|
+
AztecAddress.fromString('0x09c8a09596c929e5de31974d4dd4860eb2026c55049049dfb6d9d6b3e3746f6a'),
|
|
119
|
+
AztecAddress.fromString('0x22386fb447ebce0f427e15bb437538db7e16c4b8c07a099cbd8d46a7c6e40d0e'),
|
|
120
|
+
AztecAddress.fromString('0x071ff7f82ab52af87c4c0e59fc9d40a87e037a4ddf0ff91023723a612507db6d'),
|
|
121
|
+
AztecAddress.fromString('0x2412c70062c4008d0443b831c0acace57116a50444e970704f080b885fc77af1'),
|
|
122
|
+
AztecAddress.fromString('0x304dbe6918292846f019fa304efee2f984ab54d159034173e672a9929e9d47a5'),
|
|
123
|
+
AztecAddress.fromString('0x0b14ac0c8027668240350e9bb8a72b55214fc0b6d8c6a9c88f10bde7b09e7afc'),
|
|
124
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
125
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
126
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
127
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
128
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
129
|
+
]);
|
|
130
|
+
|
|
131
|
+
export const protocolContractsHash = Fr.fromString('0x1d24f6da588c88ec4359c598356e13878ab7f45350d4d099b5a87a9f9b7adc87');
|
|
54
132
|
|
|
55
133
|
|
|
56
134
|
|
|
57
|
-
export const
|
|
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);
|
|
135
|
+
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('0x1a7e1badb79abdd38c684b3c8306ffe7ecb33c69e3380d9855730aaaa83a21a8');
|
|
62
136
|
|
|
63
137
|
|
package/src/provider/bundle.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
|
|
3
3
|
import { AuthRegistryArtifact } from '../auth-registry/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { ContractClassRegistryArtifact } from '../class-registry/index.js';
|
|
5
5
|
import { FeeJuiceArtifact } from '../fee-juice/index.js';
|
|
6
|
-
import {
|
|
6
|
+
import { ContractInstanceRegistryArtifact } from '../instance-registry/index.js';
|
|
7
7
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
8
8
|
import { MultiCallEntrypointArtifact } from '../multi-call-entrypoint/index.js';
|
|
9
9
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
10
10
|
import type { ProtocolContractName } from '../protocol_contract_data.js';
|
|
11
|
-
import {
|
|
11
|
+
import { PublicChecksArtifact } from '../public-checks/index.js';
|
|
12
12
|
import type { ProtocolContractsProvider } from './protocol_contracts_provider.js';
|
|
13
13
|
|
|
14
14
|
export const ProtocolContractArtifact: Record<ProtocolContractName, ContractArtifact> = {
|
|
15
15
|
AuthRegistry: AuthRegistryArtifact,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
ContractInstanceRegistry: ContractInstanceRegistryArtifact,
|
|
17
|
+
ContractClassRegistry: ContractClassRegistryArtifact,
|
|
18
18
|
MultiCallEntrypoint: MultiCallEntrypointArtifact,
|
|
19
19
|
FeeJuice: FeeJuiceArtifact,
|
|
20
|
-
|
|
20
|
+
PublicChecks: PublicChecksArtifact,
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export class BundledProtocolContractsProvider implements ProtocolContractsProvider {
|
|
24
24
|
getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract> {
|
|
25
|
-
return makeProtocolContract(name, ProtocolContractArtifact[name]);
|
|
25
|
+
return Promise.resolve(makeProtocolContract(name, ProtocolContractArtifact[name]));
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/provider/lazy.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getCanonicalAuthRegistry } from '../auth-registry/lazy.js';
|
|
2
|
-
import {
|
|
2
|
+
import { getCanonicalClassRegistry } from '../class-registry/lazy.js';
|
|
3
3
|
import { getCanonicalFeeJuice } from '../fee-juice/lazy.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getCanonicalInstanceRegistry } from '../instance-registry/lazy.js';
|
|
5
5
|
import { getCanonicalMultiCallEntrypoint } from '../multi-call-entrypoint/lazy.js';
|
|
6
6
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
7
7
|
import type { ProtocolContractName } from '../protocol_contract_data.js';
|
|
8
|
-
import {
|
|
8
|
+
import { getCanonicalPublicChecks } from '../public-checks/lazy.js';
|
|
9
9
|
import type { ProtocolContractsProvider } from './protocol_contracts_provider.js';
|
|
10
10
|
|
|
11
11
|
export class LazyProtocolContractsProvider implements ProtocolContractsProvider {
|
|
@@ -13,16 +13,16 @@ export class LazyProtocolContractsProvider implements ProtocolContractsProvider
|
|
|
13
13
|
switch (name) {
|
|
14
14
|
case 'AuthRegistry':
|
|
15
15
|
return getCanonicalAuthRegistry();
|
|
16
|
-
case '
|
|
17
|
-
return
|
|
18
|
-
case '
|
|
19
|
-
return
|
|
16
|
+
case 'ContractInstanceRegistry':
|
|
17
|
+
return getCanonicalInstanceRegistry();
|
|
18
|
+
case 'ContractClassRegistry':
|
|
19
|
+
return getCanonicalClassRegistry();
|
|
20
20
|
case 'MultiCallEntrypoint':
|
|
21
21
|
return getCanonicalMultiCallEntrypoint();
|
|
22
22
|
case 'FeeJuice':
|
|
23
23
|
return getCanonicalFeeJuice();
|
|
24
|
-
case '
|
|
25
|
-
return
|
|
24
|
+
case 'PublicChecks':
|
|
25
|
+
return getCanonicalPublicChecks();
|
|
26
26
|
default:
|
|
27
27
|
throw new Error(`Unknown protocol contract name: ${name}`);
|
|
28
28
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
import type { NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import PublicChecksJson from '../../artifacts/PublicChecks.json' with { type: 'json' };
|
|
5
5
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
6
6
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
7
7
|
|
|
8
|
-
export const
|
|
8
|
+
export const PublicChecksArtifact = loadContractArtifact(PublicChecksJson as NoirCompiledContract);
|
|
9
9
|
|
|
10
10
|
let protocolContract: ProtocolContract;
|
|
11
11
|
|
|
12
12
|
/** Returns the canonical deployment of the contract. */
|
|
13
|
-
export
|
|
13
|
+
export function getCanonicalPublicChecks(): Promise<ProtocolContract> {
|
|
14
14
|
if (!protocolContract) {
|
|
15
|
-
protocolContract =
|
|
15
|
+
protocolContract = makeProtocolContract('PublicChecks', PublicChecksArtifact);
|
|
16
16
|
}
|
|
17
|
-
return protocolContract;
|
|
17
|
+
return Promise.resolve(protocolContract);
|
|
18
18
|
}
|
|
@@ -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 getPublicChecksArtifact(): Promise<ContractArtifact> {
|
|
10
|
+
if (!protocolContractArtifact) {
|
|
11
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
12
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
13
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
14
|
+
// "text/javascript"
|
|
15
|
+
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
16
|
+
const { default: publicChecksJson } = await import('../../artifacts/PublicChecks.json');
|
|
17
|
+
protocolContractArtifact = loadContractArtifact(publicChecksJson);
|
|
18
|
+
}
|
|
19
|
+
return protocolContractArtifact;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Returns the canonical deployment of the public checks contract. */
|
|
23
|
+
export async function getCanonicalPublicChecks(): Promise<ProtocolContract> {
|
|
24
|
+
if (!protocolContract) {
|
|
25
|
+
const publicChecksArtifact = await getPublicChecksArtifact();
|
|
26
|
+
protocolContract = makeProtocolContract('PublicChecks', publicChecksArtifact);
|
|
27
|
+
}
|
|
28
|
+
return protocolContract;
|
|
29
|
+
}
|
package/src/tests/fixtures.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { dirname, resolve } from 'path';
|
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
|
|
5
5
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
6
|
-
export function
|
|
7
|
-
const path = getPathToFixture('
|
|
6
|
+
export function getSampleContractClassPublishedEventPayload(): Buffer {
|
|
7
|
+
const path = getPathToFixture('ContractClassPublishedEventData.hex');
|
|
8
8
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -15,14 +15,14 @@ export function getSamplePrivateFunctionBroadcastedEventPayload(): Buffer {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
18
|
-
export function
|
|
19
|
-
const path = getPathToFixture('
|
|
18
|
+
export function getSampleUtilityFunctionBroadcastedEventPayload(): Buffer {
|
|
19
|
+
const path = getPathToFixture('UtilityFunctionBroadcastedEventData.hex');
|
|
20
20
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
24
|
-
export function
|
|
25
|
-
const path = getPathToFixture('
|
|
24
|
+
export function getSampleContractInstancePublishedEventPayload(): Buffer {
|
|
25
|
+
const path = getPathToFixture('ContractInstancePublishedEventData.hex');
|
|
26
26
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
27
27
|
}
|
|
28
28
|
|