@aztec/protocol-contracts 0.0.1-commit.9ef841308 → 0.0.1-commit.a4600f49
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/ContractClassRegistry.json +2615 -2431
- package/artifacts/ContractInstanceRegistry.json +3772 -3961
- package/artifacts/FeeJuice.json +5052 -4979
- package/dest/class-registry/contract_class_published_event.d.ts +1 -1
- package/dest/class-registry/contract_class_published_event.d.ts.map +1 -1
- package/dest/class-registry/contract_class_published_event.js +7 -1
- package/dest/class-registry/lazy.js +1 -1
- package/dest/fee-juice/lazy.js +1 -1
- package/dest/instance-registry/contract_instance_published_event.d.ts +3 -2
- package/dest/instance-registry/contract_instance_published_event.d.ts.map +1 -1
- package/dest/instance-registry/contract_instance_published_event.js +7 -3
- package/dest/instance-registry/lazy.js +1 -1
- package/dest/make_protocol_contract.d.ts +1 -1
- package/dest/make_protocol_contract.d.ts.map +1 -1
- package/dest/make_protocol_contract.js +3 -1
- package/dest/protocol_contract.d.ts +4 -1
- package/dest/protocol_contract.d.ts.map +1 -1
- package/dest/protocol_contract.js +5 -1
- package/dest/protocol_contract_data.d.ts +2 -5
- package/dest/protocol_contract_data.d.ts.map +1 -1
- package/dest/protocol_contract_data.js +38 -84
- package/dest/provider/bundle.d.ts +1 -1
- package/dest/provider/bundle.d.ts.map +1 -1
- package/dest/provider/bundle.js +1 -7
- package/dest/provider/lazy.d.ts +1 -1
- package/dest/provider/lazy.d.ts.map +1 -1
- package/dest/provider/lazy.js +0 -9
- package/dest/scripts/generate_data.js +8 -10
- package/dest/tests/fixtures.js +2 -2
- package/package.json +4 -4
- package/src/class-registry/contract_class_published_event.ts +6 -1
- package/src/class-registry/lazy.ts +1 -1
- package/src/fee-juice/lazy.ts +1 -1
- package/src/instance-registry/contract_instance_published_event.ts +5 -1
- package/src/instance-registry/lazy.ts +1 -1
- package/src/make_protocol_contract.ts +3 -1
- package/src/protocol_contract.ts +9 -1
- package/src/protocol_contract_data.ts +39 -75
- package/src/provider/bundle.ts +0 -6
- package/src/provider/lazy.ts +0 -9
- package/src/tests/fixtures.ts +2 -2
- package/artifacts/AuthRegistry.d.json.ts +0 -5
- package/artifacts/AuthRegistry.json +0 -7743
- package/artifacts/MultiCallEntrypoint.d.json.ts +0 -5
- package/artifacts/MultiCallEntrypoint.json +0 -5853
- package/artifacts/PublicChecks.d.json.ts +0 -5
- package/artifacts/PublicChecks.json +0 -4100
- package/dest/auth-registry/index.d.ts +0 -6
- package/dest/auth-registry/index.d.ts.map +0 -1
- package/dest/auth-registry/index.js +0 -13
- package/dest/auth-registry/lazy.d.ts +0 -6
- package/dest/auth-registry/lazy.d.ts.map +0 -1
- package/dest/auth-registry/lazy.js +0 -23
- package/dest/multi-call-entrypoint/index.d.ts +0 -5
- package/dest/multi-call-entrypoint/index.d.ts.map +0 -1
- package/dest/multi-call-entrypoint/index.js +0 -13
- package/dest/multi-call-entrypoint/lazy.d.ts +0 -6
- package/dest/multi-call-entrypoint/lazy.d.ts.map +0 -1
- package/dest/multi-call-entrypoint/lazy.js +0 -23
- package/dest/public-checks/index.d.ts +0 -5
- package/dest/public-checks/index.d.ts.map +0 -1
- package/dest/public-checks/index.js +0 -13
- package/dest/public-checks/lazy.d.ts +0 -6
- package/dest/public-checks/lazy.d.ts.map +0 -1
- package/dest/public-checks/lazy.js +0 -23
- package/src/auth-registry/index.ts +0 -18
- package/src/auth-registry/lazy.ts +0 -29
- package/src/multi-call-entrypoint/index.ts +0 -18
- package/src/multi-call-entrypoint/lazy.ts +0 -29
- package/src/public-checks/index.ts +0 -18
- package/src/public-checks/lazy.ts +0 -29
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@aztec/protocol-contracts",
|
|
3
3
|
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/protocol-contracts",
|
|
4
4
|
"description": "Canonical Noir contracts for the Aztec Network",
|
|
5
|
-
"version": "0.0.1-commit.
|
|
5
|
+
"version": "0.0.1-commit.a4600f49",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dest/index.js",
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
]
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@aztec/constants": "0.0.1-commit.
|
|
77
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
78
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
76
|
+
"@aztec/constants": "0.0.1-commit.a4600f49",
|
|
77
|
+
"@aztec/foundation": "0.0.1-commit.a4600f49",
|
|
78
|
+
"@aztec/stdlib": "0.0.1-commit.a4600f49",
|
|
79
79
|
"lodash.chunk": "^4.2.0",
|
|
80
80
|
"lodash.omit": "^4.5.0",
|
|
81
81
|
"tslib": "^2.4.0"
|
|
@@ -36,7 +36,12 @@ export class ContractClassPublishedEvent {
|
|
|
36
36
|
const version = reader.readField().toNumber();
|
|
37
37
|
const artifactHash = reader.readField();
|
|
38
38
|
const privateFunctionsRoot = reader.readField();
|
|
39
|
-
const
|
|
39
|
+
const bytecodeFields = reader.readFieldArray(fieldsWithoutTag.length - reader.cursor);
|
|
40
|
+
// The fixed-size class log can hold at most this many packed-bytecode bytes (every payload field
|
|
41
|
+
// carries 31 bytes). Bound the declared length to it so a malformed log can't declare a multi-MiB
|
|
42
|
+
// length backed by a tiny payload and force a large allocation during early (pre-proof) validation.
|
|
43
|
+
const maxByteLength = (bytecodeFields.length - 1) * (Fr.SIZE_IN_BYTES - 1);
|
|
44
|
+
const packedPublicBytecode = bufferFromFields(bytecodeFields, maxByteLength);
|
|
40
45
|
|
|
41
46
|
return new ContractClassPublishedEvent(
|
|
42
47
|
contractClassId,
|
|
@@ -12,7 +12,7 @@ export async function getContractClassRegistryArtifact(): Promise<ContractArtifa
|
|
|
12
12
|
if (!protocolContractArtifact) {
|
|
13
13
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
14
14
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
15
|
-
// Even if now supported by
|
|
15
|
+
// Even if now supported by all major browsers, the MIME type is replaced with
|
|
16
16
|
// "text/javascript"
|
|
17
17
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
18
18
|
const { default: contractClassRegistryJson } = await import('../../artifacts/ContractClassRegistry.json');
|
package/src/fee-juice/lazy.ts
CHANGED
|
@@ -10,7 +10,7 @@ export async function getFeeJuiceArtifact(): 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
|
-
// Even if now supported by
|
|
13
|
+
// Even if now supported by all 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
16
|
const { default: feeJuiceJson } = await import('../../artifacts/FeeJuice.json');
|
|
@@ -15,6 +15,7 @@ export class ContractInstancePublishedEvent {
|
|
|
15
15
|
public readonly salt: Fr,
|
|
16
16
|
public readonly contractClassId: Fr,
|
|
17
17
|
public readonly initializationHash: Fr,
|
|
18
|
+
public readonly immutablesHash: Fr,
|
|
18
19
|
public readonly publicKeys: PublicKeys,
|
|
19
20
|
public readonly deployer: AztecAddress,
|
|
20
21
|
) {}
|
|
@@ -31,6 +32,7 @@ export class ContractInstancePublishedEvent {
|
|
|
31
32
|
const salt = reader.readObject(Fr);
|
|
32
33
|
const contractClassId = reader.readObject(Fr);
|
|
33
34
|
const initializationHash = reader.readObject(Fr);
|
|
35
|
+
const immutablesHash = reader.readObject(Fr);
|
|
34
36
|
const publicKeys = reader.readObject(PublicKeys);
|
|
35
37
|
const deployer = reader.readObject(AztecAddress);
|
|
36
38
|
|
|
@@ -40,13 +42,14 @@ export class ContractInstancePublishedEvent {
|
|
|
40
42
|
salt,
|
|
41
43
|
contractClassId,
|
|
42
44
|
initializationHash,
|
|
45
|
+
immutablesHash,
|
|
43
46
|
publicKeys,
|
|
44
47
|
deployer,
|
|
45
48
|
);
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
toContractInstance(): ContractInstanceWithAddress {
|
|
49
|
-
if (this.version !==
|
|
52
|
+
if (this.version !== 2) {
|
|
50
53
|
throw new Error(`Unexpected contract instance version ${this.version}`);
|
|
51
54
|
}
|
|
52
55
|
|
|
@@ -56,6 +59,7 @@ export class ContractInstancePublishedEvent {
|
|
|
56
59
|
currentContractClassId: this.contractClassId,
|
|
57
60
|
originalContractClassId: this.contractClassId,
|
|
58
61
|
initializationHash: this.initializationHash,
|
|
62
|
+
immutablesHash: this.immutablesHash,
|
|
59
63
|
publicKeys: this.publicKeys,
|
|
60
64
|
salt: this.salt,
|
|
61
65
|
deployer: this.deployer,
|
|
@@ -13,7 +13,7 @@ export async function getContractInstanceRegistryArtifact(): Promise<ContractArt
|
|
|
13
13
|
if (!protocolContractArtifact) {
|
|
14
14
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
15
15
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
16
|
-
// Even if now supported by
|
|
16
|
+
// Even if now supported by all major browsers, the MIME type is replaced with
|
|
17
17
|
// "text/javascript"
|
|
18
18
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
19
19
|
const { default: contractInstanceRegistryJson } = await import('../../artifacts/ContractInstanceRegistry.json');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
1
2
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
3
|
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
3
4
|
|
|
@@ -34,10 +35,11 @@ export function makeProtocolContract(name: ProtocolContractName, artifact: Contr
|
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
const instance = {
|
|
37
|
-
version:
|
|
38
|
+
version: 2 as const,
|
|
38
39
|
currentContractClassId: classId,
|
|
39
40
|
originalContractClassId: classId,
|
|
40
41
|
initializationHash,
|
|
42
|
+
immutablesHash: Fr.ZERO, // Protocol Contracts Have No Immutables
|
|
41
43
|
publicKeys: PublicKeys.default(),
|
|
42
44
|
salt,
|
|
43
45
|
deployer: address,
|
package/src/protocol_contract.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
1
2
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
4
|
import type { ContractClassIdPreimage, ContractClassWithId, ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
4
5
|
|
|
5
|
-
import { ProtocolContractAddress } from './protocol_contract_data.js';
|
|
6
|
+
import { ProtocolContractAddress, ProtocolContractClassId } from './protocol_contract_data.js';
|
|
6
7
|
|
|
7
8
|
/** Represents a canonical contract in the protocol. */
|
|
8
9
|
export interface ProtocolContract {
|
|
@@ -20,4 +21,11 @@ export function isProtocolContract(address: AztecAddress) {
|
|
|
20
21
|
return Object.values(ProtocolContractAddress).some(a => a.equals(address));
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
const protocolContractClassIds = new Set(Object.values(ProtocolContractClassId).map(id => id.toString()));
|
|
25
|
+
|
|
26
|
+
/** Returns whether the given contract class id belongs to a bundled protocol contract. */
|
|
27
|
+
export function isProtocolContractClass(classId: Fr): boolean {
|
|
28
|
+
return protocolContractClassIds.has(classId.toString());
|
|
29
|
+
}
|
|
30
|
+
|
|
23
31
|
export { type ProtocolContractsProvider } from './provider/protocol_contracts_provider.js';
|
|
@@ -7,12 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
export const protocolContractNames = [
|
|
10
|
-
'
|
|
11
|
-
'ContractInstanceRegistry',
|
|
10
|
+
'ContractInstanceRegistry',
|
|
12
11
|
'ContractClassRegistry',
|
|
13
|
-
'
|
|
14
|
-
'FeeJuice',
|
|
15
|
-
'PublicChecks'
|
|
12
|
+
'FeeJuice'
|
|
16
13
|
] as const;
|
|
17
14
|
|
|
18
15
|
export type ProtocolContractName = typeof protocolContractNames[number];
|
|
@@ -20,115 +17,82 @@
|
|
|
20
17
|
|
|
21
18
|
|
|
22
19
|
export const ProtocolContractSalt: Record<ProtocolContractName, Fr> = {
|
|
23
|
-
|
|
24
|
-
ContractInstanceRegistry: new Fr(1),
|
|
20
|
+
ContractInstanceRegistry: new Fr(1),
|
|
25
21
|
ContractClassRegistry: new Fr(1),
|
|
26
|
-
|
|
27
|
-
FeeJuice: new Fr(1),
|
|
28
|
-
PublicChecks: new Fr(1)
|
|
22
|
+
FeeJuice: new Fr(1)
|
|
29
23
|
};
|
|
30
24
|
|
|
31
25
|
|
|
32
26
|
|
|
33
27
|
export const ProtocolContractAddress: Record<ProtocolContractName, AztecAddress> = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
MultiCallEntrypoint: AztecAddress.fromBigInt(4n),
|
|
38
|
-
FeeJuice: AztecAddress.fromBigInt(5n),
|
|
39
|
-
PublicChecks: AztecAddress.fromBigInt(6n)
|
|
28
|
+
ContractInstanceRegistry: AztecAddress.fromBigIntUnsafe(2n),
|
|
29
|
+
ContractClassRegistry: AztecAddress.fromBigIntUnsafe(1n),
|
|
30
|
+
FeeJuice: AztecAddress.fromBigIntUnsafe(3n)
|
|
40
31
|
};
|
|
41
32
|
|
|
42
33
|
|
|
43
34
|
|
|
44
35
|
export const ProtocolContractDerivedAddress = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
MultiCallEntrypoint: AztecAddress.fromString('0x0203a0b1b93eb66818fbead8bb5b7a464204ed851a95b2ee8789306f1af7f796'),
|
|
49
|
-
FeeJuice: AztecAddress.fromString('0x0d20a03336d11485e1c0a7578782fda5dd50492f453650d821c2d91deae48649'),
|
|
50
|
-
PublicChecks: AztecAddress.fromString('0x1d4eabb2acd49c85ee81d0e064777d86b0d47d629858f989bba6fa30df74f098')
|
|
36
|
+
ContractInstanceRegistry: AztecAddress.fromStringUnsafe('0x262381bdb818ed44505e217b6b02ecc37a1046edc6785b3caef6a86513d71058'),
|
|
37
|
+
ContractClassRegistry: AztecAddress.fromStringUnsafe('0x0f75f6277a8850d5f77139ea643de697009a1ab4666673553b908b247d514f0f'),
|
|
38
|
+
FeeJuice: AztecAddress.fromStringUnsafe('0x0aee027cb94b86007afb04f4378f4a2c1649e4642c72056896ba54819fbf5430')
|
|
51
39
|
};
|
|
52
40
|
|
|
53
41
|
|
|
54
42
|
|
|
55
43
|
export const ProtocolContractClassId: Record<ProtocolContractName, Fr> = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
MultiCallEntrypoint: Fr.fromString('0x125a9d4e995ea0fc1030fe56cf05a25a7bc79b09f4cc89a02ad0df1e061b2783'),
|
|
60
|
-
FeeJuice: Fr.fromString('0x162dd5be99ce8fbd38f8a3434836de1021249562a7f9f38493078325360c8d14'),
|
|
61
|
-
PublicChecks: Fr.fromString('0x2fb2e10806b694290c2a6d968865052004e89fd1cf0212b3c791c4e82ff36f8e')
|
|
44
|
+
ContractInstanceRegistry: Fr.fromString('0x06900ee6077e08bc0bcf1be064f3dad67b58d46ca59a00c99e1ad1db425525c7'),
|
|
45
|
+
ContractClassRegistry: Fr.fromString('0x2cce985fc14d6fff65d3eed0435e037ed27039a6a86d3aab6a5bd2569b83ec70'),
|
|
46
|
+
FeeJuice: Fr.fromString('0x17c33630396638ccf890042352185bedae92c69d7db3ec4aece71b70bcb8a7a4')
|
|
62
47
|
};
|
|
63
48
|
|
|
64
49
|
export const ProtocolContractClassIdPreimage: Record<ProtocolContractName, { artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }> = {
|
|
65
|
-
|
|
66
|
-
artifactHash: Fr.fromString('
|
|
67
|
-
privateFunctionsRoot: Fr.fromString('
|
|
68
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
69
|
-
},
|
|
70
|
-
ContractInstanceRegistry: {
|
|
71
|
-
artifactHash: Fr.fromString('0x24bb640b5b8c5d553f6b00ecd0f1fbbc43334109219728a915f0311cbcadca8b'),
|
|
72
|
-
privateFunctionsRoot: Fr.fromString('0x1a5ad2d8a129666ca3d7eb7e801e1239517fbccc10be0334b39100b17fbc96d2'),
|
|
73
|
-
publicBytecodeCommitment: Fr.fromString('0x14512a81eae728ff93f7d6ed568b231c33364a4dba36bfe0f239761065df2a67'),
|
|
50
|
+
ContractInstanceRegistry: {
|
|
51
|
+
artifactHash: Fr.fromString('0x1a45ee8878136dff02e310c2c62b875be7480494673f5dc2d4f963746b0dbd8d'),
|
|
52
|
+
privateFunctionsRoot: Fr.fromString('0x05bb912d9d2871492d76c610472544d8219df70aa874768f9667e99861d7971f'),
|
|
53
|
+
publicBytecodeCommitment: Fr.fromString('0x232a10bc23611d07c57c32110e6ad7accd088e861c4e167a17bd7433fec2f020'),
|
|
74
54
|
},
|
|
75
55
|
ContractClassRegistry: {
|
|
76
|
-
artifactHash: Fr.fromString('
|
|
77
|
-
privateFunctionsRoot: Fr.fromString('
|
|
78
|
-
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
79
|
-
},
|
|
80
|
-
MultiCallEntrypoint: {
|
|
81
|
-
artifactHash: Fr.fromString('0x03c5518b55f8d560e4797cb0d3252410ee378953275077542c2a30387423e0b4'),
|
|
82
|
-
privateFunctionsRoot: Fr.fromString('0x274e418b4b3723ace4b55099f926e76d883a8c057a34296f15a52e04ea4ec593'),
|
|
56
|
+
artifactHash: Fr.fromString('0x2cbc206eed84dbb5fc5b5d34e223c8c26def6bf0eb4ef93a54936ef1d6be6bbb'),
|
|
57
|
+
privateFunctionsRoot: Fr.fromString('0x1226036210d1d3d19245a2fe913bd14c7d3922be9e551aa481189d9561ca23a2'),
|
|
83
58
|
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
84
59
|
},
|
|
85
60
|
FeeJuice: {
|
|
86
|
-
artifactHash: Fr.fromString('
|
|
87
|
-
privateFunctionsRoot: Fr.fromString('
|
|
88
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
89
|
-
},
|
|
90
|
-
PublicChecks: {
|
|
91
|
-
artifactHash: Fr.fromString('0x051b62a68013202078e5a06a8783772166181df544f25bea84a84a184854f83d'),
|
|
92
|
-
privateFunctionsRoot: Fr.fromString('0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1'),
|
|
93
|
-
publicBytecodeCommitment: Fr.fromString('0x23a718888ee4815f0145eebf241e5a7071e6791ea2fa9b635c48b94d68b97c58'),
|
|
61
|
+
artifactHash: Fr.fromString('0x1a57ff2a8e653094229bd15c028683e08b2086dfeadecac4c6b950c383b3ae1d'),
|
|
62
|
+
privateFunctionsRoot: Fr.fromString('0x1c4bf54a4a33e3b9eae6f816dfc81e128d76d2646807a5443598c8adbd47f81f'),
|
|
63
|
+
publicBytecodeCommitment: Fr.fromString('0x1d4b1a8f71b8250d4fb65f8e16a4604e9165648279f47d80e024ce2684c4bdfb'),
|
|
94
64
|
}
|
|
95
65
|
};
|
|
96
66
|
|
|
97
67
|
export const ProtocolContractInitializationHash: Record<ProtocolContractName, Fr> = {
|
|
98
|
-
|
|
99
|
-
ContractInstanceRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
68
|
+
ContractInstanceRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
100
69
|
ContractClassRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
101
|
-
|
|
102
|
-
FeeJuice: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
103
|
-
PublicChecks: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
70
|
+
FeeJuice: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
104
71
|
};
|
|
105
72
|
|
|
106
73
|
export const ProtocolContractPrivateFunctions: Record<ProtocolContractName, { selector: FunctionSelector; vkHash: Fr }[]> = {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
MultiCallEntrypoint: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000f04908a9')), vkHash: Fr.fromString('0x01a9fe65b628a72771fe90e3b3cf4d16fa87069b788359624e1820980c0a0dd3') }],
|
|
111
|
-
FeeJuice: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000cbe67243')), vkHash: Fr.fromString('0x2ad6083b4595f8076c014e5152191013167ab1b5a31ad0cbb06490054c7c59ae') }, { selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000e8d374b6')), vkHash: Fr.fromString('0x05aaffffdf797625ff24575d939339303775c5db77fb6bdcecbf955f726fd071') }],
|
|
112
|
-
PublicChecks: []
|
|
74
|
+
ContractInstanceRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000077cff62f')), vkHash: Fr.fromString('0x19172c0acecd517dd8995c2e36178ca2aa16cbe001c3606d8cd848776ab80d23') }],
|
|
75
|
+
ContractClassRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x000000000000000000000000000000000000000000000000000000006934ed0d')), vkHash: Fr.fromString('0x0609c8195389d9ff372c9788d314c1387c31a9a4b73dacad95b01f5e03956056') }],
|
|
76
|
+
FeeJuice: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000cbe67243')), vkHash: Fr.fromString('0x0bdf2e5c4467f295f8defb436546a7f2e642e7fe75786d0d54aef497b76527a1') }, { selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000e8d374b6')), vkHash: Fr.fromString('0x2616a94d2d2981737c31ed7d74b9fd32ddc8376bf436dd60fb2507662b47c6dd') }]
|
|
113
77
|
};
|
|
114
78
|
|
|
115
79
|
|
|
116
80
|
|
|
117
81
|
export const ProtocolContractsList = new ProtocolContracts([
|
|
118
|
-
AztecAddress.
|
|
119
|
-
AztecAddress.
|
|
120
|
-
AztecAddress.
|
|
121
|
-
AztecAddress.
|
|
122
|
-
AztecAddress.
|
|
123
|
-
AztecAddress.
|
|
124
|
-
AztecAddress.
|
|
125
|
-
AztecAddress.
|
|
126
|
-
AztecAddress.
|
|
127
|
-
AztecAddress.
|
|
128
|
-
AztecAddress.
|
|
82
|
+
AztecAddress.fromStringUnsafe('0x0f75f6277a8850d5f77139ea643de697009a1ab4666673553b908b247d514f0f'),
|
|
83
|
+
AztecAddress.fromStringUnsafe('0x262381bdb818ed44505e217b6b02ecc37a1046edc6785b3caef6a86513d71058'),
|
|
84
|
+
AztecAddress.fromStringUnsafe('0x0aee027cb94b86007afb04f4378f4a2c1649e4642c72056896ba54819fbf5430'),
|
|
85
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
86
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
87
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
88
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
89
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
90
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
91
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
92
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
129
93
|
]);
|
|
130
94
|
|
|
131
|
-
export const protocolContractsHash = Fr.fromString('
|
|
95
|
+
export const protocolContractsHash = Fr.fromString('0x0727efc9473643b7abbe3c57df72d68e86b244b99cae71b17553c0f937ea433b');
|
|
132
96
|
|
|
133
97
|
|
|
134
98
|
|
package/src/provider/bundle.ts
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
|
|
3
|
-
import { AuthRegistryArtifact } from '../auth-registry/index.js';
|
|
4
3
|
import { ContractClassRegistryArtifact } from '../class-registry/index.js';
|
|
5
4
|
import { FeeJuiceArtifact } from '../fee-juice/index.js';
|
|
6
5
|
import { ContractInstanceRegistryArtifact } from '../instance-registry/index.js';
|
|
7
6
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
8
|
-
import { MultiCallEntrypointArtifact } from '../multi-call-entrypoint/index.js';
|
|
9
7
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
10
8
|
import type { ProtocolContractName } from '../protocol_contract_data.js';
|
|
11
|
-
import { PublicChecksArtifact } from '../public-checks/index.js';
|
|
12
9
|
import type { ProtocolContractsProvider } from './protocol_contracts_provider.js';
|
|
13
10
|
|
|
14
11
|
export const ProtocolContractArtifact: Record<ProtocolContractName, ContractArtifact> = {
|
|
15
|
-
AuthRegistry: AuthRegistryArtifact,
|
|
16
12
|
ContractInstanceRegistry: ContractInstanceRegistryArtifact,
|
|
17
13
|
ContractClassRegistry: ContractClassRegistryArtifact,
|
|
18
|
-
MultiCallEntrypoint: MultiCallEntrypointArtifact,
|
|
19
14
|
FeeJuice: FeeJuiceArtifact,
|
|
20
|
-
PublicChecks: PublicChecksArtifact,
|
|
21
15
|
};
|
|
22
16
|
|
|
23
17
|
export class BundledProtocolContractsProvider implements ProtocolContractsProvider {
|
package/src/provider/lazy.ts
CHANGED
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
import { getCanonicalAuthRegistry } from '../auth-registry/lazy.js';
|
|
2
1
|
import { getCanonicalClassRegistry } from '../class-registry/lazy.js';
|
|
3
2
|
import { getCanonicalFeeJuice } from '../fee-juice/lazy.js';
|
|
4
3
|
import { getCanonicalInstanceRegistry } from '../instance-registry/lazy.js';
|
|
5
|
-
import { getCanonicalMultiCallEntrypoint } from '../multi-call-entrypoint/lazy.js';
|
|
6
4
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
7
5
|
import type { ProtocolContractName } from '../protocol_contract_data.js';
|
|
8
|
-
import { getCanonicalPublicChecks } from '../public-checks/lazy.js';
|
|
9
6
|
import type { ProtocolContractsProvider } from './protocol_contracts_provider.js';
|
|
10
7
|
|
|
11
8
|
export class LazyProtocolContractsProvider implements ProtocolContractsProvider {
|
|
12
9
|
getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract> {
|
|
13
10
|
switch (name) {
|
|
14
|
-
case 'AuthRegistry':
|
|
15
|
-
return getCanonicalAuthRegistry();
|
|
16
11
|
case 'ContractInstanceRegistry':
|
|
17
12
|
return getCanonicalInstanceRegistry();
|
|
18
13
|
case 'ContractClassRegistry':
|
|
19
14
|
return getCanonicalClassRegistry();
|
|
20
|
-
case 'MultiCallEntrypoint':
|
|
21
|
-
return getCanonicalMultiCallEntrypoint();
|
|
22
15
|
case 'FeeJuice':
|
|
23
16
|
return getCanonicalFeeJuice();
|
|
24
|
-
case 'PublicChecks':
|
|
25
|
-
return getCanonicalPublicChecks();
|
|
26
17
|
default:
|
|
27
18
|
throw new Error(`Unknown protocol contract name: ${name}`);
|
|
28
19
|
}
|
package/src/tests/fixtures.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { readFileSync } from 'fs';
|
|
|
2
2
|
import { dirname, resolve } from 'path';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
|
|
5
|
-
// Generated from end-to-end/src/
|
|
5
|
+
// Generated from end-to-end/src/automine/contracts/deploy/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
6
6
|
export function getSampleContractClassPublishedEventPayload(): Buffer {
|
|
7
7
|
const path = getPathToFixture('ContractClassPublishedEventData.hex');
|
|
8
8
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
// Generated from end-to-end/src/
|
|
11
|
+
// Generated from end-to-end/src/automine/contracts/deploy/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
12
12
|
export function getSampleContractInstancePublishedEventPayload(): Buffer {
|
|
13
13
|
const path = getPathToFixture('ContractInstancePublishedEventData.hex');
|
|
14
14
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|