@aztec/protocol-contracts 5.0.0-private.20260319 → 5.0.0-rc.1
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 +2592 -460
- package/artifacts/ContractInstanceRegistry.json +3492 -937
- package/artifacts/FeeJuice.json +3799 -944
- package/dest/class-registry/contract_class_published_event.d.ts +6 -3
- package/dest/class-registry/contract_class_published_event.d.ts.map +1 -1
- package/dest/class-registry/contract_class_published_event.js +10 -16
- package/dest/class-registry/index.d.ts +1 -3
- package/dest/class-registry/index.d.ts.map +1 -1
- package/dest/class-registry/index.js +0 -2
- package/dest/class-registry/lazy.d.ts +1 -3
- package/dest/class-registry/lazy.d.ts.map +1 -1
- package/dest/class-registry/lazy.js +1 -3
- 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_data.d.ts +2 -5
- package/dest/protocol_contract_data.d.ts.map +1 -1
- package/dest/protocol_contract_data.js +32 -78
- 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 +4 -6
- package/dest/tests/fixtures.d.ts +1 -3
- package/dest/tests/fixtures.d.ts.map +1 -1
- package/dest/tests/fixtures.js +0 -10
- package/package.json +4 -4
- package/src/class-registry/contract_class_published_event.ts +10 -21
- package/src/class-registry/index.ts +0 -2
- package/src/class-registry/lazy.ts +1 -3
- 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_data.ts +34 -70
- package/src/provider/bundle.ts +0 -6
- package/src/provider/lazy.ts +0 -9
- package/src/tests/fixtures.ts +0 -12
- package/artifacts/AuthRegistry.d.json.ts +0 -5
- package/artifacts/AuthRegistry.json +0 -3713
- package/artifacts/MultiCallEntrypoint.d.json.ts +0 -5
- package/artifacts/MultiCallEntrypoint.json +0 -2961
- package/artifacts/PublicChecks.d.json.ts +0 -5
- package/artifacts/PublicChecks.json +0 -1172
- 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/class-registry/private_function_broadcasted_event.d.ts +0 -44
- package/dest/class-registry/private_function_broadcasted_event.d.ts.map +0 -1
- package/dest/class-registry/private_function_broadcasted_event.js +0 -85
- package/dest/class-registry/utility_function_broadcasted_event.d.ts +0 -38
- package/dest/class-registry/utility_function_broadcasted_event.d.ts.map +0 -1
- package/dest/class-registry/utility_function_broadcasted_event.js +0 -81
- 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/class-registry/private_function_broadcasted_event.ts +0 -109
- package/src/class-registry/utility_function_broadcasted_event.ts +0 -103
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/tests/fixtures.ts"],"names":[],"mappings":"AAKA,wBAAgB,2CAA2C,IAAI,MAAM,CAGpE;AAGD,wBAAgB
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/tests/fixtures.ts"],"names":[],"mappings":"AAKA,wBAAgB,2CAA2C,IAAI,MAAM,CAGpE;AAGD,wBAAgB,8CAA8C,IAAI,MAAM,CAGvE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,UAE5C"}
|
package/dest/tests/fixtures.js
CHANGED
|
@@ -7,16 +7,6 @@ export function getSampleContractClassPublishedEventPayload() {
|
|
|
7
7
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
8
8
|
}
|
|
9
9
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
10
|
-
export function getSamplePrivateFunctionBroadcastedEventPayload() {
|
|
11
|
-
const path = getPathToFixture('PrivateFunctionBroadcastedEventData.hex');
|
|
12
|
-
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
13
|
-
}
|
|
14
|
-
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
15
|
-
export function getSampleUtilityFunctionBroadcastedEventPayload() {
|
|
16
|
-
const path = getPathToFixture('UtilityFunctionBroadcastedEventData.hex');
|
|
17
|
-
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
18
|
-
}
|
|
19
|
-
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
20
10
|
export function getSampleContractInstancePublishedEventPayload() {
|
|
21
11
|
const path = getPathToFixture('ContractInstancePublishedEventData.hex');
|
|
22
12
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
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": "5.0.0-
|
|
5
|
+
"version": "5.0.0-rc.1",
|
|
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": "5.0.0-
|
|
77
|
-
"@aztec/foundation": "5.0.0-
|
|
78
|
-
"@aztec/stdlib": "5.0.0-
|
|
76
|
+
"@aztec/constants": "5.0.0-rc.1",
|
|
77
|
+
"@aztec/foundation": "5.0.0-rc.1",
|
|
78
|
+
"@aztec/stdlib": "5.0.0-rc.1",
|
|
79
79
|
"lodash.chunk": "^4.2.0",
|
|
80
80
|
"lodash.omit": "^4.5.0",
|
|
81
81
|
"tslib": "^2.4.0"
|
|
@@ -4,7 +4,7 @@ import { FieldReader } from '@aztec/foundation/serialize';
|
|
|
4
4
|
import { bufferFromFields } from '@aztec/stdlib/abi';
|
|
5
5
|
import {
|
|
6
6
|
type ContractClassPublic,
|
|
7
|
-
|
|
7
|
+
type ContractClassPublicWithCommitment,
|
|
8
8
|
computePublicBytecodeCommitment,
|
|
9
9
|
} from '@aztec/stdlib/contract';
|
|
10
10
|
import type { ContractClassLog } from '@aztec/stdlib/logs';
|
|
@@ -47,34 +47,23 @@ export class ContractClassPublishedEvent {
|
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
artifactHash: this.artifactHash,
|
|
53
|
-
privateFunctionsRoot: this.privateFunctionsRoot,
|
|
54
|
-
publicBytecodeCommitment: await computePublicBytecodeCommitment(this.packedPublicBytecode),
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
if (!computedClassId.equals(this.contractClassId)) {
|
|
58
|
-
throw new Error(
|
|
59
|
-
`Invalid contract class id: computed ${computedClassId.toString()} but event broadcasted ${this.contractClassId.toString()}`,
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (this.version !== 1) {
|
|
64
|
-
throw new Error(`Unexpected contract class version ${this.version}`);
|
|
65
|
-
}
|
|
66
|
-
|
|
50
|
+
/** Converts the event to a contract class, without computing or validating the bytecode commitment. */
|
|
51
|
+
toContractClassPublic(): ContractClassPublic {
|
|
67
52
|
return {
|
|
68
53
|
id: this.contractClassId,
|
|
69
54
|
artifactHash: this.artifactHash,
|
|
70
55
|
packedBytecode: this.packedPublicBytecode,
|
|
71
56
|
privateFunctionsRoot: this.privateFunctionsRoot,
|
|
72
|
-
version: this.version,
|
|
73
|
-
privateFunctions: [],
|
|
74
|
-
utilityFunctions: [],
|
|
57
|
+
version: this.version as 1,
|
|
75
58
|
};
|
|
76
59
|
}
|
|
77
60
|
|
|
61
|
+
/** Converts the event to a contract class with its bytecode commitment (expensive). */
|
|
62
|
+
async toContractClassPublicWithBytecodeCommitment(): Promise<ContractClassPublicWithCommitment> {
|
|
63
|
+
const publicBytecodeCommitment = await computePublicBytecodeCommitment(this.packedPublicBytecode);
|
|
64
|
+
return { ...this.toContractClassPublic(), publicBytecodeCommitment };
|
|
65
|
+
}
|
|
66
|
+
|
|
78
67
|
public static extractContractClassEvents(logs: ContractClassLog[]): ContractClassPublishedEvent[] {
|
|
79
68
|
return logs
|
|
80
69
|
.filter((log: ContractClassLog) => ContractClassPublishedEvent.isContractClassPublishedEvent(log))
|
|
@@ -6,8 +6,6 @@ import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
|
6
6
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
7
7
|
|
|
8
8
|
export * from './contract_class_published_event.js';
|
|
9
|
-
export * from './private_function_broadcasted_event.js';
|
|
10
|
-
export * from './utility_function_broadcasted_event.js';
|
|
11
9
|
|
|
12
10
|
export const ContractClassRegistryArtifact = loadContractArtifact(ContractClassRegistryJson as NoirCompiledContract);
|
|
13
11
|
|
|
@@ -4,8 +4,6 @@ import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
|
4
4
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
5
5
|
|
|
6
6
|
export * from './contract_class_published_event.js';
|
|
7
|
-
export * from './private_function_broadcasted_event.js';
|
|
8
|
-
export * from './utility_function_broadcasted_event.js';
|
|
9
7
|
|
|
10
8
|
let protocolContract: ProtocolContract;
|
|
11
9
|
let protocolContractArtifact: ContractArtifact;
|
|
@@ -14,7 +12,7 @@ export async function getContractClassRegistryArtifact(): Promise<ContractArtifa
|
|
|
14
12
|
if (!protocolContractArtifact) {
|
|
15
13
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
16
14
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
17
|
-
// Even if now supported by
|
|
15
|
+
// Even if now supported by all major browsers, the MIME type is replaced with
|
|
18
16
|
// "text/javascript"
|
|
19
17
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
20
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,
|
|
@@ -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,107 +17,74 @@
|
|
|
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.fromBigInt(2n),
|
|
29
|
+
ContractClassRegistry: AztecAddress.fromBigInt(1n),
|
|
30
|
+
FeeJuice: AztecAddress.fromBigInt(3n)
|
|
40
31
|
};
|
|
41
32
|
|
|
42
33
|
|
|
43
34
|
|
|
44
35
|
export const ProtocolContractDerivedAddress = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
MultiCallEntrypoint: AztecAddress.fromString('0x28a8d91fe41b002b453523ef9dda9fd9ce5cba46e90d958f125d1e6f8c8ceaf1'),
|
|
49
|
-
FeeJuice: AztecAddress.fromString('0x2525057c83e4887fd553b0dc48f55829f0bd3c12d4e2d73353d85778ee686e8b'),
|
|
50
|
-
PublicChecks: AztecAddress.fromString('0x1e883c67d878372ee99e320400c0bad00d85489e954d3f74a3d8355f3a065f23')
|
|
36
|
+
ContractInstanceRegistry: AztecAddress.fromString('0x00c8e0704ca0306dafc52ddd979ea49eca512ca4d074c5ed821a2db832ef633a'),
|
|
37
|
+
ContractClassRegistry: AztecAddress.fromString('0x2047b7aba49ac0459ab5d75fde32bcd364e4f984f482c1ae6002cd299031bcde'),
|
|
38
|
+
FeeJuice: AztecAddress.fromString('0x06f0f6b0d7a8835ae0d71513a6e18e0484132ab20d153af64e89b1933f68287a')
|
|
51
39
|
};
|
|
52
40
|
|
|
53
41
|
|
|
54
42
|
|
|
55
43
|
export const ProtocolContractClassId: Record<ProtocolContractName, Fr> = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
MultiCallEntrypoint: Fr.fromString('0x27d88efa52079f3746f86eff9222d3589709795cd5b8c9c8a2e22f22e05a8981'),
|
|
60
|
-
FeeJuice: Fr.fromString('0x1cbf5fdda9269699ce20736078f86e27db37caebecc9216e671489464251c73a'),
|
|
61
|
-
PublicChecks: Fr.fromString('0x1683ef3d6e8f4561d7a98c71ed9762d421ed49a2ed984f17ef1bed1ae1f5444e')
|
|
44
|
+
ContractInstanceRegistry: Fr.fromString('0x13ff35e81c6ef0457eae18472548aff892898dc9dcd476b529232a7ac6fd0441'),
|
|
45
|
+
ContractClassRegistry: Fr.fromString('0x28308dcf38647b560a5bfc75a42fc11ac99f4f61bb3c20a942326354cfb83476'),
|
|
46
|
+
FeeJuice: Fr.fromString('0x0bb3010637f6c717b41858a4ac705057b94f41cd75bba4201329728995805fc8')
|
|
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('0x281a07a3053cbe68c9506fa446e6139589b9e0aa3fc7ffc4343ff3a201403798'),
|
|
72
|
-
privateFunctionsRoot: Fr.fromString('0x003e0fc68df58cceacc107e1909391217ba2f2033821c97748536a9a1d7a07dc'),
|
|
73
|
-
publicBytecodeCommitment: Fr.fromString('0x1d40fc843cc358dc36f3646e376b190e36a2a1090acd2d7578918e84aa1d40c3'),
|
|
50
|
+
ContractInstanceRegistry: {
|
|
51
|
+
artifactHash: Fr.fromString('0x1720e3349b4f0f75e242bc79d6cc01ebd90437242f221d7ddbdcd784c1adf9fc'),
|
|
52
|
+
privateFunctionsRoot: Fr.fromString('0x0239b0f293384aad456e2e27901eb97cd9073322a28d14b0ac7816a5297b2812'),
|
|
53
|
+
publicBytecodeCommitment: Fr.fromString('0x2c79b6699098244e947caca071a31799c20aa20e7124910a2b7c918fe817d65e'),
|
|
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('0x0d082ee46b5aa422fe7b81b3943e8ca8e3edba67386106d872f6d927dbb16b3e'),
|
|
82
|
-
privateFunctionsRoot: Fr.fromString('0x266505ecb7c02ce6e227227c0b6bdb44713c8ecd43164ee7bb00b8fb340e8b03'),
|
|
56
|
+
artifactHash: Fr.fromString('0x0dea13afa62a71c9ee97a247aea53a64c9d05bcc48d5a56fd73c4891a46f7292'),
|
|
57
|
+
privateFunctionsRoot: Fr.fromString('0x0672f623ec0753ab9fbb02a9a241df81b9bcc0dbed8628d8cab8790e0cb0c03d'),
|
|
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('0x2fcb62be6eccadf10f1e4419936f2e9e456b2d6235d85514d55a09baa624597c'),
|
|
92
|
-
privateFunctionsRoot: Fr.fromString('0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1'),
|
|
93
|
-
publicBytecodeCommitment: Fr.fromString('0x1fb8fae63fa9e9f34dda88dc2ed06e32fb225f7e8228a1bfb3411c3eed9364e9'),
|
|
61
|
+
artifactHash: Fr.fromString('0x184aee92af93d7338cda3b76e9d441559cd15560f517a1a01df541d13a6578de'),
|
|
62
|
+
privateFunctionsRoot: Fr.fromString('0x247aaafc67f6bf5b06736649181a477dac9f18d3468969b14669708c3dabb275'),
|
|
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('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: []
|
|
74
|
+
ContractInstanceRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000077cff62f')), vkHash: Fr.fromString('0x08a57d0b4d164c6c8d92da9c3bfe57a4ac1a639ab0a2a0ccb60bbb6bcd37f245') }],
|
|
75
|
+
ContractClassRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x000000000000000000000000000000000000000000000000000000006934ed0d')), vkHash: Fr.fromString('0x1531ed0e20d6d05f1aeb06f746c8c4b8f467174836d6edf915b0c45099b393ed') }],
|
|
76
|
+
FeeJuice: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000cbe67243')), vkHash: Fr.fromString('0x2dbad42bf59fe7ea908485dea59573b4d7fb8ddefb6a0f73bbcce79aa27d545c') }, { selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000e8d374b6')), vkHash: Fr.fromString('0x2e9880e15fb0c9a5494faef915861144769e94aded54c737819ee75918fbda51') }]
|
|
113
77
|
};
|
|
114
78
|
|
|
115
79
|
|
|
116
80
|
|
|
117
81
|
export const ProtocolContractsList = new ProtocolContracts([
|
|
118
|
-
AztecAddress.fromString('
|
|
119
|
-
AztecAddress.fromString('
|
|
120
|
-
AztecAddress.fromString('
|
|
121
|
-
AztecAddress.fromString('
|
|
122
|
-
AztecAddress.fromString('
|
|
123
|
-
AztecAddress.fromString('
|
|
82
|
+
AztecAddress.fromString('0x2047b7aba49ac0459ab5d75fde32bcd364e4f984f482c1ae6002cd299031bcde'),
|
|
83
|
+
AztecAddress.fromString('0x00c8e0704ca0306dafc52ddd979ea49eca512ca4d074c5ed821a2db832ef633a'),
|
|
84
|
+
AztecAddress.fromString('0x06f0f6b0d7a8835ae0d71513a6e18e0484132ab20d153af64e89b1933f68287a'),
|
|
85
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
86
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
87
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
124
88
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
125
89
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
126
90
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
@@ -128,7 +92,7 @@ AztecAddress.fromString('0x00000000000000000000000000000000000000000000000000000
|
|
|
128
92
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
129
93
|
]);
|
|
130
94
|
|
|
131
|
-
export const protocolContractsHash = Fr.fromString('
|
|
95
|
+
export const protocolContractsHash = Fr.fromString('0x016d8ee101b952bcb395235a0ab89707008374dda24f70c1f3911f1b0539d6c4');
|
|
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
|
@@ -8,18 +8,6 @@ export function getSampleContractClassPublishedEventPayload(): Buffer {
|
|
|
8
8
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
12
|
-
export function getSamplePrivateFunctionBroadcastedEventPayload(): Buffer {
|
|
13
|
-
const path = getPathToFixture('PrivateFunctionBroadcastedEventData.hex');
|
|
14
|
-
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
18
|
-
export function getSampleUtilityFunctionBroadcastedEventPayload(): Buffer {
|
|
19
|
-
const path = getPathToFixture('UtilityFunctionBroadcastedEventData.hex');
|
|
20
|
-
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
21
|
-
}
|
|
22
|
-
|
|
23
11
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
24
12
|
export function getSampleContractInstancePublishedEventPayload(): Buffer {
|
|
25
13
|
const path = getPathToFixture('ContractInstancePublishedEventData.hex');
|