@aztec/protocol-contracts 5.0.0-private.20260319 → 5.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/ContractClassRegistry.json +2592 -460
- package/artifacts/ContractInstanceRegistry.json +3491 -936
- package/artifacts/FeeJuice.json +3798 -943
- 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 +17 -17
- package/dest/class-registry/index.d.ts +1 -3
- package/dest/class-registry/index.d.ts.map +1 -1
- package/dest/class-registry/index.js +0 -2
- package/dest/class-registry/lazy.d.ts +1 -3
- package/dest/class-registry/lazy.d.ts.map +1 -1
- package/dest/class-registry/lazy.js +1 -3
- package/dest/fee-juice/lazy.js +1 -1
- package/dest/instance-registry/contract_instance_published_event.d.ts +3 -2
- package/dest/instance-registry/contract_instance_published_event.d.ts.map +1 -1
- package/dest/instance-registry/contract_instance_published_event.js +7 -3
- package/dest/instance-registry/lazy.js +1 -1
- package/dest/make_protocol_contract.d.ts +1 -1
- package/dest/make_protocol_contract.d.ts.map +1 -1
- package/dest/make_protocol_contract.js +3 -1
- package/dest/protocol_contract.d.ts +4 -1
- package/dest/protocol_contract.d.ts.map +1 -1
- package/dest/protocol_contract.js +5 -1
- package/dest/protocol_contract_data.d.ts +2 -5
- package/dest/protocol_contract_data.d.ts.map +1 -1
- package/dest/protocol_contract_data.js +38 -84
- package/dest/provider/bundle.d.ts +1 -1
- package/dest/provider/bundle.d.ts.map +1 -1
- package/dest/provider/bundle.js +1 -7
- package/dest/provider/lazy.d.ts +1 -1
- package/dest/provider/lazy.d.ts.map +1 -1
- package/dest/provider/lazy.js +0 -9
- package/dest/scripts/generate_data.js +8 -10
- package/dest/tests/fixtures.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 +16 -22
- package/src/class-registry/index.ts +0 -2
- package/src/class-registry/lazy.ts +1 -3
- package/src/fee-juice/lazy.ts +1 -1
- package/src/instance-registry/contract_instance_published_event.ts +5 -1
- package/src/instance-registry/lazy.ts +1 -1
- package/src/make_protocol_contract.ts +3 -1
- package/src/protocol_contract.ts +9 -1
- package/src/protocol_contract_data.ts +39 -75
- package/src/provider/bundle.ts +0 -6
- package/src/provider/lazy.ts +0 -9
- package/src/tests/fixtures.ts +0 -12
- package/artifacts/AuthRegistry.d.json.ts +0 -5
- package/artifacts/AuthRegistry.json +0 -3713
- package/artifacts/MultiCallEntrypoint.d.json.ts +0 -5
- package/artifacts/MultiCallEntrypoint.json +0 -2961
- package/artifacts/PublicChecks.d.json.ts +0 -5
- package/artifacts/PublicChecks.json +0 -1172
- package/dest/auth-registry/index.d.ts +0 -6
- package/dest/auth-registry/index.d.ts.map +0 -1
- package/dest/auth-registry/index.js +0 -13
- package/dest/auth-registry/lazy.d.ts +0 -6
- package/dest/auth-registry/lazy.d.ts.map +0 -1
- package/dest/auth-registry/lazy.js +0 -23
- package/dest/class-registry/private_function_broadcasted_event.d.ts +0 -44
- package/dest/class-registry/private_function_broadcasted_event.d.ts.map +0 -1
- package/dest/class-registry/private_function_broadcasted_event.js +0 -85
- package/dest/class-registry/utility_function_broadcasted_event.d.ts +0 -38
- package/dest/class-registry/utility_function_broadcasted_event.d.ts.map +0 -1
- package/dest/class-registry/utility_function_broadcasted_event.js +0 -81
- package/dest/multi-call-entrypoint/index.d.ts +0 -5
- package/dest/multi-call-entrypoint/index.d.ts.map +0 -1
- package/dest/multi-call-entrypoint/index.js +0 -13
- package/dest/multi-call-entrypoint/lazy.d.ts +0 -6
- package/dest/multi-call-entrypoint/lazy.d.ts.map +0 -1
- package/dest/multi-call-entrypoint/lazy.js +0 -23
- package/dest/public-checks/index.d.ts +0 -5
- package/dest/public-checks/index.d.ts.map +0 -1
- package/dest/public-checks/index.js +0 -13
- package/dest/public-checks/lazy.d.ts +0 -6
- package/dest/public-checks/lazy.d.ts.map +0 -1
- package/dest/public-checks/lazy.js +0 -23
- package/src/auth-registry/index.ts +0 -18
- package/src/auth-registry/lazy.ts +0 -29
- package/src/class-registry/private_function_broadcasted_event.ts +0 -109
- package/src/class-registry/utility_function_broadcasted_event.ts +0 -103
- package/src/multi-call-entrypoint/index.ts +0 -18
- package/src/multi-call-entrypoint/lazy.ts +0 -29
- package/src/public-checks/index.ts +0 -18
- package/src/public-checks/lazy.ts +0 -29
package/dest/provider/lazy.js
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { getCanonicalAuthRegistry } from '../auth-registry/lazy.js';
|
|
2
1
|
import { getCanonicalClassRegistry } from '../class-registry/lazy.js';
|
|
3
2
|
import { getCanonicalFeeJuice } from '../fee-juice/lazy.js';
|
|
4
3
|
import { getCanonicalInstanceRegistry } from '../instance-registry/lazy.js';
|
|
5
|
-
import { getCanonicalMultiCallEntrypoint } from '../multi-call-entrypoint/lazy.js';
|
|
6
|
-
import { getCanonicalPublicChecks } from '../public-checks/lazy.js';
|
|
7
4
|
export class LazyProtocolContractsProvider {
|
|
8
5
|
getProtocolContractArtifact(name) {
|
|
9
6
|
switch(name){
|
|
10
|
-
case 'AuthRegistry':
|
|
11
|
-
return getCanonicalAuthRegistry();
|
|
12
7
|
case 'ContractInstanceRegistry':
|
|
13
8
|
return getCanonicalInstanceRegistry();
|
|
14
9
|
case 'ContractClassRegistry':
|
|
15
10
|
return getCanonicalClassRegistry();
|
|
16
|
-
case 'MultiCallEntrypoint':
|
|
17
|
-
return getCanonicalMultiCallEntrypoint();
|
|
18
11
|
case 'FeeJuice':
|
|
19
12
|
return getCanonicalFeeJuice();
|
|
20
|
-
case 'PublicChecks':
|
|
21
|
-
return getCanonicalPublicChecks();
|
|
22
13
|
default:
|
|
23
14
|
throw new Error(`Unknown protocol contract name: ${name}`);
|
|
24
15
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// bytecode commitments, and other deployment data, emitting everything as precomputed constants into
|
|
3
3
|
// `protocol_contract_data.ts`. This avoids clients repeating the expensive hashing at runtime and
|
|
4
4
|
// ensures a single source of truth for the protocol contracts hash enforced by circuits, P2P, and L1.
|
|
5
|
-
import {
|
|
5
|
+
import { CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS, CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE, CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS, FEE_JUICE_ADDRESS, MAX_PROTOCOL_CONTRACTS } from '@aztec/constants';
|
|
6
6
|
import { makeTuple } from '@aztec/foundation/array';
|
|
7
7
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
8
|
import { createConsoleLogger } from '@aztec/foundation/log';
|
|
@@ -21,12 +21,9 @@ const destArtifactsDir = './artifacts';
|
|
|
21
21
|
const outputFilePath = './src/protocol_contract_data.ts';
|
|
22
22
|
const salt = new Fr(1);
|
|
23
23
|
const contractAddressMapping = {
|
|
24
|
-
AuthRegistry: CANONICAL_AUTH_REGISTRY_ADDRESS,
|
|
25
24
|
ContractInstanceRegistry: CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS,
|
|
26
25
|
ContractClassRegistry: CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS,
|
|
27
|
-
|
|
28
|
-
FeeJuice: FEE_JUICE_ADDRESS,
|
|
29
|
-
PublicChecks: PUBLIC_CHECKS_ADDRESS
|
|
26
|
+
FeeJuice: FEE_JUICE_ADDRESS
|
|
30
27
|
};
|
|
31
28
|
async function clearDestDir() {
|
|
32
29
|
try {
|
|
@@ -63,10 +60,11 @@ async function computeContractData(artifact, deployer) {
|
|
|
63
60
|
const constructorArtifact = loaded.functions.find((f)=>f.name === 'constructor');
|
|
64
61
|
const initializationHash = await computeInitializationHash(constructorArtifact, []);
|
|
65
62
|
const instance = {
|
|
66
|
-
version:
|
|
63
|
+
version: 2,
|
|
67
64
|
currentContractClassId: contractClass.id,
|
|
68
65
|
originalContractClassId: contractClass.id,
|
|
69
66
|
initializationHash,
|
|
67
|
+
immutablesHash: Fr.ZERO,
|
|
70
68
|
publicKeys: PublicKeys.default(),
|
|
71
69
|
salt,
|
|
72
70
|
deployer
|
|
@@ -107,7 +105,7 @@ function generateSalts(names) {
|
|
|
107
105
|
`;
|
|
108
106
|
}
|
|
109
107
|
function generateContractAddresses(names) {
|
|
110
|
-
const addresses = names.map((name)=>`${name}: AztecAddress.
|
|
108
|
+
const addresses = names.map((name)=>`${name}: AztecAddress.fromBigIntUnsafe(${contractAddressMapping[name]}n)`).join(',\n');
|
|
111
109
|
return `
|
|
112
110
|
export const ProtocolContractAddress: Record<ProtocolContractName, AztecAddress> = {
|
|
113
111
|
${addresses}
|
|
@@ -117,7 +115,7 @@ function generateContractAddresses(names) {
|
|
|
117
115
|
function generateDerivedAddresses(names, contractData) {
|
|
118
116
|
return `
|
|
119
117
|
export const ProtocolContractDerivedAddress = {
|
|
120
|
-
${contractData.map((d, i)=>`${names[i]}: AztecAddress.
|
|
118
|
+
${contractData.map((d, i)=>`${names[i]}: AztecAddress.fromStringUnsafe('${d.address.toString()}')`).join(',\n')}
|
|
121
119
|
};
|
|
122
120
|
`;
|
|
123
121
|
}
|
|
@@ -157,7 +155,7 @@ async function generateProtocolContractsList(names, contractData) {
|
|
|
157
155
|
}
|
|
158
156
|
return `
|
|
159
157
|
export const ProtocolContractsList = new ProtocolContracts([
|
|
160
|
-
${list.map((address)=>`AztecAddress.
|
|
158
|
+
${list.map((address)=>`AztecAddress.fromStringUnsafe('${address.toString()}')`).join(',\n')}
|
|
161
159
|
]);
|
|
162
160
|
|
|
163
161
|
export const protocolContractsHash = Fr.fromString('${(await new ProtocolContracts(list).hash()).toString()}');
|
|
@@ -203,7 +201,7 @@ async function main() {
|
|
|
203
201
|
const destName = destNames[i];
|
|
204
202
|
const artifact = await copyArtifact(srcName, destName);
|
|
205
203
|
await generateDeclarationFile(destName);
|
|
206
|
-
contractDataList.push(await computeContractData(artifact, AztecAddress.
|
|
204
|
+
contractDataList.push(await computeContractData(artifact, AztecAddress.fromBigIntUnsafe(BigInt(contractAddressMapping[destName]))));
|
|
207
205
|
}
|
|
208
206
|
await generateOutputFile(destNames, contractDataList);
|
|
209
207
|
}
|
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": "5.0.0-
|
|
5
|
+
"version": "5.0.0-rc.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dest/index.js",
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
]
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@aztec/constants": "5.0.0-
|
|
77
|
-
"@aztec/foundation": "5.0.0-
|
|
78
|
-
"@aztec/stdlib": "5.0.0-
|
|
76
|
+
"@aztec/constants": "5.0.0-rc.2",
|
|
77
|
+
"@aztec/foundation": "5.0.0-rc.2",
|
|
78
|
+
"@aztec/stdlib": "5.0.0-rc.2",
|
|
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';
|
|
@@ -36,7 +36,12 @@ export class ContractClassPublishedEvent {
|
|
|
36
36
|
const version = reader.readField().toNumber();
|
|
37
37
|
const artifactHash = reader.readField();
|
|
38
38
|
const privateFunctionsRoot = reader.readField();
|
|
39
|
-
const
|
|
39
|
+
const bytecodeFields = reader.readFieldArray(fieldsWithoutTag.length - reader.cursor);
|
|
40
|
+
// The fixed-size class log can hold at most this many packed-bytecode bytes (every payload field
|
|
41
|
+
// carries 31 bytes). Bound the declared length to it so a malformed log can't declare a multi-MiB
|
|
42
|
+
// length backed by a tiny payload and force a large allocation during early (pre-proof) validation.
|
|
43
|
+
const maxByteLength = (bytecodeFields.length - 1) * (Fr.SIZE_IN_BYTES - 1);
|
|
44
|
+
const packedPublicBytecode = bufferFromFields(bytecodeFields, maxByteLength);
|
|
40
45
|
|
|
41
46
|
return new ContractClassPublishedEvent(
|
|
42
47
|
contractClassId,
|
|
@@ -47,34 +52,23 @@ export class ContractClassPublishedEvent {
|
|
|
47
52
|
);
|
|
48
53
|
}
|
|
49
54
|
|
|
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
|
-
|
|
55
|
+
/** Converts the event to a contract class, without computing or validating the bytecode commitment. */
|
|
56
|
+
toContractClassPublic(): ContractClassPublic {
|
|
67
57
|
return {
|
|
68
58
|
id: this.contractClassId,
|
|
69
59
|
artifactHash: this.artifactHash,
|
|
70
60
|
packedBytecode: this.packedPublicBytecode,
|
|
71
61
|
privateFunctionsRoot: this.privateFunctionsRoot,
|
|
72
|
-
version: this.version,
|
|
73
|
-
privateFunctions: [],
|
|
74
|
-
utilityFunctions: [],
|
|
62
|
+
version: this.version as 1,
|
|
75
63
|
};
|
|
76
64
|
}
|
|
77
65
|
|
|
66
|
+
/** Converts the event to a contract class with its bytecode commitment (expensive). */
|
|
67
|
+
async toContractClassPublicWithBytecodeCommitment(): Promise<ContractClassPublicWithCommitment> {
|
|
68
|
+
const publicBytecodeCommitment = await computePublicBytecodeCommitment(this.packedPublicBytecode);
|
|
69
|
+
return { ...this.toContractClassPublic(), publicBytecodeCommitment };
|
|
70
|
+
}
|
|
71
|
+
|
|
78
72
|
public static extractContractClassEvents(logs: ContractClassLog[]): ContractClassPublishedEvent[] {
|
|
79
73
|
return logs
|
|
80
74
|
.filter((log: ContractClassLog) => ContractClassPublishedEvent.isContractClassPublishedEvent(log))
|
|
@@ -6,8 +6,6 @@ import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
|
6
6
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
7
7
|
|
|
8
8
|
export * from './contract_class_published_event.js';
|
|
9
|
-
export * from './private_function_broadcasted_event.js';
|
|
10
|
-
export * from './utility_function_broadcasted_event.js';
|
|
11
9
|
|
|
12
10
|
export const ContractClassRegistryArtifact = loadContractArtifact(ContractClassRegistryJson as NoirCompiledContract);
|
|
13
11
|
|
|
@@ -4,8 +4,6 @@ import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
|
4
4
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
5
5
|
|
|
6
6
|
export * from './contract_class_published_event.js';
|
|
7
|
-
export * from './private_function_broadcasted_event.js';
|
|
8
|
-
export * from './utility_function_broadcasted_event.js';
|
|
9
7
|
|
|
10
8
|
let protocolContract: ProtocolContract;
|
|
11
9
|
let protocolContractArtifact: ContractArtifact;
|
|
@@ -14,7 +12,7 @@ export async function getContractClassRegistryArtifact(): Promise<ContractArtifa
|
|
|
14
12
|
if (!protocolContractArtifact) {
|
|
15
13
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
16
14
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
17
|
-
// Even if now supported by
|
|
15
|
+
// Even if now supported by all major browsers, the MIME type is replaced with
|
|
18
16
|
// "text/javascript"
|
|
19
17
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
20
18
|
const { default: contractClassRegistryJson } = await import('../../artifacts/ContractClassRegistry.json');
|
package/src/fee-juice/lazy.ts
CHANGED
|
@@ -10,7 +10,7 @@ export async function getFeeJuiceArtifact(): Promise<ContractArtifact> {
|
|
|
10
10
|
if (!protocolContractArtifact) {
|
|
11
11
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
12
12
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
13
|
-
// Even if now supported by
|
|
13
|
+
// Even if now supported by all major browsers, the MIME type is replaced with
|
|
14
14
|
// "text/javascript"
|
|
15
15
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
16
16
|
const { default: feeJuiceJson } = await import('../../artifacts/FeeJuice.json');
|
|
@@ -15,6 +15,7 @@ export class ContractInstancePublishedEvent {
|
|
|
15
15
|
public readonly salt: Fr,
|
|
16
16
|
public readonly contractClassId: Fr,
|
|
17
17
|
public readonly initializationHash: Fr,
|
|
18
|
+
public readonly immutablesHash: Fr,
|
|
18
19
|
public readonly publicKeys: PublicKeys,
|
|
19
20
|
public readonly deployer: AztecAddress,
|
|
20
21
|
) {}
|
|
@@ -31,6 +32,7 @@ export class ContractInstancePublishedEvent {
|
|
|
31
32
|
const salt = reader.readObject(Fr);
|
|
32
33
|
const contractClassId = reader.readObject(Fr);
|
|
33
34
|
const initializationHash = reader.readObject(Fr);
|
|
35
|
+
const immutablesHash = reader.readObject(Fr);
|
|
34
36
|
const publicKeys = reader.readObject(PublicKeys);
|
|
35
37
|
const deployer = reader.readObject(AztecAddress);
|
|
36
38
|
|
|
@@ -40,13 +42,14 @@ export class ContractInstancePublishedEvent {
|
|
|
40
42
|
salt,
|
|
41
43
|
contractClassId,
|
|
42
44
|
initializationHash,
|
|
45
|
+
immutablesHash,
|
|
43
46
|
publicKeys,
|
|
44
47
|
deployer,
|
|
45
48
|
);
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
toContractInstance(): ContractInstanceWithAddress {
|
|
49
|
-
if (this.version !==
|
|
52
|
+
if (this.version !== 2) {
|
|
50
53
|
throw new Error(`Unexpected contract instance version ${this.version}`);
|
|
51
54
|
}
|
|
52
55
|
|
|
@@ -56,6 +59,7 @@ export class ContractInstancePublishedEvent {
|
|
|
56
59
|
currentContractClassId: this.contractClassId,
|
|
57
60
|
originalContractClassId: this.contractClassId,
|
|
58
61
|
initializationHash: this.initializationHash,
|
|
62
|
+
immutablesHash: this.immutablesHash,
|
|
59
63
|
publicKeys: this.publicKeys,
|
|
60
64
|
salt: this.salt,
|
|
61
65
|
deployer: this.deployer,
|
|
@@ -13,7 +13,7 @@ export async function getContractInstanceRegistryArtifact(): Promise<ContractArt
|
|
|
13
13
|
if (!protocolContractArtifact) {
|
|
14
14
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
15
15
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
16
|
-
// Even if now supported by
|
|
16
|
+
// Even if now supported by all major browsers, the MIME type is replaced with
|
|
17
17
|
// "text/javascript"
|
|
18
18
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
19
19
|
const { default: contractInstanceRegistryJson } = await import('../../artifacts/ContractInstanceRegistry.json');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
1
2
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
3
|
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
3
4
|
|
|
@@ -34,10 +35,11 @@ export function makeProtocolContract(name: ProtocolContractName, artifact: Contr
|
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
const instance = {
|
|
37
|
-
version:
|
|
38
|
+
version: 2 as const,
|
|
38
39
|
currentContractClassId: classId,
|
|
39
40
|
originalContractClassId: classId,
|
|
40
41
|
initializationHash,
|
|
42
|
+
immutablesHash: Fr.ZERO, // Protocol Contracts Have No Immutables
|
|
41
43
|
publicKeys: PublicKeys.default(),
|
|
42
44
|
salt,
|
|
43
45
|
deployer: address,
|
package/src/protocol_contract.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
1
2
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
4
|
import type { ContractClassIdPreimage, ContractClassWithId, ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
4
5
|
|
|
5
|
-
import { ProtocolContractAddress } from './protocol_contract_data.js';
|
|
6
|
+
import { ProtocolContractAddress, ProtocolContractClassId } from './protocol_contract_data.js';
|
|
6
7
|
|
|
7
8
|
/** Represents a canonical contract in the protocol. */
|
|
8
9
|
export interface ProtocolContract {
|
|
@@ -20,4 +21,11 @@ export function isProtocolContract(address: AztecAddress) {
|
|
|
20
21
|
return Object.values(ProtocolContractAddress).some(a => a.equals(address));
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
const protocolContractClassIds = new Set(Object.values(ProtocolContractClassId).map(id => id.toString()));
|
|
25
|
+
|
|
26
|
+
/** Returns whether the given contract class id belongs to a bundled protocol contract. */
|
|
27
|
+
export function isProtocolContractClass(classId: Fr): boolean {
|
|
28
|
+
return protocolContractClassIds.has(classId.toString());
|
|
29
|
+
}
|
|
30
|
+
|
|
23
31
|
export { type ProtocolContractsProvider } from './provider/protocol_contracts_provider.js';
|
|
@@ -7,12 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
export const protocolContractNames = [
|
|
10
|
-
'
|
|
11
|
-
'ContractInstanceRegistry',
|
|
10
|
+
'ContractInstanceRegistry',
|
|
12
11
|
'ContractClassRegistry',
|
|
13
|
-
'
|
|
14
|
-
'FeeJuice',
|
|
15
|
-
'PublicChecks'
|
|
12
|
+
'FeeJuice'
|
|
16
13
|
] as const;
|
|
17
14
|
|
|
18
15
|
export type ProtocolContractName = typeof protocolContractNames[number];
|
|
@@ -20,115 +17,82 @@
|
|
|
20
17
|
|
|
21
18
|
|
|
22
19
|
export const ProtocolContractSalt: Record<ProtocolContractName, Fr> = {
|
|
23
|
-
|
|
24
|
-
ContractInstanceRegistry: new Fr(1),
|
|
20
|
+
ContractInstanceRegistry: new Fr(1),
|
|
25
21
|
ContractClassRegistry: new Fr(1),
|
|
26
|
-
|
|
27
|
-
FeeJuice: new Fr(1),
|
|
28
|
-
PublicChecks: new Fr(1)
|
|
22
|
+
FeeJuice: new Fr(1)
|
|
29
23
|
};
|
|
30
24
|
|
|
31
25
|
|
|
32
26
|
|
|
33
27
|
export const ProtocolContractAddress: Record<ProtocolContractName, AztecAddress> = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
MultiCallEntrypoint: AztecAddress.fromBigInt(4n),
|
|
38
|
-
FeeJuice: AztecAddress.fromBigInt(5n),
|
|
39
|
-
PublicChecks: AztecAddress.fromBigInt(6n)
|
|
28
|
+
ContractInstanceRegistry: AztecAddress.fromBigIntUnsafe(2n),
|
|
29
|
+
ContractClassRegistry: AztecAddress.fromBigIntUnsafe(1n),
|
|
30
|
+
FeeJuice: AztecAddress.fromBigIntUnsafe(3n)
|
|
40
31
|
};
|
|
41
32
|
|
|
42
33
|
|
|
43
34
|
|
|
44
35
|
export const ProtocolContractDerivedAddress = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
MultiCallEntrypoint: AztecAddress.fromString('0x28a8d91fe41b002b453523ef9dda9fd9ce5cba46e90d958f125d1e6f8c8ceaf1'),
|
|
49
|
-
FeeJuice: AztecAddress.fromString('0x2525057c83e4887fd553b0dc48f55829f0bd3c12d4e2d73353d85778ee686e8b'),
|
|
50
|
-
PublicChecks: AztecAddress.fromString('0x1e883c67d878372ee99e320400c0bad00d85489e954d3f74a3d8355f3a065f23')
|
|
36
|
+
ContractInstanceRegistry: AztecAddress.fromStringUnsafe('0x06400117b682ea82bad313957460725049b29c05082fc954983c72d6500866de'),
|
|
37
|
+
ContractClassRegistry: AztecAddress.fromStringUnsafe('0x07172e8dd677966edbe706407e35b6897662846df1894661c8902efa56c22778'),
|
|
38
|
+
FeeJuice: AztecAddress.fromStringUnsafe('0x1b83996ec00ec66dce369f748e422e14abbe4e0dcd485ce82aef6e19323b4c11')
|
|
51
39
|
};
|
|
52
40
|
|
|
53
41
|
|
|
54
42
|
|
|
55
43
|
export const ProtocolContractClassId: Record<ProtocolContractName, Fr> = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
MultiCallEntrypoint: Fr.fromString('0x27d88efa52079f3746f86eff9222d3589709795cd5b8c9c8a2e22f22e05a8981'),
|
|
60
|
-
FeeJuice: Fr.fromString('0x1cbf5fdda9269699ce20736078f86e27db37caebecc9216e671489464251c73a'),
|
|
61
|
-
PublicChecks: Fr.fromString('0x1683ef3d6e8f4561d7a98c71ed9762d421ed49a2ed984f17ef1bed1ae1f5444e')
|
|
44
|
+
ContractInstanceRegistry: Fr.fromString('0x2f180ecabe86459dc712b3a69a115819bdc13699cdee1fbe6eb84be5f2efdcc6'),
|
|
45
|
+
ContractClassRegistry: Fr.fromString('0x05968d8add5742552b128d956d82fa3ecdb46cd0893116a18c569fefd11054f1'),
|
|
46
|
+
FeeJuice: Fr.fromString('0x0656c2f1693bb3233d86084a0ab458ed136fdc0e66ead9679f198a251bfa6e4b')
|
|
62
47
|
};
|
|
63
48
|
|
|
64
49
|
export const ProtocolContractClassIdPreimage: Record<ProtocolContractName, { artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }> = {
|
|
65
|
-
|
|
66
|
-
artifactHash: Fr.fromString('
|
|
67
|
-
privateFunctionsRoot: Fr.fromString('
|
|
68
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
69
|
-
},
|
|
70
|
-
ContractInstanceRegistry: {
|
|
71
|
-
artifactHash: Fr.fromString('0x281a07a3053cbe68c9506fa446e6139589b9e0aa3fc7ffc4343ff3a201403798'),
|
|
72
|
-
privateFunctionsRoot: Fr.fromString('0x003e0fc68df58cceacc107e1909391217ba2f2033821c97748536a9a1d7a07dc'),
|
|
73
|
-
publicBytecodeCommitment: Fr.fromString('0x1d40fc843cc358dc36f3646e376b190e36a2a1090acd2d7578918e84aa1d40c3'),
|
|
50
|
+
ContractInstanceRegistry: {
|
|
51
|
+
artifactHash: Fr.fromString('0x14ca3d252eed7fe35d495760dbea6eb0f44b9dc586a8dbed9990a96b254a4b58'),
|
|
52
|
+
privateFunctionsRoot: Fr.fromString('0x0239b0f293384aad456e2e27901eb97cd9073322a28d14b0ac7816a5297b2812'),
|
|
53
|
+
publicBytecodeCommitment: Fr.fromString('0x2c79b6699098244e947caca071a31799c20aa20e7124910a2b7c918fe817d65e'),
|
|
74
54
|
},
|
|
75
55
|
ContractClassRegistry: {
|
|
76
|
-
artifactHash: Fr.fromString('
|
|
77
|
-
privateFunctionsRoot: Fr.fromString('
|
|
78
|
-
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
79
|
-
},
|
|
80
|
-
MultiCallEntrypoint: {
|
|
81
|
-
artifactHash: Fr.fromString('0x0d082ee46b5aa422fe7b81b3943e8ca8e3edba67386106d872f6d927dbb16b3e'),
|
|
82
|
-
privateFunctionsRoot: Fr.fromString('0x266505ecb7c02ce6e227227c0b6bdb44713c8ecd43164ee7bb00b8fb340e8b03'),
|
|
56
|
+
artifactHash: Fr.fromString('0x25af8a0fba5e72be31e2c7f0d72c78b1ae0efb07eba675c641d8dab2a555b77a'),
|
|
57
|
+
privateFunctionsRoot: Fr.fromString('0x0672f623ec0753ab9fbb02a9a241df81b9bcc0dbed8628d8cab8790e0cb0c03d'),
|
|
83
58
|
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
84
59
|
},
|
|
85
60
|
FeeJuice: {
|
|
86
|
-
artifactHash: Fr.fromString('
|
|
87
|
-
privateFunctionsRoot: Fr.fromString('
|
|
88
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
89
|
-
},
|
|
90
|
-
PublicChecks: {
|
|
91
|
-
artifactHash: Fr.fromString('0x2fcb62be6eccadf10f1e4419936f2e9e456b2d6235d85514d55a09baa624597c'),
|
|
92
|
-
privateFunctionsRoot: Fr.fromString('0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1'),
|
|
93
|
-
publicBytecodeCommitment: Fr.fromString('0x1fb8fae63fa9e9f34dda88dc2ed06e32fb225f7e8228a1bfb3411c3eed9364e9'),
|
|
61
|
+
artifactHash: Fr.fromString('0x1df228ba4645988ae80cf09734c9c05bb572809026914611bc6b66c39cce6081'),
|
|
62
|
+
privateFunctionsRoot: Fr.fromString('0x247aaafc67f6bf5b06736649181a477dac9f18d3468969b14669708c3dabb275'),
|
|
63
|
+
publicBytecodeCommitment: Fr.fromString('0x1d4b1a8f71b8250d4fb65f8e16a4604e9165648279f47d80e024ce2684c4bdfb'),
|
|
94
64
|
}
|
|
95
65
|
};
|
|
96
66
|
|
|
97
67
|
export const ProtocolContractInitializationHash: Record<ProtocolContractName, Fr> = {
|
|
98
|
-
|
|
99
|
-
ContractInstanceRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
68
|
+
ContractInstanceRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
100
69
|
ContractClassRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
101
|
-
|
|
102
|
-
FeeJuice: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
103
|
-
PublicChecks: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
70
|
+
FeeJuice: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
104
71
|
};
|
|
105
72
|
|
|
106
73
|
export const ProtocolContractPrivateFunctions: Record<ProtocolContractName, { selector: FunctionSelector; vkHash: Fr }[]> = {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
MultiCallEntrypoint: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000f04908a9')), vkHash: Fr.fromString('0x21732ab3cecf633e4c31a030df62c93e35a005b89941fdab568d2818c1355192') }],
|
|
111
|
-
FeeJuice: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000cbe67243')), vkHash: Fr.fromString('0x2ad6083b4595f8076c014e5152191013167ab1b5a31ad0cbb06490054c7c59ae') }, { selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000e8d374b6')), vkHash: Fr.fromString('0x05aaffffdf797625ff24575d939339303775c5db77fb6bdcecbf955f726fd071') }],
|
|
112
|
-
PublicChecks: []
|
|
74
|
+
ContractInstanceRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000077cff62f')), vkHash: Fr.fromString('0x08a57d0b4d164c6c8d92da9c3bfe57a4ac1a639ab0a2a0ccb60bbb6bcd37f245') }],
|
|
75
|
+
ContractClassRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x000000000000000000000000000000000000000000000000000000006934ed0d')), vkHash: Fr.fromString('0x1531ed0e20d6d05f1aeb06f746c8c4b8f467174836d6edf915b0c45099b393ed') }],
|
|
76
|
+
FeeJuice: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000cbe67243')), vkHash: Fr.fromString('0x2dbad42bf59fe7ea908485dea59573b4d7fb8ddefb6a0f73bbcce79aa27d545c') }, { selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000e8d374b6')), vkHash: Fr.fromString('0x2e9880e15fb0c9a5494faef915861144769e94aded54c737819ee75918fbda51') }]
|
|
113
77
|
};
|
|
114
78
|
|
|
115
79
|
|
|
116
80
|
|
|
117
81
|
export const ProtocolContractsList = new ProtocolContracts([
|
|
118
|
-
AztecAddress.
|
|
119
|
-
AztecAddress.
|
|
120
|
-
AztecAddress.
|
|
121
|
-
AztecAddress.
|
|
122
|
-
AztecAddress.
|
|
123
|
-
AztecAddress.
|
|
124
|
-
AztecAddress.
|
|
125
|
-
AztecAddress.
|
|
126
|
-
AztecAddress.
|
|
127
|
-
AztecAddress.
|
|
128
|
-
AztecAddress.
|
|
82
|
+
AztecAddress.fromStringUnsafe('0x07172e8dd677966edbe706407e35b6897662846df1894661c8902efa56c22778'),
|
|
83
|
+
AztecAddress.fromStringUnsafe('0x06400117b682ea82bad313957460725049b29c05082fc954983c72d6500866de'),
|
|
84
|
+
AztecAddress.fromStringUnsafe('0x1b83996ec00ec66dce369f748e422e14abbe4e0dcd485ce82aef6e19323b4c11'),
|
|
85
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
86
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
87
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
88
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
89
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
90
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
91
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
92
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
129
93
|
]);
|
|
130
94
|
|
|
131
|
-
export const protocolContractsHash = Fr.fromString('
|
|
95
|
+
export const protocolContractsHash = Fr.fromString('0x0a1f22b72996215e178699fff463a6ca5e3c7d5ffe66e183490eb766ec1c83ae');
|
|
132
96
|
|
|
133
97
|
|
|
134
98
|
|
package/src/provider/bundle.ts
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
|
|
3
|
-
import { AuthRegistryArtifact } from '../auth-registry/index.js';
|
|
4
3
|
import { ContractClassRegistryArtifact } from '../class-registry/index.js';
|
|
5
4
|
import { FeeJuiceArtifact } from '../fee-juice/index.js';
|
|
6
5
|
import { ContractInstanceRegistryArtifact } from '../instance-registry/index.js';
|
|
7
6
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
8
|
-
import { MultiCallEntrypointArtifact } from '../multi-call-entrypoint/index.js';
|
|
9
7
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
10
8
|
import type { ProtocolContractName } from '../protocol_contract_data.js';
|
|
11
|
-
import { PublicChecksArtifact } from '../public-checks/index.js';
|
|
12
9
|
import type { ProtocolContractsProvider } from './protocol_contracts_provider.js';
|
|
13
10
|
|
|
14
11
|
export const ProtocolContractArtifact: Record<ProtocolContractName, ContractArtifact> = {
|
|
15
|
-
AuthRegistry: AuthRegistryArtifact,
|
|
16
12
|
ContractInstanceRegistry: ContractInstanceRegistryArtifact,
|
|
17
13
|
ContractClassRegistry: ContractClassRegistryArtifact,
|
|
18
|
-
MultiCallEntrypoint: MultiCallEntrypointArtifact,
|
|
19
14
|
FeeJuice: FeeJuiceArtifact,
|
|
20
|
-
PublicChecks: PublicChecksArtifact,
|
|
21
15
|
};
|
|
22
16
|
|
|
23
17
|
export class BundledProtocolContractsProvider implements ProtocolContractsProvider {
|
package/src/provider/lazy.ts
CHANGED
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
import { getCanonicalAuthRegistry } from '../auth-registry/lazy.js';
|
|
2
1
|
import { getCanonicalClassRegistry } from '../class-registry/lazy.js';
|
|
3
2
|
import { getCanonicalFeeJuice } from '../fee-juice/lazy.js';
|
|
4
3
|
import { getCanonicalInstanceRegistry } from '../instance-registry/lazy.js';
|
|
5
|
-
import { getCanonicalMultiCallEntrypoint } from '../multi-call-entrypoint/lazy.js';
|
|
6
4
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
7
5
|
import type { ProtocolContractName } from '../protocol_contract_data.js';
|
|
8
|
-
import { getCanonicalPublicChecks } from '../public-checks/lazy.js';
|
|
9
6
|
import type { ProtocolContractsProvider } from './protocol_contracts_provider.js';
|
|
10
7
|
|
|
11
8
|
export class LazyProtocolContractsProvider implements ProtocolContractsProvider {
|
|
12
9
|
getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract> {
|
|
13
10
|
switch (name) {
|
|
14
|
-
case 'AuthRegistry':
|
|
15
|
-
return getCanonicalAuthRegistry();
|
|
16
11
|
case 'ContractInstanceRegistry':
|
|
17
12
|
return getCanonicalInstanceRegistry();
|
|
18
13
|
case 'ContractClassRegistry':
|
|
19
14
|
return getCanonicalClassRegistry();
|
|
20
|
-
case 'MultiCallEntrypoint':
|
|
21
|
-
return getCanonicalMultiCallEntrypoint();
|
|
22
15
|
case 'FeeJuice':
|
|
23
16
|
return getCanonicalFeeJuice();
|
|
24
|
-
case 'PublicChecks':
|
|
25
|
-
return getCanonicalPublicChecks();
|
|
26
17
|
default:
|
|
27
18
|
throw new Error(`Unknown protocol contract name: ${name}`);
|
|
28
19
|
}
|
package/src/tests/fixtures.ts
CHANGED
|
@@ -8,18 +8,6 @@ export function getSampleContractClassPublishedEventPayload(): Buffer {
|
|
|
8
8
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
12
|
-
export function getSamplePrivateFunctionBroadcastedEventPayload(): Buffer {
|
|
13
|
-
const path = getPathToFixture('PrivateFunctionBroadcastedEventData.hex');
|
|
14
|
-
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
18
|
-
export function getSampleUtilityFunctionBroadcastedEventPayload(): Buffer {
|
|
19
|
-
const path = getPathToFixture('UtilityFunctionBroadcastedEventData.hex');
|
|
20
|
-
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
21
|
-
}
|
|
22
|
-
|
|
23
11
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
24
12
|
export function getSampleContractInstancePublishedEventPayload(): Buffer {
|
|
25
13
|
const path = getPathToFixture('ContractInstancePublishedEventData.hex');
|