@aztec/protocol-contracts 0.0.1-commit.fce3e4f → 0.0.1-commit.ffe5b04ea
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 +1161 -1195
- package/artifacts/ContractClassRegistry.json +805 -5418
- package/artifacts/ContractInstanceRegistry.json +982 -1662
- package/artifacts/FeeJuice.json +1626 -2279
- package/artifacts/MultiCallEntrypoint.json +1168 -1123
- package/artifacts/PublicChecks.json +1000 -0
- package/dest/auth-registry/index.d.ts +1 -1
- package/dest/auth-registry/index.d.ts.map +1 -1
- package/dest/auth-registry/index.js +3 -3
- package/dest/auth-registry/lazy.js +1 -1
- package/dest/class-registry/contract_class_published_event.d.ts +2 -2
- package/dest/class-registry/contract_class_published_event.d.ts.map +1 -1
- package/dest/class-registry/contract_class_published_event.js +1 -1
- package/dest/class-registry/index.d.ts +1 -1
- package/dest/class-registry/index.d.ts.map +1 -1
- package/dest/class-registry/index.js +3 -3
- package/dest/class-registry/lazy.js +1 -1
- package/dest/class-registry/private_function_broadcasted_event.d.ts +6 -2
- package/dest/class-registry/private_function_broadcasted_event.d.ts.map +1 -1
- package/dest/class-registry/utility_function_broadcasted_event.d.ts +5 -2
- package/dest/class-registry/utility_function_broadcasted_event.d.ts.map +1 -1
- package/dest/class-registry/utility_function_broadcasted_event.js +1 -1
- 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 +3 -3
- package/dest/fee-juice/lazy.js +1 -1
- package/dest/instance-registry/contract_instance_published_event.d.ts +2 -2
- package/dest/instance-registry/contract_instance_published_event.d.ts.map +1 -1
- package/dest/instance-registry/contract_instance_published_event.js +1 -1
- package/dest/instance-registry/contract_instance_updated_event.d.ts +2 -2
- package/dest/instance-registry/contract_instance_updated_event.d.ts.map +1 -1
- package/dest/instance-registry/index.d.ts +1 -1
- package/dest/instance-registry/index.d.ts.map +1 -1
- package/dest/instance-registry/index.js +3 -3
- package/dest/instance-registry/lazy.js +1 -1
- 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 +3 -3
- package/dest/multi-call-entrypoint/lazy.js +1 -1
- package/dest/protocol_contract_data.d.ts +16 -4
- package/dest/protocol_contract_data.d.ts.map +1 -1
- package/dest/protocol_contract_data.js +104 -18
- package/dest/provider/bundle.js +3 -3
- package/dest/provider/lazy.js +3 -3
- 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/{router → public-checks}/lazy.js +6 -6
- package/dest/scripts/generate_data.js +74 -25
- package/package.json +9 -9
- package/src/auth-registry/index.ts +3 -3
- package/src/auth-registry/lazy.ts +1 -1
- package/src/class-registry/contract_class_published_event.ts +2 -2
- package/src/class-registry/index.ts +3 -3
- package/src/class-registry/lazy.ts +1 -1
- package/src/class-registry/private_function_broadcasted_event.ts +1 -1
- package/src/class-registry/utility_function_broadcasted_event.ts +1 -1
- package/src/fee-juice/index.ts +4 -4
- package/src/fee-juice/lazy.ts +1 -1
- package/src/instance-registry/contract_instance_published_event.ts +1 -1
- package/src/instance-registry/contract_instance_updated_event.ts +1 -1
- package/src/instance-registry/index.ts +3 -3
- package/src/instance-registry/lazy.ts +1 -1
- package/src/make_protocol_contract.ts +37 -15
- package/src/multi-call-entrypoint/index.ts +3 -3
- package/src/multi-call-entrypoint/lazy.ts +1 -1
- package/src/protocol_contract_data.ts +81 -18
- package/src/provider/bundle.ts +3 -3
- package/src/provider/lazy.ts +3 -3
- package/src/{router → public-checks}/index.ts +5 -5
- package/src/{router → public-checks}/lazy.ts +7 -7
- package/artifacts/Router.json +0 -959
- 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/artifacts/{Router.d.json.ts → PublicChecks.d.json.ts} +0 -0
|
@@ -15,9 +15,9 @@ export const ContractInstanceRegistryArtifact = loadContractArtifact(
|
|
|
15
15
|
let protocolContract: ProtocolContract;
|
|
16
16
|
|
|
17
17
|
/** Returns the canonical deployment of the contract. */
|
|
18
|
-
export
|
|
18
|
+
export function getCanonicalInstanceRegistry(): Promise<ProtocolContract> {
|
|
19
19
|
if (!protocolContract) {
|
|
20
|
-
protocolContract =
|
|
20
|
+
protocolContract = makeProtocolContract('ContractInstanceRegistry', ContractInstanceRegistryArtifact);
|
|
21
21
|
}
|
|
22
|
-
return protocolContract;
|
|
22
|
+
return Promise.resolve(protocolContract);
|
|
23
23
|
}
|
|
@@ -26,7 +26,7 @@ export async function getContractInstanceRegistryArtifact(): Promise<ContractArt
|
|
|
26
26
|
export async function getCanonicalInstanceRegistry(): Promise<ProtocolContract> {
|
|
27
27
|
if (!protocolContract) {
|
|
28
28
|
const contractInstanceRegistryArtifact = await getContractInstanceRegistryArtifact();
|
|
29
|
-
protocolContract =
|
|
29
|
+
protocolContract = makeProtocolContract('ContractInstanceRegistry', contractInstanceRegistryArtifact);
|
|
30
30
|
}
|
|
31
31
|
return protocolContract;
|
|
32
32
|
}
|
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
-
import {
|
|
2
|
+
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
3
3
|
|
|
4
4
|
import type { ProtocolContract } from './protocol_contract.js';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
ProtocolContractAddress,
|
|
7
|
+
ProtocolContractClassId,
|
|
8
|
+
ProtocolContractClassIdPreimage,
|
|
9
|
+
ProtocolContractInitializationHash,
|
|
10
|
+
type ProtocolContractName,
|
|
11
|
+
ProtocolContractPrivateFunctions,
|
|
12
|
+
ProtocolContractSalt,
|
|
13
|
+
} from './protocol_contract_data.js';
|
|
6
14
|
|
|
7
15
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
16
|
+
* Reconstructs a ProtocolContract from precomputed data without performing any hash computations.
|
|
17
|
+
* Internal to the protocol-contracts package — not part of the public API.
|
|
10
18
|
*/
|
|
11
|
-
export
|
|
12
|
-
name: ProtocolContractName,
|
|
13
|
-
artifact: ContractArtifact,
|
|
14
|
-
): Promise<ProtocolContract> {
|
|
19
|
+
export function makeProtocolContract(name: ProtocolContractName, artifact: ContractArtifact): ProtocolContract {
|
|
15
20
|
const address = ProtocolContractAddress[name];
|
|
16
21
|
const salt = ProtocolContractSalt[name];
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const classId = ProtocolContractClassId[name];
|
|
23
|
+
const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment } = ProtocolContractClassIdPreimage[name];
|
|
24
|
+
const initializationHash = ProtocolContractInitializationHash[name];
|
|
25
|
+
|
|
26
|
+
const contractClass = {
|
|
27
|
+
id: classId,
|
|
28
|
+
version: 1 as const,
|
|
29
|
+
artifactHash,
|
|
30
|
+
privateFunctionsRoot,
|
|
31
|
+
publicBytecodeCommitment,
|
|
32
|
+
packedBytecode: artifact.functions.find(f => f.name === 'public_dispatch')?.bytecode ?? Buffer.alloc(0),
|
|
33
|
+
privateFunctions: ProtocolContractPrivateFunctions[name],
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const instance = {
|
|
37
|
+
version: 1 as const,
|
|
38
|
+
currentContractClassId: classId,
|
|
39
|
+
originalContractClassId: classId,
|
|
40
|
+
initializationHash,
|
|
41
|
+
publicKeys: PublicKeys.default(),
|
|
42
|
+
salt,
|
|
43
|
+
deployer: address,
|
|
24
44
|
address,
|
|
25
45
|
};
|
|
46
|
+
|
|
47
|
+
return { instance, contractClass, artifact, address };
|
|
26
48
|
}
|
|
@@ -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
|
}
|
|
@@ -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,6 +1,7 @@
|
|
|
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';
|
|
5
6
|
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
6
7
|
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
'ContractClassRegistry',
|
|
12
13
|
'MultiCallEntrypoint',
|
|
13
14
|
'FeeJuice',
|
|
14
|
-
'
|
|
15
|
+
'PublicChecks'
|
|
15
16
|
] as const;
|
|
16
17
|
|
|
17
18
|
export type ProtocolContractName = typeof protocolContractNames[number];
|
|
@@ -24,7 +25,7 @@ ContractInstanceRegistry: new Fr(1),
|
|
|
24
25
|
ContractClassRegistry: new Fr(1),
|
|
25
26
|
MultiCallEntrypoint: new Fr(1),
|
|
26
27
|
FeeJuice: new Fr(1),
|
|
27
|
-
|
|
28
|
+
PublicChecks: new Fr(1)
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
|
|
@@ -35,29 +36,91 @@ ContractInstanceRegistry: AztecAddress.fromBigInt(2n),
|
|
|
35
36
|
ContractClassRegistry: AztecAddress.fromBigInt(3n),
|
|
36
37
|
MultiCallEntrypoint: AztecAddress.fromBigInt(4n),
|
|
37
38
|
FeeJuice: AztecAddress.fromBigInt(5n),
|
|
38
|
-
|
|
39
|
+
PublicChecks: AztecAddress.fromBigInt(6n)
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
export const ProtocolContractDerivedAddress = {
|
|
44
|
-
AuthRegistry: AztecAddress.fromString('
|
|
45
|
-
ContractInstanceRegistry: AztecAddress.fromString('
|
|
46
|
-
ContractClassRegistry: AztecAddress.fromString('
|
|
47
|
-
MultiCallEntrypoint: AztecAddress.fromString('
|
|
48
|
-
FeeJuice: AztecAddress.fromString('
|
|
49
|
-
|
|
45
|
+
AuthRegistry: AztecAddress.fromString('0x06c7f95239f8000261de312d9513021e0cd59ae0f0de86d89375572799adadcf'),
|
|
46
|
+
ContractInstanceRegistry: AztecAddress.fromString('0x2436a1d64e15c142d46711ac9454523d36b6fa6eac494f5582f8b25c031e1489'),
|
|
47
|
+
ContractClassRegistry: AztecAddress.fromString('0x2113f3e0335fe6fb46e6ecec2858b415ca04bae873e2893ae6c45b65ce686af1'),
|
|
48
|
+
MultiCallEntrypoint: AztecAddress.fromString('0x19e23cc3ca3a51cc67ccf3a154e7565ff9fdcd2e06128ad7a8ceebf4aae7e41d'),
|
|
49
|
+
FeeJuice: AztecAddress.fromString('0x14d0ab965abe4770e06a821e36f57affa4bb81ca050f66b9010098818154f04f'),
|
|
50
|
+
PublicChecks: AztecAddress.fromString('0x1e7906ea624d5cc6395848408fc9dafeb89e69cb7a0329d622c9907b6fa5b113')
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
export const ProtocolContractClassId: Record<ProtocolContractName, Fr> = {
|
|
56
|
+
AuthRegistry: Fr.fromString('0x2228d1c5f3d032fc81ef464b9d342626aaf47d77920b85bff4577919b4cbd02e'),
|
|
57
|
+
ContractInstanceRegistry: Fr.fromString('0x23a132ac4f0efe1476b2b5f144afdbc2f383ef12cf5982f68185f4d921802912'),
|
|
58
|
+
ContractClassRegistry: Fr.fromString('0x2c053725122e23b1cf21cf781b0de4d2a2de5dd1cad4ccacf287d87c5918a794'),
|
|
59
|
+
MultiCallEntrypoint: Fr.fromString('0x05298623a4d6a1a9cb57e707ac550845da938eb6e2977f50d6442925b2a370d3'),
|
|
60
|
+
FeeJuice: Fr.fromString('0x1957b2b25fecce952a7f8058275778302c2647793d6adedc6969586a0ce73c43'),
|
|
61
|
+
PublicChecks: Fr.fromString('0x27d10a145494aa34c35df4a526edffdb7b0ac10bb8dfe45be7143919d70d21cc')
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const ProtocolContractClassIdPreimage: Record<ProtocolContractName, { artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }> = {
|
|
65
|
+
AuthRegistry: {
|
|
66
|
+
artifactHash: Fr.fromString('0x2b9451d83da1a8887f9485e0627d570f6205fc37745914965994277d25ed0040'),
|
|
67
|
+
privateFunctionsRoot: Fr.fromString('0x11900a485e3ffa03da98d89abb0c9419200644aaf17f5caa863953fccf1ed88f'),
|
|
68
|
+
publicBytecodeCommitment: Fr.fromString('0x1765c0a2af421f31ebfa03f11cd3ae7fb6a8b41c3128375e2b0b0c30cf493975'),
|
|
69
|
+
},
|
|
70
|
+
ContractInstanceRegistry: {
|
|
71
|
+
artifactHash: Fr.fromString('0x252b9830d6ea67290fa5ab0308a67889ba888e75ae30ad2fff311e806c4e624e'),
|
|
72
|
+
privateFunctionsRoot: Fr.fromString('0x136a6705c7ad1d47f65cb881a56909d4c78d3fa8944f5b103734cd91e654ed63'),
|
|
73
|
+
publicBytecodeCommitment: Fr.fromString('0x1b34b6572f6b7e6d8b4ea5f3bc7a6b67a30e98bbc2e03f686fc7541ffb267b71'),
|
|
74
|
+
},
|
|
75
|
+
ContractClassRegistry: {
|
|
76
|
+
artifactHash: Fr.fromString('0x2a954f0df191b1b7ba692629552e1fe13b1038bc72ccd23d5125dffe58bc58b4'),
|
|
77
|
+
privateFunctionsRoot: Fr.fromString('0x2ac3bf890a7d534a768079aa86889caa1a86373c8e6fc2db48215b11bbb79106'),
|
|
78
|
+
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
79
|
+
},
|
|
80
|
+
MultiCallEntrypoint: {
|
|
81
|
+
artifactHash: Fr.fromString('0x13dc94c40802b063a4790ca4ba45f7fe6196fca741b243e815692688228ddfb5'),
|
|
82
|
+
privateFunctionsRoot: Fr.fromString('0x266505ecb7c02ce6e227227c0b6bdb44713c8ecd43164ee7bb00b8fb340e8b03'),
|
|
83
|
+
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
84
|
+
},
|
|
85
|
+
FeeJuice: {
|
|
86
|
+
artifactHash: Fr.fromString('0x16ad3120660333d9b612229be7d62953021fdb3129a5a8092c70844a8fb9a0ff'),
|
|
87
|
+
privateFunctionsRoot: Fr.fromString('0x0abef3cfc6ae314886c841b42dc33d3eed255ad3dee7773daabf05b229573759'),
|
|
88
|
+
publicBytecodeCommitment: Fr.fromString('0x022c20c2d96794f3254446d85c553e0b768e77e877d100a9fdf2a7778e27e333'),
|
|
89
|
+
},
|
|
90
|
+
PublicChecks: {
|
|
91
|
+
artifactHash: Fr.fromString('0x22525f017e57bd13c28177789a541adc525089b1e9a185ff728221ee6b69108a'),
|
|
92
|
+
privateFunctionsRoot: Fr.fromString('0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1'),
|
|
93
|
+
publicBytecodeCommitment: Fr.fromString('0x2425ba7086fdf347931ff0f487610b980fd0ad716f7631a51cef39190c3a6709'),
|
|
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: []
|
|
50
113
|
};
|
|
51
114
|
|
|
52
115
|
|
|
53
116
|
|
|
54
117
|
export const ProtocolContractsList = new ProtocolContracts([
|
|
55
|
-
AztecAddress.fromString('
|
|
56
|
-
AztecAddress.fromString('
|
|
57
|
-
AztecAddress.fromString('
|
|
58
|
-
AztecAddress.fromString('
|
|
59
|
-
AztecAddress.fromString('
|
|
60
|
-
AztecAddress.fromString('
|
|
118
|
+
AztecAddress.fromString('0x06c7f95239f8000261de312d9513021e0cd59ae0f0de86d89375572799adadcf'),
|
|
119
|
+
AztecAddress.fromString('0x2436a1d64e15c142d46711ac9454523d36b6fa6eac494f5582f8b25c031e1489'),
|
|
120
|
+
AztecAddress.fromString('0x2113f3e0335fe6fb46e6ecec2858b415ca04bae873e2893ae6c45b65ce686af1'),
|
|
121
|
+
AztecAddress.fromString('0x19e23cc3ca3a51cc67ccf3a154e7565ff9fdcd2e06128ad7a8ceebf4aae7e41d'),
|
|
122
|
+
AztecAddress.fromString('0x14d0ab965abe4770e06a821e36f57affa4bb81ca050f66b9010098818154f04f'),
|
|
123
|
+
AztecAddress.fromString('0x1e7906ea624d5cc6395848408fc9dafeb89e69cb7a0329d622c9907b6fa5b113'),
|
|
61
124
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
62
125
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
63
126
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
@@ -65,10 +128,10 @@ AztecAddress.fromString('0x00000000000000000000000000000000000000000000000000000
|
|
|
65
128
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
66
129
|
]);
|
|
67
130
|
|
|
68
|
-
export const protocolContractsHash = Fr.fromString('
|
|
131
|
+
export const protocolContractsHash = Fr.fromString('0x0e0f38d4c5646612ac162168852b5e09091e1749d5ddb0dce645f2453b95237d');
|
|
69
132
|
|
|
70
133
|
|
|
71
134
|
|
|
72
|
-
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('
|
|
135
|
+
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('0x1a7e1badb79abdd38c684b3c8306ffe7ecb33c69e3380d9855730aaaa83a21a8');
|
|
73
136
|
|
|
74
137
|
|
package/src/provider/bundle.ts
CHANGED
|
@@ -8,7 +8,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> = {
|
|
@@ -17,11 +17,11 @@ export const ProtocolContractArtifact: Record<ProtocolContractName, ContractArti
|
|
|
17
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
|
@@ -5,7 +5,7 @@ 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 {
|
|
@@ -21,8 +21,8 @@ export class LazyProtocolContractsProvider implements ProtocolContractsProvider
|
|
|
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
|
}
|
|
@@ -6,24 +6,24 @@ import type { ProtocolContract } from '../protocol_contract.js';
|
|
|
6
6
|
let protocolContract: ProtocolContract;
|
|
7
7
|
let protocolContractArtifact: ContractArtifact;
|
|
8
8
|
|
|
9
|
-
export async function
|
|
9
|
+
export async function getPublicChecksArtifact(): Promise<ContractArtifact> {
|
|
10
10
|
if (!protocolContractArtifact) {
|
|
11
11
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
12
12
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
13
13
|
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
14
14
|
// "text/javascript"
|
|
15
15
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
16
|
-
const { default:
|
|
17
|
-
protocolContractArtifact = loadContractArtifact(
|
|
16
|
+
const { default: publicChecksJson } = await import('../../artifacts/PublicChecks.json');
|
|
17
|
+
protocolContractArtifact = loadContractArtifact(publicChecksJson);
|
|
18
18
|
}
|
|
19
19
|
return protocolContractArtifact;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
/** Returns the canonical deployment of the
|
|
23
|
-
export async function
|
|
22
|
+
/** Returns the canonical deployment of the public checks contract. */
|
|
23
|
+
export async function getCanonicalPublicChecks(): Promise<ProtocolContract> {
|
|
24
24
|
if (!protocolContract) {
|
|
25
|
-
const
|
|
26
|
-
protocolContract =
|
|
25
|
+
const publicChecksArtifact = await getPublicChecksArtifact();
|
|
26
|
+
protocolContract = makeProtocolContract('PublicChecks', publicChecksArtifact);
|
|
27
27
|
}
|
|
28
28
|
return protocolContract;
|
|
29
29
|
}
|