@aztec/protocol-contracts 0.0.1-commit.9ef841308 → 0.0.1-commit.a89ec08
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 +394 -5373
- package/artifacts/ContractClassRegistry.json +57 -2033
- package/artifacts/ContractInstanceRegistry.json +142 -2906
- package/artifacts/FeeJuice.json +139 -2993
- package/artifacts/MultiCallEntrypoint.json +573 -3657
- package/artifacts/PublicChecks.json +544 -3664
- package/dest/class-registry/contract_class_published_event.d.ts +1 -1
- package/dest/class-registry/contract_class_published_event.d.ts.map +1 -1
- package/dest/class-registry/contract_class_published_event.js +3 -1
- package/dest/class-registry/index.d.ts +3 -1
- package/dest/class-registry/index.d.ts.map +1 -1
- package/dest/class-registry/index.js +2 -0
- package/dest/class-registry/lazy.d.ts +3 -1
- package/dest/class-registry/lazy.d.ts.map +1 -1
- package/dest/class-registry/lazy.js +2 -0
- package/dest/class-registry/private_function_broadcasted_event.d.ts +44 -0
- package/dest/class-registry/private_function_broadcasted_event.d.ts.map +1 -0
- package/dest/class-registry/private_function_broadcasted_event.js +85 -0
- package/dest/class-registry/utility_function_broadcasted_event.d.ts +38 -0
- package/dest/class-registry/utility_function_broadcasted_event.d.ts.map +1 -0
- package/dest/class-registry/utility_function_broadcasted_event.js +81 -0
- package/dest/protocol_contract_data.js +37 -37
- package/dest/tests/fixtures.d.ts +3 -1
- package/dest/tests/fixtures.d.ts.map +1 -1
- package/dest/tests/fixtures.js +10 -0
- package/package.json +4 -4
- package/src/class-registry/contract_class_published_event.ts +2 -0
- package/src/class-registry/index.ts +2 -0
- package/src/class-registry/lazy.ts +2 -0
- package/src/class-registry/private_function_broadcasted_event.ts +109 -0
- package/src/class-registry/utility_function_broadcasted_event.ts +103 -0
- package/src/protocol_contract_data.ts +37 -37
- package/src/tests/fixtures.ts +12 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ARTIFACT_FUNCTION_TREE_MAX_HEIGHT,
|
|
3
|
+
CONTRACT_CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE,
|
|
4
|
+
FUNCTION_TREE_HEIGHT,
|
|
5
|
+
MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS,
|
|
6
|
+
} from '@aztec/constants';
|
|
7
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
|
+
import type { Tuple } from '@aztec/foundation/serialize';
|
|
9
|
+
import { FieldReader } from '@aztec/foundation/serialize';
|
|
10
|
+
import { FunctionSelector, bufferFromFields } from '@aztec/stdlib/abi';
|
|
11
|
+
import type { ExecutablePrivateFunctionWithMembershipProof, PrivateFunction } from '@aztec/stdlib/contract';
|
|
12
|
+
import type { ContractClassLog } from '@aztec/stdlib/logs';
|
|
13
|
+
|
|
14
|
+
import { ProtocolContractAddress } from '../protocol_contract_data.js';
|
|
15
|
+
|
|
16
|
+
/** Event emitted from the ContractClassRegistry. */
|
|
17
|
+
export class PrivateFunctionBroadcastedEvent {
|
|
18
|
+
constructor(
|
|
19
|
+
public readonly contractClassId: Fr,
|
|
20
|
+
public readonly artifactMetadataHash: Fr,
|
|
21
|
+
public readonly utilityFunctionsTreeRoot: Fr,
|
|
22
|
+
public readonly privateFunctionTreeSiblingPath: Tuple<Fr, typeof FUNCTION_TREE_HEIGHT>,
|
|
23
|
+
public readonly privateFunctionTreeLeafIndex: number,
|
|
24
|
+
public readonly artifactFunctionTreeSiblingPath: Tuple<Fr, typeof ARTIFACT_FUNCTION_TREE_MAX_HEIGHT>,
|
|
25
|
+
public readonly artifactFunctionTreeLeafIndex: number,
|
|
26
|
+
public readonly privateFunction: BroadcastedPrivateFunction,
|
|
27
|
+
) {}
|
|
28
|
+
|
|
29
|
+
static isPrivateFunctionBroadcastedEvent(log: ContractClassLog) {
|
|
30
|
+
return (
|
|
31
|
+
log.contractAddress.equals(ProtocolContractAddress.ContractClassRegistry) &&
|
|
32
|
+
log.fields.fields[0].toBigInt() === CONTRACT_CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static fromLog(log: ContractClassLog) {
|
|
37
|
+
const reader = new FieldReader(log.fields.fields.slice(1));
|
|
38
|
+
const event = PrivateFunctionBroadcastedEvent.fromFields(reader);
|
|
39
|
+
while (!reader.isFinished()) {
|
|
40
|
+
const field = reader.readField();
|
|
41
|
+
if (!field.isZero()) {
|
|
42
|
+
throw new Error(`Unexpected data after parsing PrivateFunctionBroadcastedEvent: ${field.toString()}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return event;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static fromFields(fields: Fr[] | FieldReader) {
|
|
50
|
+
const reader = FieldReader.asReader(fields);
|
|
51
|
+
const contractClassId = reader.readField();
|
|
52
|
+
const artifactMetadataHash = reader.readField();
|
|
53
|
+
const utilityFunctionsTreeRoot = reader.readField();
|
|
54
|
+
const privateFunctionTreeSiblingPath = reader.readFieldArray(FUNCTION_TREE_HEIGHT);
|
|
55
|
+
const privateFunctionTreeLeafIndex = reader.readField().toNumber();
|
|
56
|
+
const artifactFunctionTreeSiblingPath = reader.readFieldArray(ARTIFACT_FUNCTION_TREE_MAX_HEIGHT);
|
|
57
|
+
const artifactFunctionTreeLeafIndex = reader.readField().toNumber();
|
|
58
|
+
const privateFunction = BroadcastedPrivateFunction.fromFields(reader);
|
|
59
|
+
|
|
60
|
+
return new PrivateFunctionBroadcastedEvent(
|
|
61
|
+
contractClassId,
|
|
62
|
+
artifactMetadataHash,
|
|
63
|
+
utilityFunctionsTreeRoot,
|
|
64
|
+
privateFunctionTreeSiblingPath,
|
|
65
|
+
privateFunctionTreeLeafIndex,
|
|
66
|
+
artifactFunctionTreeSiblingPath,
|
|
67
|
+
artifactFunctionTreeLeafIndex,
|
|
68
|
+
privateFunction,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
toFunctionWithMembershipProof(): ExecutablePrivateFunctionWithMembershipProof {
|
|
73
|
+
return {
|
|
74
|
+
...this.privateFunction,
|
|
75
|
+
bytecode: this.privateFunction.bytecode,
|
|
76
|
+
functionMetadataHash: this.privateFunction.metadataHash,
|
|
77
|
+
artifactMetadataHash: this.artifactMetadataHash,
|
|
78
|
+
utilityFunctionsTreeRoot: this.utilityFunctionsTreeRoot,
|
|
79
|
+
privateFunctionTreeSiblingPath: this.privateFunctionTreeSiblingPath,
|
|
80
|
+
privateFunctionTreeLeafIndex: this.privateFunctionTreeLeafIndex,
|
|
81
|
+
artifactTreeSiblingPath: this.artifactFunctionTreeSiblingPath.filter(fr => !fr.isZero()),
|
|
82
|
+
artifactTreeLeafIndex: this.artifactFunctionTreeLeafIndex,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export class BroadcastedPrivateFunction implements PrivateFunction {
|
|
88
|
+
constructor(
|
|
89
|
+
/** Selector of the function. Calculated as the hash of the method name and parameters. The specification of this is not enforced by the protocol. */
|
|
90
|
+
public readonly selector: FunctionSelector,
|
|
91
|
+
/** Artifact metadata hash */
|
|
92
|
+
public readonly metadataHash: Fr,
|
|
93
|
+
/** Hash of the verification key associated to this private function. */
|
|
94
|
+
public readonly vkHash: Fr,
|
|
95
|
+
/** ACIR and Brillig bytecode */
|
|
96
|
+
public readonly bytecode: Buffer,
|
|
97
|
+
) {}
|
|
98
|
+
|
|
99
|
+
static fromFields(fields: Fr[] | FieldReader) {
|
|
100
|
+
const reader = FieldReader.asReader(fields);
|
|
101
|
+
const selector = FunctionSelector.fromField(reader.readField());
|
|
102
|
+
const metadataHash = reader.readField();
|
|
103
|
+
const vkHash = reader.readField();
|
|
104
|
+
// The '* 1' removes the 'Type instantiation is excessively deep and possibly infinite. ts(2589)' err
|
|
105
|
+
const encodedBytecode = reader.readFieldArray(MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS * 1);
|
|
106
|
+
const bytecode = bufferFromFields(encodedBytecode);
|
|
107
|
+
return new BroadcastedPrivateFunction(selector, metadataHash, vkHash, bytecode);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ARTIFACT_FUNCTION_TREE_MAX_HEIGHT,
|
|
3
|
+
CONTRACT_CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_MAGIC_VALUE,
|
|
4
|
+
MAX_PACKED_BYTECODE_SIZE_PER_UTILITY_FUNCTION_IN_FIELDS,
|
|
5
|
+
} from '@aztec/constants';
|
|
6
|
+
import { removeArrayPaddingEnd } from '@aztec/foundation/collection';
|
|
7
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
|
+
import type { Tuple } from '@aztec/foundation/serialize';
|
|
9
|
+
import { FieldReader } from '@aztec/foundation/serialize';
|
|
10
|
+
import { FunctionSelector, bufferFromFields } from '@aztec/stdlib/abi';
|
|
11
|
+
import type { UtilityFunction, UtilityFunctionWithMembershipProof } from '@aztec/stdlib/contract';
|
|
12
|
+
import type { ContractClassLog } from '@aztec/stdlib/logs';
|
|
13
|
+
|
|
14
|
+
import { ProtocolContractAddress } from '../protocol_contract_data.js';
|
|
15
|
+
|
|
16
|
+
/** Event emitted from the ContractClassRegistry. */
|
|
17
|
+
export class UtilityFunctionBroadcastedEvent {
|
|
18
|
+
constructor(
|
|
19
|
+
public readonly contractClassId: Fr,
|
|
20
|
+
public readonly artifactMetadataHash: Fr,
|
|
21
|
+
public readonly privateFunctionsArtifactTreeRoot: Fr,
|
|
22
|
+
public readonly artifactFunctionTreeSiblingPath: Tuple<Fr, typeof ARTIFACT_FUNCTION_TREE_MAX_HEIGHT>,
|
|
23
|
+
public readonly artifactFunctionTreeLeafIndex: number,
|
|
24
|
+
public readonly utilityFunction: BroadcastedUtilityFunction,
|
|
25
|
+
) {}
|
|
26
|
+
|
|
27
|
+
static isUtilityFunctionBroadcastedEvent(log: ContractClassLog) {
|
|
28
|
+
return (
|
|
29
|
+
log.contractAddress.equals(ProtocolContractAddress.ContractClassRegistry) &&
|
|
30
|
+
log.fields.fields[0].toBigInt() === CONTRACT_CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_MAGIC_VALUE
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static fromLog(log: ContractClassLog) {
|
|
35
|
+
const reader = new FieldReader(log.fields.fields.slice(1));
|
|
36
|
+
const event = UtilityFunctionBroadcastedEvent.fromFields(reader);
|
|
37
|
+
while (!reader.isFinished()) {
|
|
38
|
+
const field = reader.readField();
|
|
39
|
+
if (!field.isZero()) {
|
|
40
|
+
throw new Error(`Unexpected data after parsing UtilityFunctionBroadcastedEvent: ${field.toString()}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return event;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static fromFields(fields: Fr[] | FieldReader) {
|
|
48
|
+
const reader = FieldReader.asReader(fields);
|
|
49
|
+
const contractClassId = reader.readField();
|
|
50
|
+
const artifactMetadataHash = reader.readField();
|
|
51
|
+
const privateFunctionsArtifactTreeRoot = reader.readField();
|
|
52
|
+
const artifactFunctionTreeSiblingPath = reader.readFieldArray(ARTIFACT_FUNCTION_TREE_MAX_HEIGHT);
|
|
53
|
+
const artifactFunctionTreeLeafIndex = reader.readField().toNumber();
|
|
54
|
+
const utilityFunction = BroadcastedUtilityFunction.fromFields(reader);
|
|
55
|
+
|
|
56
|
+
return new UtilityFunctionBroadcastedEvent(
|
|
57
|
+
contractClassId,
|
|
58
|
+
artifactMetadataHash,
|
|
59
|
+
privateFunctionsArtifactTreeRoot,
|
|
60
|
+
artifactFunctionTreeSiblingPath,
|
|
61
|
+
artifactFunctionTreeLeafIndex,
|
|
62
|
+
utilityFunction,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
toFunctionWithMembershipProof(): UtilityFunctionWithMembershipProof {
|
|
67
|
+
// We should be able to safely remove the zero elements that pad the variable-length sibling path,
|
|
68
|
+
// since a sibling with value zero can only occur on the tree leaves, so the sibling path will never end
|
|
69
|
+
// in a zero. The only exception is a tree with depth 2 with one non-zero leaf, where the sibling path would
|
|
70
|
+
// be a single zero element, but in that case the artifact tree should be just the single leaf.
|
|
71
|
+
const artifactTreeSiblingPath = removeArrayPaddingEnd(this.artifactFunctionTreeSiblingPath, Fr.isZero);
|
|
72
|
+
return {
|
|
73
|
+
...this.utilityFunction,
|
|
74
|
+
bytecode: this.utilityFunction.bytecode,
|
|
75
|
+
functionMetadataHash: this.utilityFunction.metadataHash,
|
|
76
|
+
artifactMetadataHash: this.artifactMetadataHash,
|
|
77
|
+
privateFunctionsArtifactTreeRoot: this.privateFunctionsArtifactTreeRoot,
|
|
78
|
+
artifactTreeSiblingPath,
|
|
79
|
+
artifactTreeLeafIndex: this.artifactFunctionTreeLeafIndex,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export class BroadcastedUtilityFunction implements UtilityFunction {
|
|
85
|
+
constructor(
|
|
86
|
+
/** Selector of the function. Calculated as the hash of the method name and parameters. The specification of this is not enforced by the protocol. */
|
|
87
|
+
public readonly selector: FunctionSelector,
|
|
88
|
+
/** Artifact metadata hash */
|
|
89
|
+
public readonly metadataHash: Fr,
|
|
90
|
+
/** Brillig bytecode */
|
|
91
|
+
public readonly bytecode: Buffer,
|
|
92
|
+
) {}
|
|
93
|
+
|
|
94
|
+
static fromFields(fields: Fr[] | FieldReader) {
|
|
95
|
+
const reader = FieldReader.asReader(fields);
|
|
96
|
+
const selector = FunctionSelector.fromField(reader.readField());
|
|
97
|
+
const metadataHash = reader.readField();
|
|
98
|
+
// The '* 1' removes the 'Type instantiation is excessively deep and possibly infinite. ts(2589)' err
|
|
99
|
+
const encodedBytecode = reader.readFieldArray(MAX_PACKED_BYTECODE_SIZE_PER_UTILITY_FUNCTION_IN_FIELDS * 1);
|
|
100
|
+
const bytecode = bufferFromFields(encodedBytecode);
|
|
101
|
+
return new BroadcastedUtilityFunction(selector, metadataHash, bytecode);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -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('
|
|
72
|
-
privateFunctionsRoot: Fr.fromString('
|
|
73
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
71
|
+
artifactHash: Fr.fromString('0x18601566bacdca7a5a40528f221b04ee7b74f382e6cd34fbdf69d31c50d5ee88'),
|
|
72
|
+
privateFunctionsRoot: Fr.fromString('0x136a6705c7ad1d47f65cb881a56909d4c78d3fa8944f5b103734cd91e654ed63'),
|
|
73
|
+
publicBytecodeCommitment: Fr.fromString('0x01c573f470ba9a17d362c7dd5a28931c39432f9ce527555049c71432f895ad6c'),
|
|
74
74
|
},
|
|
75
75
|
ContractClassRegistry: {
|
|
76
|
-
artifactHash: Fr.fromString('
|
|
77
|
-
privateFunctionsRoot: Fr.fromString('
|
|
76
|
+
artifactHash: Fr.fromString('0x232d868db8a4d1e0f013efa4bfe5c39d96e11f16a62e3e73abbbafc3028fc410'),
|
|
77
|
+
privateFunctionsRoot: Fr.fromString('0x2ac3bf890a7d534a768079aa86889caa1a86373c8e6fc2db48215b11bbb79106'),
|
|
78
78
|
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
79
79
|
},
|
|
80
80
|
MultiCallEntrypoint: {
|
|
81
|
-
artifactHash: Fr.fromString('
|
|
82
|
-
privateFunctionsRoot: Fr.fromString('
|
|
81
|
+
artifactHash: Fr.fromString('0x0d30526b6b786cf887d7e44ba59d2e9561d5791b0e3c78c681d0499ae45b225a'),
|
|
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,10 +104,10 @@ 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('
|
|
108
|
-
ContractInstanceRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000016ec12aa')), vkHash: Fr.fromString('
|
|
109
|
-
ContractClassRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x000000000000000000000000000000000000000000000000000000006934ed0d')), vkHash: Fr.fromString('
|
|
110
|
-
MultiCallEntrypoint: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000f04908a9')), vkHash: Fr.fromString('
|
|
107
|
+
AuthRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000079a3d418')), vkHash: Fr.fromString('0x019c553854290b9b547841e45bf45e344d4a2d4f6702fee430ec5897ce7d3b78') }],
|
|
108
|
+
ContractInstanceRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000016ec12aa')), vkHash: Fr.fromString('0x262f7a90ecf055779001b67dad01a3add1e549f6c27931f0e71e463ce2142b57') }],
|
|
109
|
+
ContractClassRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x000000000000000000000000000000000000000000000000000000006934ed0d')), vkHash: Fr.fromString('0x1163f31e191528254c877fce0c7f62dd738f5552bbd2dda97512fe4777377f5b') }],
|
|
110
|
+
MultiCallEntrypoint: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000f04908a9')), vkHash: Fr.fromString('0x21732ab3cecf633e4c31a030df62c93e35a005b89941fdab568d2818c1355192') }],
|
|
111
111
|
FeeJuice: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000cbe67243')), vkHash: Fr.fromString('0x2ad6083b4595f8076c014e5152191013167ab1b5a31ad0cbb06490054c7c59ae') }, { selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000e8d374b6')), vkHash: Fr.fromString('0x05aaffffdf797625ff24575d939339303775c5db77fb6bdcecbf955f726fd071') }],
|
|
112
112
|
PublicChecks: []
|
|
113
113
|
};
|
|
@@ -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
|
|
package/src/tests/fixtures.ts
CHANGED
|
@@ -8,6 +8,18 @@ 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
|
+
|
|
11
23
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
12
24
|
export function getSampleContractInstancePublishedEventPayload(): Buffer {
|
|
13
25
|
const path = getPathToFixture('ContractInstancePublishedEventData.hex');
|