@aztec/protocol-contracts 0.0.1-commit.3e3d0c9cd → 0.0.1-commit.3f296a7d2
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 +4437 -219
- package/artifacts/ContractClassRegistry.json +2013 -41
- package/artifacts/ContractInstanceRegistry.json +2870 -110
- package/artifacts/FeeJuice.json +2937 -91
- package/artifacts/MultiCallEntrypoint.json +3373 -141
- package/artifacts/PublicChecks.json +3428 -160
- 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 +0 -2
- package/dest/protocol_contract_data.js +29 -29
- 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 +0 -2
- package/src/protocol_contract_data.ts +29 -29
- package/src/tests/fixtures.ts +0 -12
- 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/src/class-registry/private_function_broadcasted_event.ts +0 -109
- package/src/class-registry/utility_function_broadcasted_event.ts +0 -103
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
-
import { type ContractClassPublic } from '@aztec/stdlib/contract';
|
|
2
|
+
import { type ContractClassPublic, type ContractClassPublicWithCommitment } from '@aztec/stdlib/contract';
|
|
3
3
|
import type { ContractClassLog } from '@aztec/stdlib/logs';
|
|
4
4
|
/** Event emitted from the ContractClassRegistry. */
|
|
5
5
|
export declare class ContractClassPublishedEvent {
|
|
@@ -11,7 +11,10 @@ export declare class ContractClassPublishedEvent {
|
|
|
11
11
|
constructor(contractClassId: Fr, version: number, artifactHash: Fr, privateFunctionsRoot: Fr, packedPublicBytecode: Buffer);
|
|
12
12
|
static isContractClassPublishedEvent(log: ContractClassLog): boolean;
|
|
13
13
|
static fromLog(log: ContractClassLog): ContractClassPublishedEvent;
|
|
14
|
-
|
|
14
|
+
/** Converts the event to a contract class, without computing or validating the bytecode commitment. */
|
|
15
|
+
toContractClassPublic(): ContractClassPublic;
|
|
16
|
+
/** Converts the event to a contract class with its bytecode commitment (expensive). */
|
|
17
|
+
toContractClassPublicWithBytecodeCommitment(): Promise<ContractClassPublicWithCommitment>;
|
|
15
18
|
static extractContractClassEvents(logs: ContractClassLog[]): ContractClassPublishedEvent[];
|
|
16
19
|
}
|
|
17
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3RfY2xhc3NfcHVibGlzaGVkX2V2ZW50LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xhc3MtcmVnaXN0cnkvY29udHJhY3RfY2xhc3NfcHVibGlzaGVkX2V2ZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUdwRCxPQUFPLEVBQ0wsS0FBSyxtQkFBbUIsRUFDeEIsS0FBSyxpQ0FBaUMsRUFFdkMsTUFBTSx3QkFBd0IsQ0FBQztBQUNoQyxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBSTNELG9EQUFvRDtBQUNwRCxxQkFBYSwyQkFBMkI7YUFFcEIsZUFBZSxFQUFFLEVBQUU7YUFDbkIsT0FBTyxFQUFFLE1BQU07YUFDZixZQUFZLEVBQUUsRUFBRTthQUNoQixvQkFBb0IsRUFBRSxFQUFFO2FBQ3hCLG9CQUFvQixFQUFFLE1BQU07SUFMOUMsWUFDa0IsZUFBZSxFQUFFLEVBQUUsRUFDbkIsT0FBTyxFQUFFLE1BQU0sRUFDZixZQUFZLEVBQUUsRUFBRSxFQUNoQixvQkFBb0IsRUFBRSxFQUFFLEVBQ3hCLG9CQUFvQixFQUFFLE1BQU0sRUFDMUM7SUFFSixNQUFNLENBQUMsNkJBQTZCLENBQUMsR0FBRyxFQUFFLGdCQUFnQixXQUt6RDtJQUVELE1BQU0sQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLGdCQUFnQiwrQkFpQm5DO0lBRUQsdUdBQXVHO0lBQ3ZHLHFCQUFxQixJQUFJLG1CQUFtQixDQVEzQztJQUVELHVGQUF1RjtJQUNqRiwyQ0FBMkMsSUFBSSxPQUFPLENBQUMsaUNBQWlDLENBQUMsQ0FHOUY7SUFFRCxPQUFjLDBCQUEwQixDQUFDLElBQUksRUFBRSxnQkFBZ0IsRUFBRSxHQUFHLDJCQUEyQixFQUFFLENBSWhHO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract_class_published_event.d.ts","sourceRoot":"","sources":["../../src/class-registry/contract_class_published_event.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,EACL,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"contract_class_published_event.d.ts","sourceRoot":"","sources":["../../src/class-registry/contract_class_published_event.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iCAAiC,EAEvC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,oDAAoD;AACpD,qBAAa,2BAA2B;aAEpB,eAAe,EAAE,EAAE;aACnB,OAAO,EAAE,MAAM;aACf,YAAY,EAAE,EAAE;aAChB,oBAAoB,EAAE,EAAE;aACxB,oBAAoB,EAAE,MAAM;IAL9C,YACkB,eAAe,EAAE,EAAE,EACnB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,EAAE,EAChB,oBAAoB,EAAE,EAAE,EACxB,oBAAoB,EAAE,MAAM,EAC1C;IAEJ,MAAM,CAAC,6BAA6B,CAAC,GAAG,EAAE,gBAAgB,WAKzD;IAED,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,gBAAgB,+BAiBnC;IAED,uGAAuG;IACvG,qBAAqB,IAAI,mBAAmB,CAQ3C;IAED,uFAAuF;IACjF,2CAA2C,IAAI,OAAO,CAAC,iCAAiC,CAAC,CAG9F;IAED,OAAc,0BAA0B,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,2BAA2B,EAAE,CAIhG;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CONTRACT_CLASS_PUBLISHED_MAGIC_VALUE } from '@aztec/constants';
|
|
2
2
|
import { FieldReader } from '@aztec/foundation/serialize';
|
|
3
3
|
import { bufferFromFields } from '@aztec/stdlib/abi';
|
|
4
|
-
import {
|
|
4
|
+
import { computePublicBytecodeCommitment } from '@aztec/stdlib/contract';
|
|
5
5
|
import { ProtocolContractAddress } from '../protocol_contract_data.js';
|
|
6
6
|
/** Event emitted from the ContractClassRegistry. */ export class ContractClassPublishedEvent {
|
|
7
7
|
contractClassId;
|
|
@@ -30,26 +30,20 @@ import { ProtocolContractAddress } from '../protocol_contract_data.js';
|
|
|
30
30
|
const packedPublicBytecode = bufferFromFields(reader.readFieldArray(fieldsWithoutTag.length - reader.cursor));
|
|
31
31
|
return new ContractClassPublishedEvent(contractClassId, version, artifactHash, privateFunctionsRoot, packedPublicBytecode);
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
const computedClassId = await computeContractClassId({
|
|
35
|
-
artifactHash: this.artifactHash,
|
|
36
|
-
privateFunctionsRoot: this.privateFunctionsRoot,
|
|
37
|
-
publicBytecodeCommitment: await computePublicBytecodeCommitment(this.packedPublicBytecode)
|
|
38
|
-
});
|
|
39
|
-
if (!computedClassId.equals(this.contractClassId)) {
|
|
40
|
-
throw new Error(`Invalid contract class id: computed ${computedClassId.toString()} but event broadcasted ${this.contractClassId.toString()}`);
|
|
41
|
-
}
|
|
42
|
-
if (this.version !== 1) {
|
|
43
|
-
throw new Error(`Unexpected contract class version ${this.version}`);
|
|
44
|
-
}
|
|
33
|
+
/** Converts the event to a contract class, without computing or validating the bytecode commitment. */ toContractClassPublic() {
|
|
45
34
|
return {
|
|
46
35
|
id: this.contractClassId,
|
|
47
36
|
artifactHash: this.artifactHash,
|
|
48
37
|
packedBytecode: this.packedPublicBytecode,
|
|
49
38
|
privateFunctionsRoot: this.privateFunctionsRoot,
|
|
50
|
-
version: this.version
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
version: this.version
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** Converts the event to a contract class with its bytecode commitment (expensive). */ async toContractClassPublicWithBytecodeCommitment() {
|
|
43
|
+
const publicBytecodeCommitment = await computePublicBytecodeCommitment(this.packedPublicBytecode);
|
|
44
|
+
return {
|
|
45
|
+
...this.toContractClassPublic(),
|
|
46
|
+
publicBytecodeCommitment
|
|
53
47
|
};
|
|
54
48
|
}
|
|
55
49
|
static extractContractClassEvents(logs) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
2
2
|
export * from './contract_class_published_event.js';
|
|
3
|
-
export * from './private_function_broadcasted_event.js';
|
|
4
|
-
export * from './utility_function_broadcasted_event.js';
|
|
5
3
|
export declare const ContractClassRegistryArtifact: import("@aztec/stdlib/abi").ContractArtifact;
|
|
6
4
|
/** Returns the canonical deployment of the contract. */
|
|
7
5
|
export declare function getCanonicalClassRegistry(): Promise<ProtocolContract>;
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jbGFzcy1yZWdpc3RyeS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLQSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRWhFLGNBQWMscUNBQXFDLENBQUM7QUFFcEQsZUFBTyxNQUFNLDZCQUE2Qiw4Q0FBMEUsQ0FBQztBQUlySCx3REFBd0Q7QUFDeEQsd0JBQWdCLHlCQUF5QixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQU1yRSJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/class-registry/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,cAAc,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/class-registry/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,cAAc,qCAAqC,CAAC;AAEpD,eAAO,MAAM,6BAA6B,8CAA0E,CAAC;AAIrH,wDAAwD;AACxD,wBAAgB,yBAAyB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAMrE"}
|
|
@@ -4,8 +4,6 @@ import ContractClassRegistryJson from '../../artifacts/ContractClassRegistry.jso
|
|
|
4
4
|
};
|
|
5
5
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
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
|
export const ContractClassRegistryArtifact = loadContractArtifact(ContractClassRegistryJson);
|
|
10
8
|
let protocolContract;
|
|
11
9
|
/** Returns the canonical deployment of the contract. */ export function getCanonicalClassRegistry() {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { type ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
3
3
|
export * from './contract_class_published_event.js';
|
|
4
|
-
export * from './private_function_broadcasted_event.js';
|
|
5
|
-
export * from './utility_function_broadcasted_event.js';
|
|
6
4
|
export declare function getContractClassRegistryArtifact(): Promise<ContractArtifact>;
|
|
7
5
|
/** Returns the canonical deployment of the auth registry. */
|
|
8
6
|
export declare function getCanonicalClassRegistry(): Promise<ProtocolContract>;
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsYXNzLXJlZ2lzdHJ5L2xhenkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssZ0JBQWdCLEVBQXdCLE1BQU0sbUJBQW1CLENBQUM7QUFHaEYsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUVoRSxjQUFjLHFDQUFxQyxDQUFDO0FBS3BELHdCQUFzQixnQ0FBZ0MsSUFBSSxPQUFPLENBQUMsZ0JBQWdCLENBQUMsQ0FXbEY7QUFFRCw2REFBNkQ7QUFDN0Qsd0JBQXNCLHlCQUF5QixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQU0zRSJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/class-registry/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAwB,MAAM,mBAAmB,CAAC;AAGhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,cAAc,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/class-registry/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAwB,MAAM,mBAAmB,CAAC;AAGhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,cAAc,qCAAqC,CAAC;AAKpD,wBAAsB,gCAAgC,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAWlF;AAED,6DAA6D;AAC7D,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAM3E"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
3
3
|
export * from './contract_class_published_event.js';
|
|
4
|
-
export * from './private_function_broadcasted_event.js';
|
|
5
|
-
export * from './utility_function_broadcasted_event.js';
|
|
6
4
|
let protocolContract;
|
|
7
5
|
let protocolContractArtifact;
|
|
8
6
|
export async function getContractClassRegistryArtifact() {
|
|
@@ -28,51 +28,51 @@ export const ProtocolContractAddress = {
|
|
|
28
28
|
PublicChecks: AztecAddress.fromBigInt(6n)
|
|
29
29
|
};
|
|
30
30
|
export const ProtocolContractDerivedAddress = {
|
|
31
|
-
AuthRegistry: AztecAddress.fromString('
|
|
32
|
-
ContractInstanceRegistry: AztecAddress.fromString('
|
|
33
|
-
ContractClassRegistry: AztecAddress.fromString('
|
|
34
|
-
MultiCallEntrypoint: AztecAddress.fromString('
|
|
35
|
-
FeeJuice: AztecAddress.fromString('
|
|
36
|
-
PublicChecks: AztecAddress.fromString('
|
|
31
|
+
AuthRegistry: AztecAddress.fromString('0x0a847d95021e6f94f477dbebbcce8464688e84723a75597b0083603b1ae31c34'),
|
|
32
|
+
ContractInstanceRegistry: AztecAddress.fromString('0x03a448eda542a33af13f56ddbdb7e21cd833ff5fd50565a66c5601e91236d7fe'),
|
|
33
|
+
ContractClassRegistry: AztecAddress.fromString('0x2c6630df9bc892ccf46898fbc2997aaafbf7f81430746c06d1f9ac3b632c5497'),
|
|
34
|
+
MultiCallEntrypoint: AztecAddress.fromString('0x0f51d97fdc7993e8a5dfa26f544804ff9c1a5473ae69988756a8d47ad5700f3b'),
|
|
35
|
+
FeeJuice: AztecAddress.fromString('0x27947b30bc7580789b60e4ae40865b438109af56fc191e2469b408541f92e715'),
|
|
36
|
+
PublicChecks: AztecAddress.fromString('0x169879de0a57ed33ff2f23ca169c3c49b001d417f896515c894a23984dd88644')
|
|
37
37
|
};
|
|
38
38
|
export const ProtocolContractClassId = {
|
|
39
|
-
AuthRegistry: Fr.fromString('
|
|
40
|
-
ContractInstanceRegistry: Fr.fromString('
|
|
41
|
-
ContractClassRegistry: Fr.fromString('
|
|
42
|
-
MultiCallEntrypoint: Fr.fromString('
|
|
43
|
-
FeeJuice: Fr.fromString('
|
|
44
|
-
PublicChecks: Fr.fromString('
|
|
39
|
+
AuthRegistry: Fr.fromString('0x1cde63d00caee5994ee383fc5fd29d588b0df447c769120360d639ff43b5b15a'),
|
|
40
|
+
ContractInstanceRegistry: Fr.fromString('0x142f3a2323b5f6b3240a14a4e2536d75e6b452dfbfcb7cff59597dc5cfd61330'),
|
|
41
|
+
ContractClassRegistry: Fr.fromString('0x296951a1a1afd6b50de27be695bf18658a5e29a240e9940cf3ebfecc330b2d79'),
|
|
42
|
+
MultiCallEntrypoint: Fr.fromString('0x0024bc7e208259894179becc1fd0cac591463d0fc2f6fb6f52c0e1841aff2d48'),
|
|
43
|
+
FeeJuice: Fr.fromString('0x1d589a24ac67243d7d0bbddaf5713fbede6f82e365880d65599c6eef86ceae35'),
|
|
44
|
+
PublicChecks: Fr.fromString('0x27f4b06d10f954d26f2ba815a46436b96133a8bf5f7d972c6c16d38d7f7f6f67')
|
|
45
45
|
};
|
|
46
46
|
export const ProtocolContractClassIdPreimage = {
|
|
47
47
|
AuthRegistry: {
|
|
48
|
-
artifactHash: Fr.fromString('
|
|
48
|
+
artifactHash: Fr.fromString('0x19b8f6aa8fa60edcfebbed20c679361755501b1226aaac4b89856dd7d2e47b94'),
|
|
49
49
|
privateFunctionsRoot: Fr.fromString('0x11900a485e3ffa03da98d89abb0c9419200644aaf17f5caa863953fccf1ed88f'),
|
|
50
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
50
|
+
publicBytecodeCommitment: Fr.fromString('0x03fe8d2f7d592ab04300c1957d9e70f14af378235f73b0fc3ac6a59fecd4ee9d')
|
|
51
51
|
},
|
|
52
52
|
ContractInstanceRegistry: {
|
|
53
|
-
artifactHash: Fr.fromString('
|
|
53
|
+
artifactHash: Fr.fromString('0x0680a32d61731ede431aea5f42e39865f2bcac4840ef35eb6a384ea1c2333603'),
|
|
54
54
|
privateFunctionsRoot: Fr.fromString('0x136a6705c7ad1d47f65cb881a56909d4c78d3fa8944f5b103734cd91e654ed63'),
|
|
55
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
55
|
+
publicBytecodeCommitment: Fr.fromString('0x173e23c6266b480c9222e2bbd3cc28ff158f8c988e80283de852f91b4bd855ea')
|
|
56
56
|
},
|
|
57
57
|
ContractClassRegistry: {
|
|
58
|
-
artifactHash: Fr.fromString('
|
|
58
|
+
artifactHash: Fr.fromString('0x0a286a92191899cc74c555827329a3cca59f3f15d5ee300d5acf950d2e0de923'),
|
|
59
59
|
privateFunctionsRoot: Fr.fromString('0x2ac3bf890a7d534a768079aa86889caa1a86373c8e6fc2db48215b11bbb79106'),
|
|
60
60
|
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e')
|
|
61
61
|
},
|
|
62
62
|
MultiCallEntrypoint: {
|
|
63
|
-
artifactHash: Fr.fromString('
|
|
63
|
+
artifactHash: Fr.fromString('0x2674100736657625e47481e9d4542bb681620f33b84a296bace581c936ce307a'),
|
|
64
64
|
privateFunctionsRoot: Fr.fromString('0x266505ecb7c02ce6e227227c0b6bdb44713c8ecd43164ee7bb00b8fb340e8b03'),
|
|
65
65
|
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e')
|
|
66
66
|
},
|
|
67
67
|
FeeJuice: {
|
|
68
|
-
artifactHash: Fr.fromString('
|
|
68
|
+
artifactHash: Fr.fromString('0x28d487836ba903fd6fa81e899ebfc903c2f05f5add0d4d12256fcb1155426a92'),
|
|
69
69
|
privateFunctionsRoot: Fr.fromString('0x0abef3cfc6ae314886c841b42dc33d3eed255ad3dee7773daabf05b229573759'),
|
|
70
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
70
|
+
publicBytecodeCommitment: Fr.fromString('0x21e4b6d1450920af1d52a3cee46198ae52536c4a70dd8780c96bbc70911ba3ef')
|
|
71
71
|
},
|
|
72
72
|
PublicChecks: {
|
|
73
|
-
artifactHash: Fr.fromString('
|
|
73
|
+
artifactHash: Fr.fromString('0x1b24eab5ea8e4714f917d25bbb5b2a9fa08405c6dd9b13e1956f0f9d38c75502'),
|
|
74
74
|
privateFunctionsRoot: Fr.fromString('0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1'),
|
|
75
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
75
|
+
publicBytecodeCommitment: Fr.fromString('0x123f9e2e26c424665a1958af5c04054bb489c8a4d2aa19af0c93ee9abe43a1ec')
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
export const ProtocolContractInitializationHash = {
|
|
@@ -121,17 +121,17 @@ export const ProtocolContractPrivateFunctions = {
|
|
|
121
121
|
PublicChecks: []
|
|
122
122
|
};
|
|
123
123
|
export const ProtocolContractsList = new ProtocolContracts([
|
|
124
|
-
AztecAddress.fromString('
|
|
125
|
-
AztecAddress.fromString('
|
|
126
|
-
AztecAddress.fromString('
|
|
127
|
-
AztecAddress.fromString('
|
|
128
|
-
AztecAddress.fromString('
|
|
129
|
-
AztecAddress.fromString('
|
|
124
|
+
AztecAddress.fromString('0x0a847d95021e6f94f477dbebbcce8464688e84723a75597b0083603b1ae31c34'),
|
|
125
|
+
AztecAddress.fromString('0x03a448eda542a33af13f56ddbdb7e21cd833ff5fd50565a66c5601e91236d7fe'),
|
|
126
|
+
AztecAddress.fromString('0x2c6630df9bc892ccf46898fbc2997aaafbf7f81430746c06d1f9ac3b632c5497'),
|
|
127
|
+
AztecAddress.fromString('0x0f51d97fdc7993e8a5dfa26f544804ff9c1a5473ae69988756a8d47ad5700f3b'),
|
|
128
|
+
AztecAddress.fromString('0x27947b30bc7580789b60e4ae40865b438109af56fc191e2469b408541f92e715'),
|
|
129
|
+
AztecAddress.fromString('0x169879de0a57ed33ff2f23ca169c3c49b001d417f896515c894a23984dd88644'),
|
|
130
130
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
131
131
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
132
132
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
133
133
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
134
134
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
135
135
|
]);
|
|
136
|
-
export const protocolContractsHash = Fr.fromString('
|
|
136
|
+
export const protocolContractsHash = Fr.fromString('0x0155a997b9103364ee0c0d0ef58b44ad9d9bde98ab19e15bd5c2d268d34a05d5');
|
|
137
137
|
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('0x1a7e1badb79abdd38c684b3c8306ffe7ecb33c69e3380d9855730aaaa83a21a8');
|
package/dest/tests/fixtures.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export declare function getSampleContractClassPublishedEventPayload(): Buffer;
|
|
2
|
-
export declare function getSamplePrivateFunctionBroadcastedEventPayload(): Buffer;
|
|
3
|
-
export declare function getSampleUtilityFunctionBroadcastedEventPayload(): Buffer;
|
|
4
2
|
export declare function getSampleContractInstancePublishedEventPayload(): Buffer;
|
|
5
3
|
export declare function getPathToFixture(name: string): string;
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZml4dHVyZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0cy9maXh0dXJlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLQSx3QkFBZ0IsMkNBQTJDLElBQUksTUFBTSxDQUdwRTtBQUdELHdCQUFnQiw4Q0FBOEMsSUFBSSxNQUFNLENBR3ZFO0FBRUQsd0JBQWdCLGdCQUFnQixDQUFDLElBQUksRUFBRSxNQUFNLFVBRTVDIn0=
|
|
@@ -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": "0.0.1-commit.
|
|
5
|
+
"version": "0.0.1-commit.3f296a7d2",
|
|
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.3f296a7d2",
|
|
77
|
+
"@aztec/foundation": "0.0.1-commit.3f296a7d2",
|
|
78
|
+
"@aztec/stdlib": "0.0.1-commit.3f296a7d2",
|
|
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;
|
|
@@ -42,55 +42,55 @@ PublicChecks: AztecAddress.fromBigInt(6n)
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
export const ProtocolContractDerivedAddress = {
|
|
45
|
-
AuthRegistry: AztecAddress.fromString('
|
|
46
|
-
ContractInstanceRegistry: AztecAddress.fromString('
|
|
47
|
-
ContractClassRegistry: AztecAddress.fromString('
|
|
48
|
-
MultiCallEntrypoint: AztecAddress.fromString('
|
|
49
|
-
FeeJuice: AztecAddress.fromString('
|
|
50
|
-
PublicChecks: AztecAddress.fromString('
|
|
45
|
+
AuthRegistry: AztecAddress.fromString('0x0a847d95021e6f94f477dbebbcce8464688e84723a75597b0083603b1ae31c34'),
|
|
46
|
+
ContractInstanceRegistry: AztecAddress.fromString('0x03a448eda542a33af13f56ddbdb7e21cd833ff5fd50565a66c5601e91236d7fe'),
|
|
47
|
+
ContractClassRegistry: AztecAddress.fromString('0x2c6630df9bc892ccf46898fbc2997aaafbf7f81430746c06d1f9ac3b632c5497'),
|
|
48
|
+
MultiCallEntrypoint: AztecAddress.fromString('0x0f51d97fdc7993e8a5dfa26f544804ff9c1a5473ae69988756a8d47ad5700f3b'),
|
|
49
|
+
FeeJuice: AztecAddress.fromString('0x27947b30bc7580789b60e4ae40865b438109af56fc191e2469b408541f92e715'),
|
|
50
|
+
PublicChecks: AztecAddress.fromString('0x169879de0a57ed33ff2f23ca169c3c49b001d417f896515c894a23984dd88644')
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
export const ProtocolContractClassId: Record<ProtocolContractName, Fr> = {
|
|
56
|
-
AuthRegistry: Fr.fromString('
|
|
57
|
-
ContractInstanceRegistry: Fr.fromString('
|
|
58
|
-
ContractClassRegistry: Fr.fromString('
|
|
59
|
-
MultiCallEntrypoint: Fr.fromString('
|
|
60
|
-
FeeJuice: Fr.fromString('
|
|
61
|
-
PublicChecks: Fr.fromString('
|
|
56
|
+
AuthRegistry: Fr.fromString('0x1cde63d00caee5994ee383fc5fd29d588b0df447c769120360d639ff43b5b15a'),
|
|
57
|
+
ContractInstanceRegistry: Fr.fromString('0x142f3a2323b5f6b3240a14a4e2536d75e6b452dfbfcb7cff59597dc5cfd61330'),
|
|
58
|
+
ContractClassRegistry: Fr.fromString('0x296951a1a1afd6b50de27be695bf18658a5e29a240e9940cf3ebfecc330b2d79'),
|
|
59
|
+
MultiCallEntrypoint: Fr.fromString('0x0024bc7e208259894179becc1fd0cac591463d0fc2f6fb6f52c0e1841aff2d48'),
|
|
60
|
+
FeeJuice: Fr.fromString('0x1d589a24ac67243d7d0bbddaf5713fbede6f82e365880d65599c6eef86ceae35'),
|
|
61
|
+
PublicChecks: Fr.fromString('0x27f4b06d10f954d26f2ba815a46436b96133a8bf5f7d972c6c16d38d7f7f6f67')
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
export const ProtocolContractClassIdPreimage: Record<ProtocolContractName, { artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }> = {
|
|
65
65
|
AuthRegistry: {
|
|
66
|
-
artifactHash: Fr.fromString('
|
|
66
|
+
artifactHash: Fr.fromString('0x19b8f6aa8fa60edcfebbed20c679361755501b1226aaac4b89856dd7d2e47b94'),
|
|
67
67
|
privateFunctionsRoot: Fr.fromString('0x11900a485e3ffa03da98d89abb0c9419200644aaf17f5caa863953fccf1ed88f'),
|
|
68
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
68
|
+
publicBytecodeCommitment: Fr.fromString('0x03fe8d2f7d592ab04300c1957d9e70f14af378235f73b0fc3ac6a59fecd4ee9d'),
|
|
69
69
|
},
|
|
70
70
|
ContractInstanceRegistry: {
|
|
71
|
-
artifactHash: Fr.fromString('
|
|
71
|
+
artifactHash: Fr.fromString('0x0680a32d61731ede431aea5f42e39865f2bcac4840ef35eb6a384ea1c2333603'),
|
|
72
72
|
privateFunctionsRoot: Fr.fromString('0x136a6705c7ad1d47f65cb881a56909d4c78d3fa8944f5b103734cd91e654ed63'),
|
|
73
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
73
|
+
publicBytecodeCommitment: Fr.fromString('0x173e23c6266b480c9222e2bbd3cc28ff158f8c988e80283de852f91b4bd855ea'),
|
|
74
74
|
},
|
|
75
75
|
ContractClassRegistry: {
|
|
76
|
-
artifactHash: Fr.fromString('
|
|
76
|
+
artifactHash: Fr.fromString('0x0a286a92191899cc74c555827329a3cca59f3f15d5ee300d5acf950d2e0de923'),
|
|
77
77
|
privateFunctionsRoot: Fr.fromString('0x2ac3bf890a7d534a768079aa86889caa1a86373c8e6fc2db48215b11bbb79106'),
|
|
78
78
|
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
79
79
|
},
|
|
80
80
|
MultiCallEntrypoint: {
|
|
81
|
-
artifactHash: Fr.fromString('
|
|
81
|
+
artifactHash: Fr.fromString('0x2674100736657625e47481e9d4542bb681620f33b84a296bace581c936ce307a'),
|
|
82
82
|
privateFunctionsRoot: Fr.fromString('0x266505ecb7c02ce6e227227c0b6bdb44713c8ecd43164ee7bb00b8fb340e8b03'),
|
|
83
83
|
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
84
84
|
},
|
|
85
85
|
FeeJuice: {
|
|
86
|
-
artifactHash: Fr.fromString('
|
|
86
|
+
artifactHash: Fr.fromString('0x28d487836ba903fd6fa81e899ebfc903c2f05f5add0d4d12256fcb1155426a92'),
|
|
87
87
|
privateFunctionsRoot: Fr.fromString('0x0abef3cfc6ae314886c841b42dc33d3eed255ad3dee7773daabf05b229573759'),
|
|
88
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
88
|
+
publicBytecodeCommitment: Fr.fromString('0x21e4b6d1450920af1d52a3cee46198ae52536c4a70dd8780c96bbc70911ba3ef'),
|
|
89
89
|
},
|
|
90
90
|
PublicChecks: {
|
|
91
|
-
artifactHash: Fr.fromString('
|
|
91
|
+
artifactHash: Fr.fromString('0x1b24eab5ea8e4714f917d25bbb5b2a9fa08405c6dd9b13e1956f0f9d38c75502'),
|
|
92
92
|
privateFunctionsRoot: Fr.fromString('0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1'),
|
|
93
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
93
|
+
publicBytecodeCommitment: Fr.fromString('0x123f9e2e26c424665a1958af5c04054bb489c8a4d2aa19af0c93ee9abe43a1ec'),
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
|
|
@@ -115,12 +115,12 @@ PublicChecks: []
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
export const ProtocolContractsList = new ProtocolContracts([
|
|
118
|
-
AztecAddress.fromString('
|
|
119
|
-
AztecAddress.fromString('
|
|
120
|
-
AztecAddress.fromString('
|
|
121
|
-
AztecAddress.fromString('
|
|
122
|
-
AztecAddress.fromString('
|
|
123
|
-
AztecAddress.fromString('
|
|
118
|
+
AztecAddress.fromString('0x0a847d95021e6f94f477dbebbcce8464688e84723a75597b0083603b1ae31c34'),
|
|
119
|
+
AztecAddress.fromString('0x03a448eda542a33af13f56ddbdb7e21cd833ff5fd50565a66c5601e91236d7fe'),
|
|
120
|
+
AztecAddress.fromString('0x2c6630df9bc892ccf46898fbc2997aaafbf7f81430746c06d1f9ac3b632c5497'),
|
|
121
|
+
AztecAddress.fromString('0x0f51d97fdc7993e8a5dfa26f544804ff9c1a5473ae69988756a8d47ad5700f3b'),
|
|
122
|
+
AztecAddress.fromString('0x27947b30bc7580789b60e4ae40865b438109af56fc191e2469b408541f92e715'),
|
|
123
|
+
AztecAddress.fromString('0x169879de0a57ed33ff2f23ca169c3c49b001d417f896515c894a23984dd88644'),
|
|
124
124
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
125
125
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
126
126
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
@@ -128,7 +128,7 @@ AztecAddress.fromString('0x00000000000000000000000000000000000000000000000000000
|
|
|
128
128
|
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
129
129
|
]);
|
|
130
130
|
|
|
131
|
-
export const protocolContractsHash = Fr.fromString('
|
|
131
|
+
export const protocolContractsHash = Fr.fromString('0x0155a997b9103364ee0c0d0ef58b44ad9d9bde98ab19e15bd5c2d268d34a05d5');
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
|
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');
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ARTIFACT_FUNCTION_TREE_MAX_HEIGHT, FUNCTION_TREE_HEIGHT } from '@aztec/constants';
|
|
2
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
-
import type { Tuple } from '@aztec/foundation/serialize';
|
|
4
|
-
import { FieldReader } from '@aztec/foundation/serialize';
|
|
5
|
-
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
6
|
-
import type { ExecutablePrivateFunctionWithMembershipProof, PrivateFunction } from '@aztec/stdlib/contract';
|
|
7
|
-
import type { ContractClassLog } from '@aztec/stdlib/logs';
|
|
8
|
-
/** Event emitted from the ContractClassRegistry. */
|
|
9
|
-
export declare class PrivateFunctionBroadcastedEvent {
|
|
10
|
-
readonly contractClassId: Fr;
|
|
11
|
-
readonly artifactMetadataHash: Fr;
|
|
12
|
-
readonly utilityFunctionsTreeRoot: Fr;
|
|
13
|
-
readonly privateFunctionTreeSiblingPath: Tuple<Fr, typeof FUNCTION_TREE_HEIGHT>;
|
|
14
|
-
readonly privateFunctionTreeLeafIndex: number;
|
|
15
|
-
readonly artifactFunctionTreeSiblingPath: Tuple<Fr, typeof ARTIFACT_FUNCTION_TREE_MAX_HEIGHT>;
|
|
16
|
-
readonly artifactFunctionTreeLeafIndex: number;
|
|
17
|
-
readonly privateFunction: BroadcastedPrivateFunction;
|
|
18
|
-
constructor(contractClassId: Fr, artifactMetadataHash: Fr, utilityFunctionsTreeRoot: Fr, privateFunctionTreeSiblingPath: Tuple<Fr, typeof FUNCTION_TREE_HEIGHT>, privateFunctionTreeLeafIndex: number, artifactFunctionTreeSiblingPath: Tuple<Fr, typeof ARTIFACT_FUNCTION_TREE_MAX_HEIGHT>, artifactFunctionTreeLeafIndex: number, privateFunction: BroadcastedPrivateFunction);
|
|
19
|
-
static isPrivateFunctionBroadcastedEvent(log: ContractClassLog): boolean;
|
|
20
|
-
static fromLog(log: ContractClassLog): PrivateFunctionBroadcastedEvent;
|
|
21
|
-
static fromFields(fields: Fr[] | FieldReader): PrivateFunctionBroadcastedEvent;
|
|
22
|
-
toFunctionWithMembershipProof(): ExecutablePrivateFunctionWithMembershipProof;
|
|
23
|
-
}
|
|
24
|
-
export declare class BroadcastedPrivateFunction implements PrivateFunction {
|
|
25
|
-
/** Selector of the function. Calculated as the hash of the method name and parameters. The specification of this is not enforced by the protocol. */
|
|
26
|
-
readonly selector: FunctionSelector;
|
|
27
|
-
/** Artifact metadata hash */
|
|
28
|
-
readonly metadataHash: Fr;
|
|
29
|
-
/** Hash of the verification key associated to this private function. */
|
|
30
|
-
readonly vkHash: Fr;
|
|
31
|
-
/** ACIR and Brillig bytecode */
|
|
32
|
-
readonly bytecode: Buffer;
|
|
33
|
-
constructor(
|
|
34
|
-
/** Selector of the function. Calculated as the hash of the method name and parameters. The specification of this is not enforced by the protocol. */
|
|
35
|
-
selector: FunctionSelector,
|
|
36
|
-
/** Artifact metadata hash */
|
|
37
|
-
metadataHash: Fr,
|
|
38
|
-
/** Hash of the verification key associated to this private function. */
|
|
39
|
-
vkHash: Fr,
|
|
40
|
-
/** ACIR and Brillig bytecode */
|
|
41
|
-
bytecode: Buffer);
|
|
42
|
-
static fromFields(fields: Fr[] | FieldReader): BroadcastedPrivateFunction;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9mdW5jdGlvbl9icm9hZGNhc3RlZF9ldmVudC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsYXNzLXJlZ2lzdHJ5L3ByaXZhdGVfZnVuY3Rpb25fYnJvYWRjYXN0ZWRfZXZlbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLGlDQUFpQyxFQUVqQyxvQkFBb0IsRUFFckIsTUFBTSxrQkFBa0IsQ0FBQztBQUMxQixPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDekQsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQzFELE9BQU8sRUFBRSxnQkFBZ0IsRUFBb0IsTUFBTSxtQkFBbUIsQ0FBQztBQUN2RSxPQUFPLEtBQUssRUFBRSw0Q0FBNEMsRUFBRSxlQUFlLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUM1RyxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBSTNELG9EQUFvRDtBQUNwRCxxQkFBYSwrQkFBK0I7YUFFeEIsZUFBZSxFQUFFLEVBQUU7YUFDbkIsb0JBQW9CLEVBQUUsRUFBRTthQUN4Qix3QkFBd0IsRUFBRSxFQUFFO2FBQzVCLDhCQUE4QixFQUFFLEtBQUssQ0FBQyxFQUFFLEVBQUUsT0FBTyxvQkFBb0IsQ0FBQzthQUN0RSw0QkFBNEIsRUFBRSxNQUFNO2FBQ3BDLCtCQUErQixFQUFFLEtBQUssQ0FBQyxFQUFFLEVBQUUsT0FBTyxpQ0FBaUMsQ0FBQzthQUNwRiw2QkFBNkIsRUFBRSxNQUFNO2FBQ3JDLGVBQWUsRUFBRSwwQkFBMEI7SUFSN0QsWUFDa0IsZUFBZSxFQUFFLEVBQUUsRUFDbkIsb0JBQW9CLEVBQUUsRUFBRSxFQUN4Qix3QkFBd0IsRUFBRSxFQUFFLEVBQzVCLDhCQUE4QixFQUFFLEtBQUssQ0FBQyxFQUFFLEVBQUUsT0FBTyxvQkFBb0IsQ0FBQyxFQUN0RSw0QkFBNEIsRUFBRSxNQUFNLEVBQ3BDLCtCQUErQixFQUFFLEtBQUssQ0FBQyxFQUFFLEVBQUUsT0FBTyxpQ0FBaUMsQ0FBQyxFQUNwRiw2QkFBNkIsRUFBRSxNQUFNLEVBQ3JDLGVBQWUsRUFBRSwwQkFBMEIsRUFDekQ7SUFFSixNQUFNLENBQUMsaUNBQWlDLENBQUMsR0FBRyxFQUFFLGdCQUFnQixXQUs3RDtJQUVELE1BQU0sQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLGdCQUFnQixtQ0FXbkM7SUFFRCxNQUFNLENBQUMsVUFBVSxDQUFDLE1BQU0sRUFBRSxFQUFFLEVBQUUsR0FBRyxXQUFXLG1DQXFCM0M7SUFFRCw2QkFBNkIsSUFBSSw0Q0FBNEMsQ0FZNUU7Q0FDRjtBQUVELHFCQUFhLDBCQUEyQixZQUFXLGVBQWU7SUFFOUQscUpBQXFKO2FBQ3JJLFFBQVEsRUFBRSxnQkFBZ0I7SUFDMUMsNkJBQTZCO2FBQ2IsWUFBWSxFQUFFLEVBQUU7SUFDaEMsd0VBQXdFO2FBQ3hELE1BQU0sRUFBRSxFQUFFO0lBQzFCLGdDQUFnQzthQUNoQixRQUFRLEVBQUUsTUFBTTtJQVJsQztJQUNFLHFKQUFxSjtJQUNySSxRQUFRLEVBQUUsZ0JBQWdCO0lBQzFDLDZCQUE2QjtJQUNiLFlBQVksRUFBRSxFQUFFO0lBQ2hDLHdFQUF3RTtJQUN4RCxNQUFNLEVBQUUsRUFBRTtJQUMxQixnQ0FBZ0M7SUFDaEIsUUFBUSxFQUFFLE1BQU0sRUFDOUI7SUFFSixNQUFNLENBQUMsVUFBVSxDQUFDLE1BQU0sRUFBRSxFQUFFLEVBQUUsR0FBRyxXQUFXLDhCQVMzQztDQUNGIn0=
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"private_function_broadcasted_event.d.ts","sourceRoot":"","sources":["../../src/class-registry/private_function_broadcasted_event.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EAEjC,oBAAoB,EAErB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EAAE,4CAA4C,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC5G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,oDAAoD;AACpD,qBAAa,+BAA+B;aAExB,eAAe,EAAE,EAAE;aACnB,oBAAoB,EAAE,EAAE;aACxB,wBAAwB,EAAE,EAAE;aAC5B,8BAA8B,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,oBAAoB,CAAC;aACtE,4BAA4B,EAAE,MAAM;aACpC,+BAA+B,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,iCAAiC,CAAC;aACpF,6BAA6B,EAAE,MAAM;aACrC,eAAe,EAAE,0BAA0B;IAR7D,YACkB,eAAe,EAAE,EAAE,EACnB,oBAAoB,EAAE,EAAE,EACxB,wBAAwB,EAAE,EAAE,EAC5B,8BAA8B,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,oBAAoB,CAAC,EACtE,4BAA4B,EAAE,MAAM,EACpC,+BAA+B,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,iCAAiC,CAAC,EACpF,6BAA6B,EAAE,MAAM,EACrC,eAAe,EAAE,0BAA0B,EACzD;IAEJ,MAAM,CAAC,iCAAiC,CAAC,GAAG,EAAE,gBAAgB,WAK7D;IAED,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,gBAAgB,mCAWnC;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,mCAqB3C;IAED,6BAA6B,IAAI,4CAA4C,CAY5E;CACF;AAED,qBAAa,0BAA2B,YAAW,eAAe;IAE9D,qJAAqJ;aACrI,QAAQ,EAAE,gBAAgB;IAC1C,6BAA6B;aACb,YAAY,EAAE,EAAE;IAChC,wEAAwE;aACxD,MAAM,EAAE,EAAE;IAC1B,gCAAgC;aAChB,QAAQ,EAAE,MAAM;IARlC;IACE,qJAAqJ;IACrI,QAAQ,EAAE,gBAAgB;IAC1C,6BAA6B;IACb,YAAY,EAAE,EAAE;IAChC,wEAAwE;IACxD,MAAM,EAAE,EAAE;IAC1B,gCAAgC;IAChB,QAAQ,EAAE,MAAM,EAC9B;IAEJ,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,8BAS3C;CACF"}
|