@aztec/protocol-contracts 0.0.1-commit.ffe5b04ea → 0.0.1-commit.fff30aa
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 +242 -1023
- package/artifacts/ContractClassRegistry.json +36 -36
- package/artifacts/ContractInstanceRegistry.json +62 -58
- package/artifacts/FeeJuice.json +53 -61
- package/artifacts/MultiCallEntrypoint.json +67 -87
- package/artifacts/PublicChecks.json +67 -87
- 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 +9 -13
- package/dest/protocol_contract_data.js +31 -31
- package/package.json +4 -4
- package/src/class-registry/contract_class_published_event.ts +10 -19
- package/src/protocol_contract_data.ts +31 -31
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3RfY2xhc3NfcHVibGlzaGVkX2V2ZW50LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xhc3MtcmVnaXN0cnkvY29udHJhY3RfY2xhc3NfcHVibGlzaGVkX2V2ZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUdwRCxPQUFPLEVBQ0wsS0FBSyxtQkFBbUIsRUFDeEIsS0FBSyxpQ0FBaUMsRUFFdkMsTUFBTSx3QkFBd0IsQ0FBQztBQUNoQyxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBSTNELG9EQUFvRDtBQUNwRCxxQkFBYSwyQkFBMkI7YUFFcEIsZUFBZSxFQUFFLEVBQUU7YUFDbkIsT0FBTyxFQUFFLE1BQU07YUFDZixZQUFZLEVBQUUsRUFBRTthQUNoQixvQkFBb0IsRUFBRSxFQUFFO2FBQ3hCLG9CQUFvQixFQUFFLE1BQU07SUFMOUMsWUFDa0IsZUFBZSxFQUFFLEVBQUUsRUFDbkIsT0FBTyxFQUFFLE1BQU0sRUFDZixZQUFZLEVBQUUsRUFBRSxFQUNoQixvQkFBb0IsRUFBRSxFQUFFLEVBQ3hCLG9CQUFvQixFQUFFLE1BQU0sRUFDMUM7SUFFSixNQUFNLENBQUMsNkJBQTZCLENBQUMsR0FBRyxFQUFFLGdCQUFnQixXQUt6RDtJQUVELE1BQU0sQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLGdCQUFnQiwrQkFpQm5DO0lBRUQsdUdBQXVHO0lBQ3ZHLHFCQUFxQixJQUFJLG1CQUFtQixDQVUzQztJQUVELHVGQUF1RjtJQUNqRiwyQ0FBMkMsSUFBSSxPQUFPLENBQUMsaUNBQWlDLENBQUMsQ0FHOUY7SUFFRCxPQUFjLDBCQUEwQixDQUFDLElBQUksRUFBRSxnQkFBZ0IsRUFBRSxHQUFHLDJCQUEyQixFQUFFLENBSWhHO0NBQ0YifQ==
|
|
@@ -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,CAU3C;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,18 +30,7 @@ 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,
|
|
@@ -52,6 +41,13 @@ import { ProtocolContractAddress } from '../protocol_contract_data.js';
|
|
|
52
41
|
utilityFunctions: []
|
|
53
42
|
};
|
|
54
43
|
}
|
|
44
|
+
/** Converts the event to a contract class with its bytecode commitment (expensive). */ async toContractClassPublicWithBytecodeCommitment() {
|
|
45
|
+
const publicBytecodeCommitment = await computePublicBytecodeCommitment(this.packedPublicBytecode);
|
|
46
|
+
return {
|
|
47
|
+
...this.toContractClassPublic(),
|
|
48
|
+
publicBytecodeCommitment
|
|
49
|
+
};
|
|
50
|
+
}
|
|
55
51
|
static extractContractClassEvents(logs) {
|
|
56
52
|
return logs.filter((log)=>ContractClassPublishedEvent.isContractClassPublishedEvent(log)).map((log)=>ContractClassPublishedEvent.fromLog(log));
|
|
57
53
|
}
|
|
@@ -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('0x139f8eb6d6e7e7a7c0322c3b7558687a7e24201f11bf2c4cb2fe56c18d363695'),
|
|
32
|
+
ContractInstanceRegistry: AztecAddress.fromString('0x1254246c88aca5a66fa66f3aa78c408a698ebca3b713120497c7555dfc718592'),
|
|
33
|
+
ContractClassRegistry: AztecAddress.fromString('0x14d670efa326a07b99777b01fb706427ca776095246569150f2a3f17a7d4dc66'),
|
|
34
|
+
MultiCallEntrypoint: AztecAddress.fromString('0x230d0b47ba6d5ed99afb89d584f32ff33438b64f51000f252a140cf995781628'),
|
|
35
|
+
FeeJuice: AztecAddress.fromString('0x204913186c0dd70015d05bf9100a12e31ccb7cc2527aacdfae0c19ad6439fcf4'),
|
|
36
|
+
PublicChecks: AztecAddress.fromString('0x1198142fd84a58c0ab22d5fde371ce527042db49487e05206a326ad154952ac8')
|
|
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('0x17ad10e1b5dba2877b9a973449c03d5227f2c719c0eb1989427c10c1d83867a5'),
|
|
40
|
+
ContractInstanceRegistry: Fr.fromString('0x187c710b0d69b2da7a6f0663c15093a5d595c04e77762c249aa9b654bc12158c'),
|
|
41
|
+
ContractClassRegistry: Fr.fromString('0x013466b8a65dea98ad80c119cf236a0acf53acfede687769410cfd57876b8242'),
|
|
42
|
+
MultiCallEntrypoint: Fr.fromString('0x1acd7ab8bf186c16eafc9c4fe9049f35df27e172bb2d8319a2a22ddd0006966d'),
|
|
43
|
+
FeeJuice: Fr.fromString('0x16b2d5ef5044c11126a16ccdb3778082eb423375977da9458d493fdf84505e81'),
|
|
44
|
+
PublicChecks: Fr.fromString('0x03f2ebaef8d692422185e35d8fe35d0bb7289702cf023b525c022d77fc6b5ed5')
|
|
45
45
|
};
|
|
46
46
|
export const ProtocolContractClassIdPreimage = {
|
|
47
47
|
AuthRegistry: {
|
|
48
|
-
artifactHash: Fr.fromString('
|
|
49
|
-
privateFunctionsRoot: Fr.fromString('
|
|
50
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
48
|
+
artifactHash: Fr.fromString('0x029f3b5582e9e2f9cddb4f887fa67c06d8dbe9aef604aa7de91a6f5328bf477c'),
|
|
49
|
+
privateFunctionsRoot: Fr.fromString('0x0826df9bf86cf460935b2bd024edcb5a58532fcf0392abbdb33f5f2150753756'),
|
|
50
|
+
publicBytecodeCommitment: Fr.fromString('0x22db1f0a70bfefaf90371c7728e558cf60507b718e99ed276ed3143bec615f6f')
|
|
51
51
|
},
|
|
52
52
|
ContractInstanceRegistry: {
|
|
53
|
-
artifactHash: Fr.fromString('
|
|
53
|
+
artifactHash: Fr.fromString('0x18601566bacdca7a5a40528f221b04ee7b74f382e6cd34fbdf69d31c50d5ee88'),
|
|
54
54
|
privateFunctionsRoot: Fr.fromString('0x136a6705c7ad1d47f65cb881a56909d4c78d3fa8944f5b103734cd91e654ed63'),
|
|
55
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
55
|
+
publicBytecodeCommitment: Fr.fromString('0x01c573f470ba9a17d362c7dd5a28931c39432f9ce527555049c71432f895ad6c')
|
|
56
56
|
},
|
|
57
57
|
ContractClassRegistry: {
|
|
58
|
-
artifactHash: Fr.fromString('
|
|
58
|
+
artifactHash: Fr.fromString('0x232d868db8a4d1e0f013efa4bfe5c39d96e11f16a62e3e73abbbafc3028fc410'),
|
|
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('0x0d30526b6b786cf887d7e44ba59d2e9561d5791b0e3c78c681d0499ae45b225a'),
|
|
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('0x2eb476f12cce5207be118047fb7f603378b78aa619d6539a4d9eec4700ea2507'),
|
|
69
69
|
privateFunctionsRoot: Fr.fromString('0x0abef3cfc6ae314886c841b42dc33d3eed255ad3dee7773daabf05b229573759'),
|
|
70
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
70
|
+
publicBytecodeCommitment: Fr.fromString('0x2a144b28b36efa21b7488467aba7e06b33e016d00bfe083a7bfa06ad6ff5aa2f')
|
|
71
71
|
},
|
|
72
72
|
PublicChecks: {
|
|
73
|
-
artifactHash: Fr.fromString('
|
|
73
|
+
artifactHash: Fr.fromString('0x228ea8af66ff150f40a4b01b64115d12777b2f7fd3a4bfc0d97d38a91f139ef6'),
|
|
74
74
|
privateFunctionsRoot: Fr.fromString('0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1'),
|
|
75
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
75
|
+
publicBytecodeCommitment: Fr.fromString('0x2d0834fc9468fd2092091852543a2fbd7b6b313c7e5e4defe8730c8065366a03')
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
export const ProtocolContractInitializationHash = {
|
|
@@ -87,7 +87,7 @@ export const ProtocolContractPrivateFunctions = {
|
|
|
87
87
|
AuthRegistry: [
|
|
88
88
|
{
|
|
89
89
|
selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000079a3d418')),
|
|
90
|
-
vkHash: Fr.fromString('
|
|
90
|
+
vkHash: Fr.fromString('0x019c553854290b9b547841e45bf45e344d4a2d4f6702fee430ec5897ce7d3b78')
|
|
91
91
|
}
|
|
92
92
|
],
|
|
93
93
|
ContractInstanceRegistry: [
|
|
@@ -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('0x139f8eb6d6e7e7a7c0322c3b7558687a7e24201f11bf2c4cb2fe56c18d363695'),
|
|
125
|
+
AztecAddress.fromString('0x1254246c88aca5a66fa66f3aa78c408a698ebca3b713120497c7555dfc718592'),
|
|
126
|
+
AztecAddress.fromString('0x14d670efa326a07b99777b01fb706427ca776095246569150f2a3f17a7d4dc66'),
|
|
127
|
+
AztecAddress.fromString('0x230d0b47ba6d5ed99afb89d584f32ff33438b64f51000f252a140cf995781628'),
|
|
128
|
+
AztecAddress.fromString('0x204913186c0dd70015d05bf9100a12e31ccb7cc2527aacdfae0c19ad6439fcf4'),
|
|
129
|
+
AztecAddress.fromString('0x1198142fd84a58c0ab22d5fde371ce527042db49487e05206a326ad154952ac8'),
|
|
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('0x2672340d9a0107a7b81e6d10d25b854debe613f3272e8738e8df0ca2ff297141');
|
|
137
137
|
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('0x1a7e1badb79abdd38c684b3c8306ffe7ecb33c69e3380d9855730aaaa83a21a8');
|
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.fff30aa",
|
|
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.fff30aa",
|
|
77
|
+
"@aztec/foundation": "0.0.1-commit.fff30aa",
|
|
78
|
+
"@aztec/stdlib": "0.0.1-commit.fff30aa",
|
|
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,25 @@ 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,
|
|
57
|
+
version: this.version as 1,
|
|
73
58
|
privateFunctions: [],
|
|
74
59
|
utilityFunctions: [],
|
|
75
60
|
};
|
|
76
61
|
}
|
|
77
62
|
|
|
63
|
+
/** Converts the event to a contract class with its bytecode commitment (expensive). */
|
|
64
|
+
async toContractClassPublicWithBytecodeCommitment(): Promise<ContractClassPublicWithCommitment> {
|
|
65
|
+
const publicBytecodeCommitment = await computePublicBytecodeCommitment(this.packedPublicBytecode);
|
|
66
|
+
return { ...this.toContractClassPublic(), publicBytecodeCommitment };
|
|
67
|
+
}
|
|
68
|
+
|
|
78
69
|
public static extractContractClassEvents(logs: ContractClassLog[]): ContractClassPublishedEvent[] {
|
|
79
70
|
return logs
|
|
80
71
|
.filter((log: ContractClassLog) => ContractClassPublishedEvent.isContractClassPublishedEvent(log))
|
|
@@ -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('0x139f8eb6d6e7e7a7c0322c3b7558687a7e24201f11bf2c4cb2fe56c18d363695'),
|
|
46
|
+
ContractInstanceRegistry: AztecAddress.fromString('0x1254246c88aca5a66fa66f3aa78c408a698ebca3b713120497c7555dfc718592'),
|
|
47
|
+
ContractClassRegistry: AztecAddress.fromString('0x14d670efa326a07b99777b01fb706427ca776095246569150f2a3f17a7d4dc66'),
|
|
48
|
+
MultiCallEntrypoint: AztecAddress.fromString('0x230d0b47ba6d5ed99afb89d584f32ff33438b64f51000f252a140cf995781628'),
|
|
49
|
+
FeeJuice: AztecAddress.fromString('0x204913186c0dd70015d05bf9100a12e31ccb7cc2527aacdfae0c19ad6439fcf4'),
|
|
50
|
+
PublicChecks: AztecAddress.fromString('0x1198142fd84a58c0ab22d5fde371ce527042db49487e05206a326ad154952ac8')
|
|
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('0x17ad10e1b5dba2877b9a973449c03d5227f2c719c0eb1989427c10c1d83867a5'),
|
|
57
|
+
ContractInstanceRegistry: Fr.fromString('0x187c710b0d69b2da7a6f0663c15093a5d595c04e77762c249aa9b654bc12158c'),
|
|
58
|
+
ContractClassRegistry: Fr.fromString('0x013466b8a65dea98ad80c119cf236a0acf53acfede687769410cfd57876b8242'),
|
|
59
|
+
MultiCallEntrypoint: Fr.fromString('0x1acd7ab8bf186c16eafc9c4fe9049f35df27e172bb2d8319a2a22ddd0006966d'),
|
|
60
|
+
FeeJuice: Fr.fromString('0x16b2d5ef5044c11126a16ccdb3778082eb423375977da9458d493fdf84505e81'),
|
|
61
|
+
PublicChecks: Fr.fromString('0x03f2ebaef8d692422185e35d8fe35d0bb7289702cf023b525c022d77fc6b5ed5')
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
export const ProtocolContractClassIdPreimage: Record<ProtocolContractName, { artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }> = {
|
|
65
65
|
AuthRegistry: {
|
|
66
|
-
artifactHash: Fr.fromString('
|
|
67
|
-
privateFunctionsRoot: Fr.fromString('
|
|
68
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
66
|
+
artifactHash: Fr.fromString('0x029f3b5582e9e2f9cddb4f887fa67c06d8dbe9aef604aa7de91a6f5328bf477c'),
|
|
67
|
+
privateFunctionsRoot: Fr.fromString('0x0826df9bf86cf460935b2bd024edcb5a58532fcf0392abbdb33f5f2150753756'),
|
|
68
|
+
publicBytecodeCommitment: Fr.fromString('0x22db1f0a70bfefaf90371c7728e558cf60507b718e99ed276ed3143bec615f6f'),
|
|
69
69
|
},
|
|
70
70
|
ContractInstanceRegistry: {
|
|
71
|
-
artifactHash: Fr.fromString('
|
|
71
|
+
artifactHash: Fr.fromString('0x18601566bacdca7a5a40528f221b04ee7b74f382e6cd34fbdf69d31c50d5ee88'),
|
|
72
72
|
privateFunctionsRoot: Fr.fromString('0x136a6705c7ad1d47f65cb881a56909d4c78d3fa8944f5b103734cd91e654ed63'),
|
|
73
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
73
|
+
publicBytecodeCommitment: Fr.fromString('0x01c573f470ba9a17d362c7dd5a28931c39432f9ce527555049c71432f895ad6c'),
|
|
74
74
|
},
|
|
75
75
|
ContractClassRegistry: {
|
|
76
|
-
artifactHash: Fr.fromString('
|
|
76
|
+
artifactHash: Fr.fromString('0x232d868db8a4d1e0f013efa4bfe5c39d96e11f16a62e3e73abbbafc3028fc410'),
|
|
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('0x0d30526b6b786cf887d7e44ba59d2e9561d5791b0e3c78c681d0499ae45b225a'),
|
|
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('0x2eb476f12cce5207be118047fb7f603378b78aa619d6539a4d9eec4700ea2507'),
|
|
87
87
|
privateFunctionsRoot: Fr.fromString('0x0abef3cfc6ae314886c841b42dc33d3eed255ad3dee7773daabf05b229573759'),
|
|
88
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
88
|
+
publicBytecodeCommitment: Fr.fromString('0x2a144b28b36efa21b7488467aba7e06b33e016d00bfe083a7bfa06ad6ff5aa2f'),
|
|
89
89
|
},
|
|
90
90
|
PublicChecks: {
|
|
91
|
-
artifactHash: Fr.fromString('
|
|
91
|
+
artifactHash: Fr.fromString('0x228ea8af66ff150f40a4b01b64115d12777b2f7fd3a4bfc0d97d38a91f139ef6'),
|
|
92
92
|
privateFunctionsRoot: Fr.fromString('0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1'),
|
|
93
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
93
|
+
publicBytecodeCommitment: Fr.fromString('0x2d0834fc9468fd2092091852543a2fbd7b6b313c7e5e4defe8730c8065366a03'),
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
|
|
@@ -104,7 +104,7 @@ PublicChecks: Fr.fromString('0x0000000000000000000000000000000000000000000000000
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
export const ProtocolContractPrivateFunctions: Record<ProtocolContractName, { selector: FunctionSelector; vkHash: Fr }[]> = {
|
|
107
|
-
AuthRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000079a3d418')), vkHash: Fr.fromString('
|
|
107
|
+
AuthRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000079a3d418')), vkHash: Fr.fromString('0x019c553854290b9b547841e45bf45e344d4a2d4f6702fee430ec5897ce7d3b78') }],
|
|
108
108
|
ContractInstanceRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000016ec12aa')), vkHash: Fr.fromString('0x262f7a90ecf055779001b67dad01a3add1e549f6c27931f0e71e463ce2142b57') }],
|
|
109
109
|
ContractClassRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x000000000000000000000000000000000000000000000000000000006934ed0d')), vkHash: Fr.fromString('0x1163f31e191528254c877fce0c7f62dd738f5552bbd2dda97512fe4777377f5b') }],
|
|
110
110
|
MultiCallEntrypoint: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000f04908a9')), vkHash: Fr.fromString('0x21732ab3cecf633e4c31a030df62c93e35a005b89941fdab568d2818c1355192') }],
|
|
@@ -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('0x139f8eb6d6e7e7a7c0322c3b7558687a7e24201f11bf2c4cb2fe56c18d363695'),
|
|
119
|
+
AztecAddress.fromString('0x1254246c88aca5a66fa66f3aa78c408a698ebca3b713120497c7555dfc718592'),
|
|
120
|
+
AztecAddress.fromString('0x14d670efa326a07b99777b01fb706427ca776095246569150f2a3f17a7d4dc66'),
|
|
121
|
+
AztecAddress.fromString('0x230d0b47ba6d5ed99afb89d584f32ff33438b64f51000f252a140cf995781628'),
|
|
122
|
+
AztecAddress.fromString('0x204913186c0dd70015d05bf9100a12e31ccb7cc2527aacdfae0c19ad6439fcf4'),
|
|
123
|
+
AztecAddress.fromString('0x1198142fd84a58c0ab22d5fde371ce527042db49487e05206a326ad154952ac8'),
|
|
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('0x2672340d9a0107a7b81e6d10d25b854debe613f3272e8738e8df0ca2ff297141');
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
|