@aztec/protocol-contracts 0.0.0-test.0 → 0.0.1-commit.001888fc
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/README.md +2 -2
- package/artifacts/AuthRegistry.json +2602 -1590
- package/artifacts/ContractClassRegistry.json +2022 -0
- package/artifacts/ContractInstanceRegistry.json +2949 -0
- package/artifacts/FeeJuice.json +3040 -2987
- package/artifacts/MultiCallEntrypoint.json +2153 -1169
- package/artifacts/PublicChecks.json +1200 -0
- package/dest/auth-registry/index.d.ts +3 -2
- package/dest/auth-registry/index.d.ts.map +1 -1
- package/dest/auth-registry/index.js +4 -4
- package/dest/auth-registry/lazy.d.ts +1 -1
- package/dest/auth-registry/lazy.js +5 -5
- package/dest/class-registry/contract_class_published_event.d.ts +17 -0
- package/dest/class-registry/contract_class_published_event.d.ts.map +1 -0
- package/dest/{class-registerer/contract_class_registered_event.js → class-registry/contract_class_published_event.js} +15 -20
- package/dest/class-registry/index.d.ts +8 -0
- package/dest/class-registry/index.d.ts.map +1 -0
- package/dest/class-registry/index.js +17 -0
- package/dest/class-registry/lazy.d.ts +9 -0
- package/dest/class-registry/lazy.d.ts.map +1 -0
- package/dest/class-registry/lazy.js +26 -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-registerer → class-registry}/private_function_broadcasted_event.js +11 -11
- 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-registerer/unconstrained_function_broadcasted_event.js → class-registry/utility_function_broadcasted_event.js} +20 -20
- package/dest/fee-juice/index.d.ts +2 -2
- package/dest/fee-juice/index.d.ts.map +1 -1
- package/dest/fee-juice/index.js +4 -4
- package/dest/fee-juice/lazy.d.ts +1 -1
- package/dest/fee-juice/lazy.js +5 -5
- package/dest/index.d.ts +1 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +0 -1
- package/dest/instance-registry/contract_instance_published_event.d.ts +21 -0
- package/dest/instance-registry/contract_instance_published_event.d.ts.map +1 -0
- package/dest/{instance-deployer/contract_instance_deployed_event.js → instance-registry/contract_instance_published_event.js} +9 -6
- package/dest/instance-registry/contract_instance_updated_event.d.ts +17 -0
- package/dest/instance-registry/contract_instance_updated_event.d.ts.map +1 -0
- package/dest/instance-registry/contract_instance_updated_event.js +35 -0
- package/dest/instance-registry/index.d.ts +7 -0
- package/dest/instance-registry/index.d.ts.map +1 -0
- package/dest/instance-registry/index.js +15 -0
- package/dest/instance-registry/lazy.d.ts +8 -0
- package/dest/{instance-deployer → instance-registry}/lazy.d.ts.map +1 -1
- package/dest/instance-registry/lazy.js +25 -0
- package/dest/make_protocol_contract.d.ts +4 -4
- package/dest/make_protocol_contract.d.ts.map +1 -1
- package/dest/make_protocol_contract.js +28 -14
- package/dest/multi-call-entrypoint/index.d.ts +1 -1
- package/dest/multi-call-entrypoint/index.d.ts.map +1 -1
- package/dest/multi-call-entrypoint/index.js +4 -4
- package/dest/multi-call-entrypoint/lazy.d.ts +1 -1
- package/dest/multi-call-entrypoint/lazy.js +5 -5
- package/dest/protocol_contract.d.ts +1 -1
- package/dest/protocol_contract_data.d.ts +26 -16
- package/dest/protocol_contract_data.d.ts.map +1 -1
- package/dest/protocol_contract_data.js +119 -23
- package/dest/provider/bundle.d.ts +1 -1
- package/dest/provider/bundle.d.ts.map +1 -1
- package/dest/provider/bundle.js +7 -7
- package/dest/provider/lazy.d.ts +1 -1
- package/dest/provider/lazy.d.ts.map +1 -1
- package/dest/provider/lazy.js +9 -9
- package/dest/provider/protocol_contracts_provider.d.ts +1 -1
- package/dest/public-checks/index.d.ts +5 -0
- package/dest/public-checks/index.d.ts.map +1 -0
- package/dest/public-checks/index.js +13 -0
- package/dest/public-checks/lazy.d.ts +6 -0
- package/dest/public-checks/lazy.d.ts.map +1 -0
- package/dest/public-checks/lazy.js +23 -0
- package/dest/scripts/cleanup_artifacts.js +2 -2
- package/dest/scripts/generate_data.js +95 -53
- package/dest/tests/fixtures.d.ts +4 -6
- package/dest/tests/fixtures.d.ts.map +1 -1
- package/dest/tests/fixtures.js +6 -6
- package/package.json +23 -20
- package/src/auth-registry/index.ts +6 -6
- package/src/auth-registry/lazy.ts +5 -5
- package/src/class-registry/__snapshots__/README.md +9 -0
- package/src/{class-registerer/contract_class_registered_event.ts → class-registry/contract_class_published_event.ts} +23 -23
- package/src/class-registry/index.ts +23 -0
- package/src/class-registry/lazy.ts +33 -0
- package/src/{class-registerer → class-registry}/private_function_broadcasted_event.ts +13 -9
- package/src/{class-registerer/unconstrained_function_broadcasted_event.ts → class-registry/utility_function_broadcasted_event.ts} +26 -22
- package/src/fee-juice/index.ts +5 -5
- package/src/fee-juice/lazy.ts +5 -5
- package/src/index.ts +0 -1
- package/src/instance-registry/__snapshots__/README.md +9 -0
- package/src/{instance-deployer/contract_instance_deployed_event.ts → instance-registry/contract_instance_published_event.ts} +13 -7
- package/src/{instance-deployer → instance-registry}/contract_instance_updated_event.ts +15 -15
- package/src/instance-registry/index.ts +23 -0
- package/src/instance-registry/lazy.ts +32 -0
- package/src/make_protocol_contract.ts +37 -15
- package/src/multi-call-entrypoint/index.ts +4 -4
- package/src/multi-call-entrypoint/lazy.ts +5 -5
- package/src/protocol_contract_data.ts +97 -23
- package/src/provider/bundle.ts +7 -7
- package/src/provider/lazy.ts +9 -9
- package/src/{router → public-checks}/index.ts +5 -5
- package/src/public-checks/lazy.ts +29 -0
- package/src/tests/fixtures.ts +6 -6
- package/artifacts/ContractClassRegisterer.json +0 -7219
- package/artifacts/ContractInstanceDeployer.json +0 -2984
- package/artifacts/Router.json +0 -3798
- package/dest/build_protocol_contract_tree.d.ts +0 -10
- package/dest/build_protocol_contract_tree.d.ts.map +0 -1
- package/dest/build_protocol_contract_tree.js +0 -20
- package/dest/class-registerer/contract_class_registered_event.d.ts +0 -18
- package/dest/class-registerer/contract_class_registered_event.d.ts.map +0 -1
- package/dest/class-registerer/index.d.ts +0 -8
- package/dest/class-registerer/index.d.ts.map +0 -1
- package/dest/class-registerer/index.js +0 -17
- package/dest/class-registerer/lazy.d.ts +0 -9
- package/dest/class-registerer/lazy.d.ts.map +0 -1
- package/dest/class-registerer/lazy.js +0 -26
- package/dest/class-registerer/private_function_broadcasted_event.d.ts +0 -46
- package/dest/class-registerer/private_function_broadcasted_event.d.ts.map +0 -1
- package/dest/class-registerer/unconstrained_function_broadcasted_event.d.ts +0 -40
- package/dest/class-registerer/unconstrained_function_broadcasted_event.d.ts.map +0 -1
- package/dest/instance-deployer/contract_instance_deployed_event.d.ts +0 -20
- package/dest/instance-deployer/contract_instance_deployed_event.d.ts.map +0 -1
- package/dest/instance-deployer/contract_instance_updated_event.d.ts +0 -16
- package/dest/instance-deployer/contract_instance_updated_event.d.ts.map +0 -1
- package/dest/instance-deployer/contract_instance_updated_event.js +0 -36
- package/dest/instance-deployer/index.d.ts +0 -7
- package/dest/instance-deployer/index.d.ts.map +0 -1
- package/dest/instance-deployer/index.js +0 -15
- package/dest/instance-deployer/lazy.d.ts +0 -8
- package/dest/instance-deployer/lazy.js +0 -25
- package/dest/protocol_contract_tree.d.ts +0 -7
- package/dest/protocol_contract_tree.d.ts.map +0 -1
- package/dest/protocol_contract_tree.js +0 -34
- package/dest/router/index.d.ts +0 -5
- package/dest/router/index.d.ts.map +0 -1
- package/dest/router/index.js +0 -13
- package/dest/router/lazy.d.ts +0 -6
- package/dest/router/lazy.d.ts.map +0 -1
- package/dest/router/lazy.js +0 -23
- package/src/build_protocol_contract_tree.ts +0 -29
- package/src/class-registerer/index.ts +0 -25
- package/src/class-registerer/lazy.ts +0 -33
- package/src/instance-deployer/index.ts +0 -23
- package/src/instance-deployer/lazy.ts +0 -32
- package/src/protocol_contract_tree.ts +0 -44
- package/src/router/lazy.ts +0 -29
- /package/artifacts/{ContractClassRegisterer.d.json.ts → ContractClassRegistry.d.json.ts} +0 -0
- /package/artifacts/{ContractInstanceDeployer.d.json.ts → ContractInstanceRegistry.d.json.ts} +0 -0
- /package/artifacts/{Router.d.json.ts → PublicChecks.d.json.ts} +0 -0
package/dest/provider/bundle.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { AuthRegistryArtifact } from '../auth-registry/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { ContractClassRegistryArtifact } from '../class-registry/index.js';
|
|
3
3
|
import { FeeJuiceArtifact } from '../fee-juice/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { ContractInstanceRegistryArtifact } from '../instance-registry/index.js';
|
|
5
5
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
6
6
|
import { MultiCallEntrypointArtifact } from '../multi-call-entrypoint/index.js';
|
|
7
|
-
import {
|
|
7
|
+
import { PublicChecksArtifact } from '../public-checks/index.js';
|
|
8
8
|
export const ProtocolContractArtifact = {
|
|
9
9
|
AuthRegistry: AuthRegistryArtifact,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
ContractInstanceRegistry: ContractInstanceRegistryArtifact,
|
|
11
|
+
ContractClassRegistry: ContractClassRegistryArtifact,
|
|
12
12
|
MultiCallEntrypoint: MultiCallEntrypointArtifact,
|
|
13
13
|
FeeJuice: FeeJuiceArtifact,
|
|
14
|
-
|
|
14
|
+
PublicChecks: PublicChecksArtifact
|
|
15
15
|
};
|
|
16
16
|
export class BundledProtocolContractsProvider {
|
|
17
17
|
getProtocolContractArtifact(name) {
|
|
18
|
-
return makeProtocolContract(name, ProtocolContractArtifact[name]);
|
|
18
|
+
return Promise.resolve(makeProtocolContract(name, ProtocolContractArtifact[name]));
|
|
19
19
|
}
|
|
20
20
|
}
|
package/dest/provider/lazy.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ import type { ProtocolContractsProvider } from './protocol_contracts_provider.js
|
|
|
4
4
|
export declare class LazyProtocolContractsProvider implements ProtocolContractsProvider {
|
|
5
5
|
getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract>;
|
|
6
6
|
}
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Byb3ZpZGVyL2xhenkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBS0EsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxvQkFBb0IsRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBRXpFLE9BQU8sS0FBSyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFFbEYscUJBQWEsNkJBQThCLFlBQVcseUJBQXlCO0lBQzdFLDJCQUEyQixDQUFDLElBQUksRUFBRSxvQkFBb0IsR0FBRyxPQUFPLENBQUMsZ0JBQWdCLENBQUMsQ0FpQmpGO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/provider/lazy.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAElF,qBAAa,6BAA8B,YAAW,yBAAyB;IAC7E,2BAA2B,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/provider/lazy.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAElF,qBAAa,6BAA8B,YAAW,yBAAyB;IAC7E,2BAA2B,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAiBjF;CACF"}
|
package/dest/provider/lazy.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { getCanonicalAuthRegistry } from '../auth-registry/lazy.js';
|
|
2
|
-
import {
|
|
2
|
+
import { getCanonicalClassRegistry } from '../class-registry/lazy.js';
|
|
3
3
|
import { getCanonicalFeeJuice } from '../fee-juice/lazy.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getCanonicalInstanceRegistry } from '../instance-registry/lazy.js';
|
|
5
5
|
import { getCanonicalMultiCallEntrypoint } from '../multi-call-entrypoint/lazy.js';
|
|
6
|
-
import {
|
|
6
|
+
import { getCanonicalPublicChecks } from '../public-checks/lazy.js';
|
|
7
7
|
export class LazyProtocolContractsProvider {
|
|
8
8
|
getProtocolContractArtifact(name) {
|
|
9
9
|
switch(name){
|
|
10
10
|
case 'AuthRegistry':
|
|
11
11
|
return getCanonicalAuthRegistry();
|
|
12
|
-
case '
|
|
13
|
-
return
|
|
14
|
-
case '
|
|
15
|
-
return
|
|
12
|
+
case 'ContractInstanceRegistry':
|
|
13
|
+
return getCanonicalInstanceRegistry();
|
|
14
|
+
case 'ContractClassRegistry':
|
|
15
|
+
return getCanonicalClassRegistry();
|
|
16
16
|
case 'MultiCallEntrypoint':
|
|
17
17
|
return getCanonicalMultiCallEntrypoint();
|
|
18
18
|
case 'FeeJuice':
|
|
19
19
|
return getCanonicalFeeJuice();
|
|
20
|
-
case '
|
|
21
|
-
return
|
|
20
|
+
case 'PublicChecks':
|
|
21
|
+
return getCanonicalPublicChecks();
|
|
22
22
|
default:
|
|
23
23
|
throw new Error(`Unknown protocol contract name: ${name}`);
|
|
24
24
|
}
|
|
@@ -4,4 +4,4 @@ import type { ProtocolContractName } from '../protocol_contract_data.js';
|
|
|
4
4
|
export interface ProtocolContractsProvider {
|
|
5
5
|
getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract>;
|
|
6
6
|
}
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvdG9jb2xfY29udHJhY3RzX3Byb3ZpZGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHJvdmlkZXIvcHJvdG9jb2xfY29udHJhY3RzX3Byb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSw4QkFBOEIsQ0FBQztBQUV6RSw0REFBNEQ7QUFDNUQsTUFBTSxXQUFXLHlCQUF5QjtJQUN4QywyQkFBMkIsQ0FBQyxJQUFJLEVBQUUsb0JBQW9CLEdBQUcsT0FBTyxDQUFDLGdCQUFnQixDQUFDLENBQUM7Q0FDcEYifQ==
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ProtocolContract } from '../protocol_contract.js';
|
|
2
|
+
export declare const PublicChecksArtifact: import("@aztec/stdlib/abi").ContractArtifact;
|
|
3
|
+
/** Returns the canonical deployment of the contract. */
|
|
4
|
+
export declare function getCanonicalPublicChecks(): Promise<ProtocolContract>;
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wdWJsaWMtY2hlY2tzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUtBLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFFaEUsZUFBTyxNQUFNLG9CQUFvQiw4Q0FBaUUsQ0FBQztBQUluRyx3REFBd0Q7QUFDeEQsd0JBQWdCLHdCQUF3QixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUtwRSJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/public-checks/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAO,MAAM,oBAAoB,8CAAiE,CAAC;AAInG,wDAAwD;AACxD,wBAAgB,wBAAwB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAKpE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
+
import PublicChecksJson from '../../artifacts/PublicChecks.json' with {
|
|
3
|
+
type: 'json'
|
|
4
|
+
};
|
|
5
|
+
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
6
|
+
export const PublicChecksArtifact = loadContractArtifact(PublicChecksJson);
|
|
7
|
+
let protocolContract;
|
|
8
|
+
/** Returns the canonical deployment of the contract. */ export function getCanonicalPublicChecks() {
|
|
9
|
+
if (!protocolContract) {
|
|
10
|
+
protocolContract = makeProtocolContract('PublicChecks', PublicChecksArtifact);
|
|
11
|
+
}
|
|
12
|
+
return Promise.resolve(protocolContract);
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
+
import type { ProtocolContract } from '../protocol_contract.js';
|
|
3
|
+
export declare function getPublicChecksArtifact(): Promise<ContractArtifact>;
|
|
4
|
+
/** Returns the canonical deployment of the public checks contract. */
|
|
5
|
+
export declare function getCanonicalPublicChecks(): Promise<ProtocolContract>;
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3B1YmxpYy1jaGVja3MvbGF6eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxnQkFBZ0IsRUFBd0IsTUFBTSxtQkFBbUIsQ0FBQztBQUdoRixPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBS2hFLHdCQUFzQix1QkFBdUIsSUFBSSxPQUFPLENBQUMsZ0JBQWdCLENBQUMsQ0FXekU7QUFFRCxzRUFBc0U7QUFDdEUsd0JBQXNCLHdCQUF3QixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQU0xRSJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/public-checks/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAwB,MAAM,mBAAmB,CAAC;AAGhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAKhE,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAWzE;AAED,sEAAsE;AACtE,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAM1E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
+
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
3
|
+
let protocolContract;
|
|
4
|
+
let protocolContractArtifact;
|
|
5
|
+
export async function getPublicChecksArtifact() {
|
|
6
|
+
if (!protocolContractArtifact) {
|
|
7
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
8
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
9
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
10
|
+
// "text/javascript"
|
|
11
|
+
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
12
|
+
const { default: publicChecksJson } = await import('../../artifacts/PublicChecks.json');
|
|
13
|
+
protocolContractArtifact = loadContractArtifact(publicChecksJson);
|
|
14
|
+
}
|
|
15
|
+
return protocolContractArtifact;
|
|
16
|
+
}
|
|
17
|
+
/** Returns the canonical deployment of the public checks contract. */ export async function getCanonicalPublicChecks() {
|
|
18
|
+
if (!protocolContract) {
|
|
19
|
+
const publicChecksArtifact = await getPublicChecksArtifact();
|
|
20
|
+
protocolContract = makeProtocolContract('PublicChecks', publicChecksArtifact);
|
|
21
|
+
}
|
|
22
|
+
return protocolContract;
|
|
23
|
+
}
|
|
@@ -8,9 +8,9 @@ async function cleanupArtifacts(target) {
|
|
|
8
8
|
continue;
|
|
9
9
|
}
|
|
10
10
|
const fileData = JSON.parse((await readFile(join(target, file), 'utf8')).toString());
|
|
11
|
-
fileData.file_map = {};
|
|
11
|
+
/* eslint-disable camelcase */ fileData.file_map = {};
|
|
12
12
|
fileData.debug_symbols = {};
|
|
13
|
-
await writeFile(join(target, file), JSON.stringify(fileData));
|
|
13
|
+
/* eslint-enable camelcase */ await writeFile(join(target, file), JSON.stringify(fileData));
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
await cleanupArtifacts(fileURLToPath(new URL('../../artifacts', import.meta.url).href));
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// Reads compiled Noir artifacts for each protocol contract and derives their addresses, class IDs,
|
|
2
|
+
// bytecode commitments, and other deployment data, emitting everything as precomputed constants into
|
|
3
|
+
// `protocol_contract_data.ts`. This avoids clients repeating the expensive hashing at runtime and
|
|
4
|
+
// ensures a single source of truth for the protocol contracts hash enforced by circuits, P2P, and L1.
|
|
5
|
+
import { CANONICAL_AUTH_REGISTRY_ADDRESS, CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS, CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE, CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS, FEE_JUICE_ADDRESS, MAX_PROTOCOL_CONTRACTS, MULTI_CALL_ENTRYPOINT_ADDRESS, PUBLIC_CHECKS_ADDRESS } from '@aztec/constants';
|
|
6
|
+
import { makeTuple } from '@aztec/foundation/array';
|
|
7
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
8
|
import { createConsoleLogger } from '@aztec/foundation/log';
|
|
5
9
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
6
10
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import {
|
|
11
|
+
import { computeContractAddressFromInstance, computeInitializationHash, getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
12
|
+
import { computeSiloedPrivateLogFirstField } from '@aztec/stdlib/hash';
|
|
13
|
+
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
14
|
+
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
8
15
|
import { promises as fs } from 'fs';
|
|
9
16
|
import path from 'path';
|
|
10
|
-
import { buildProtocolContractTree } from '../build_protocol_contract_tree.js';
|
|
11
17
|
const log = createConsoleLogger('autogenerate');
|
|
12
18
|
const noirContractsRoot = '../../noir-projects/noir-contracts';
|
|
13
19
|
const srcPath = path.join(noirContractsRoot, './target');
|
|
@@ -16,11 +22,11 @@ const outputFilePath = './src/protocol_contract_data.ts';
|
|
|
16
22
|
const salt = new Fr(1);
|
|
17
23
|
const contractAddressMapping = {
|
|
18
24
|
AuthRegistry: CANONICAL_AUTH_REGISTRY_ADDRESS,
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
ContractInstanceRegistry: CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS,
|
|
26
|
+
ContractClassRegistry: CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS,
|
|
21
27
|
MultiCallEntrypoint: MULTI_CALL_ENTRYPOINT_ADDRESS,
|
|
22
28
|
FeeJuice: FEE_JUICE_ADDRESS,
|
|
23
|
-
|
|
29
|
+
PublicChecks: PUBLIC_CHECKS_ADDRESS
|
|
24
30
|
};
|
|
25
31
|
async function clearDestDir() {
|
|
26
32
|
try {
|
|
@@ -49,19 +55,32 @@ async function copyArtifact(srcName, destName) {
|
|
|
49
55
|
await fs.copyFile(src, dest);
|
|
50
56
|
return artifact;
|
|
51
57
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
// Precompute all the expensive contract data that can be obtained from the artifact, to avoid redundant computations in clients.
|
|
59
|
+
// Protocol contracts come from a trusted source, so no class verifications are needed.
|
|
60
|
+
async function computeContractData(artifact, deployer) {
|
|
61
|
+
const loaded = loadContractArtifact(artifact);
|
|
62
|
+
const contractClass = await getContractClassFromArtifact(loaded);
|
|
63
|
+
const constructorArtifact = loaded.functions.find((f)=>f.name === 'constructor');
|
|
64
|
+
const initializationHash = await computeInitializationHash(constructorArtifact, []);
|
|
65
|
+
const instance = {
|
|
66
|
+
version: 1,
|
|
67
|
+
currentContractClassId: contractClass.id,
|
|
68
|
+
originalContractClassId: contractClass.id,
|
|
69
|
+
initializationHash,
|
|
70
|
+
publicKeys: PublicKeys.default(),
|
|
71
|
+
salt,
|
|
72
|
+
deployer
|
|
73
|
+
};
|
|
74
|
+
const address = await computeContractAddressFromInstance(instance);
|
|
75
|
+
return {
|
|
76
|
+
address,
|
|
77
|
+
classId: contractClass.id,
|
|
78
|
+
artifactHash: contractClass.artifactHash,
|
|
79
|
+
privateFunctionsRoot: contractClass.privateFunctionsRoot,
|
|
80
|
+
publicBytecodeCommitment: contractClass.publicBytecodeCommitment,
|
|
81
|
+
initializationHash,
|
|
82
|
+
privateFunctions: contractClass.privateFunctions
|
|
83
|
+
};
|
|
65
84
|
}
|
|
66
85
|
async function generateDeclarationFile(destName) {
|
|
67
86
|
const content = `
|
|
@@ -95,46 +114,68 @@ function generateContractAddresses(names) {
|
|
|
95
114
|
};
|
|
96
115
|
`;
|
|
97
116
|
}
|
|
98
|
-
function
|
|
117
|
+
function generateDerivedAddresses(names, contractData) {
|
|
99
118
|
return `
|
|
100
|
-
export const
|
|
101
|
-
${
|
|
119
|
+
export const ProtocolContractDerivedAddress = {
|
|
120
|
+
${contractData.map((d, i)=>`${names[i]}: AztecAddress.fromString('${d.address.toString()}')`).join(',\n')}
|
|
121
|
+
};
|
|
122
|
+
`;
|
|
123
|
+
}
|
|
124
|
+
function generateClassIdPreimages(names, contractData) {
|
|
125
|
+
return `
|
|
126
|
+
export const ProtocolContractClassId: Record<ProtocolContractName, Fr> = {
|
|
127
|
+
${contractData.map((d, i)=>`${names[i]}: Fr.fromString('${d.classId.toString()}')`).join(',\n')}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const ProtocolContractClassIdPreimage: Record<ProtocolContractName, { artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }> = {
|
|
131
|
+
${contractData.map((d, i)=>`${names[i]}: {
|
|
132
|
+
artifactHash: Fr.fromString('${d.artifactHash.toString()}'),
|
|
133
|
+
privateFunctionsRoot: Fr.fromString('${d.privateFunctionsRoot.toString()}'),
|
|
134
|
+
publicBytecodeCommitment: Fr.fromString('${d.publicBytecodeCommitment.toString()}'),
|
|
135
|
+
}`).join(',\n')}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export const ProtocolContractInitializationHash: Record<ProtocolContractName, Fr> = {
|
|
139
|
+
${contractData.map((d, i)=>`${names[i]}: Fr.fromString('${d.initializationHash.toString()}')`).join(',\n')}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const ProtocolContractPrivateFunctions: Record<ProtocolContractName, { selector: FunctionSelector; vkHash: Fr }[]> = {
|
|
143
|
+
${contractData.map((d, i)=>`${names[i]}: [${d.privateFunctions.map((fn)=>`{ selector: FunctionSelector.fromField(Fr.fromString('${fn.selector.toField().toString()}')), vkHash: Fr.fromString('${fn.vkHash.toString()}') }`).join(', ')}]`).join(',\n')}
|
|
102
144
|
};
|
|
103
145
|
`;
|
|
104
146
|
}
|
|
105
|
-
async function
|
|
106
|
-
const
|
|
147
|
+
async function generateProtocolContractsList(names, contractData) {
|
|
148
|
+
const list = makeTuple(MAX_PROTOCOL_CONTRACTS, ()=>AztecAddress.zero());
|
|
149
|
+
for(let i = 0; i < names.length; i++){
|
|
150
|
+
const name = names[i];
|
|
151
|
+
const address = contractAddressMapping[name];
|
|
152
|
+
const derivedAddressIndex = address - 1;
|
|
153
|
+
if (!list[derivedAddressIndex].equals(AztecAddress.zero())) {
|
|
154
|
+
throw new Error(`Duplicate protocol contract address: ${address.toString()}`);
|
|
155
|
+
}
|
|
156
|
+
list[derivedAddressIndex] = contractData[i].address;
|
|
157
|
+
}
|
|
107
158
|
return `
|
|
108
|
-
export const
|
|
159
|
+
export const ProtocolContractsList = new ProtocolContracts([
|
|
160
|
+
${list.map((address)=>`AztecAddress.fromString('${address.toString()}')`).join(',\n')}
|
|
161
|
+
]);
|
|
162
|
+
|
|
163
|
+
export const protocolContractsHash = Fr.fromString('${(await new ProtocolContracts(list).hash()).toString()}');
|
|
109
164
|
`;
|
|
110
165
|
}
|
|
166
|
+
// Generate the siloed log tags for events emitted via private logs.
|
|
111
167
|
async function generateLogTags() {
|
|
112
|
-
// See silo_contract_class_log for all registerer tags
|
|
113
168
|
return `
|
|
114
|
-
export const
|
|
115
|
-
REGISTERER_CONTRACT_ADDRESS,
|
|
116
|
-
REGISTERER_CONTRACT_CLASS_REGISTERED_MAGIC_VALUE
|
|
117
|
-
])}');
|
|
118
|
-
export const REGISTERER_PRIVATE_FUNCTION_BROADCASTED_TAG = Fr.fromHexString('${await poseidon2Hash([
|
|
119
|
-
REGISTERER_CONTRACT_ADDRESS,
|
|
120
|
-
REGISTERER_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE
|
|
121
|
-
])}');
|
|
122
|
-
export const REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_TAG = Fr.fromHexString('${await poseidon2Hash([
|
|
123
|
-
REGISTERER_CONTRACT_ADDRESS,
|
|
124
|
-
REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_MAGIC_VALUE
|
|
125
|
-
])}');
|
|
126
|
-
export const DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_TAG = Fr.fromHexString('${await poseidon2Hash([
|
|
127
|
-
DEPLOYER_CONTRACT_ADDRESS,
|
|
128
|
-
DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE
|
|
129
|
-
])}');
|
|
130
|
-
export const DEPLOYER_CONTRACT_INSTANCE_UPDATED_TAG = new Fr(${DEPLOYER_CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE}n);
|
|
169
|
+
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('${await computeSiloedPrivateLogFirstField(new AztecAddress(new Fr(CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS)), new Fr(CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE))}');
|
|
131
170
|
`;
|
|
132
171
|
}
|
|
133
|
-
async function generateOutputFile(names,
|
|
172
|
+
async function generateOutputFile(names, contractData) {
|
|
134
173
|
const content = `
|
|
135
174
|
// GENERATED FILE - DO NOT EDIT. RUN \`yarn generate\` or \`yarn generate:data\`
|
|
136
|
-
import { Fr } from '@aztec/foundation/
|
|
175
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
176
|
+
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
137
177
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
178
|
+
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
138
179
|
|
|
139
180
|
${generateNames(names)}
|
|
140
181
|
|
|
@@ -142,9 +183,11 @@ async function generateOutputFile(names, leaves) {
|
|
|
142
183
|
|
|
143
184
|
${generateContractAddresses(names)}
|
|
144
185
|
|
|
145
|
-
${
|
|
186
|
+
${generateDerivedAddresses(names, contractData)}
|
|
187
|
+
|
|
188
|
+
${generateClassIdPreimages(names, contractData)}
|
|
146
189
|
|
|
147
|
-
${await
|
|
190
|
+
${await generateProtocolContractsList(names, contractData)}
|
|
148
191
|
|
|
149
192
|
${await generateLogTags()}
|
|
150
193
|
`;
|
|
@@ -153,17 +196,16 @@ async function generateOutputFile(names, leaves) {
|
|
|
153
196
|
async function main() {
|
|
154
197
|
await clearDestDir();
|
|
155
198
|
const srcNames = JSON.parse(await fs.readFile(path.join(noirContractsRoot, 'protocol_contracts.json'), 'utf8'));
|
|
156
|
-
const
|
|
199
|
+
const contractDataList = [];
|
|
157
200
|
const destNames = srcNames.map((n)=>n.split('-')[1]);
|
|
158
201
|
for(let i = 0; i < srcNames.length; i++){
|
|
159
202
|
const srcName = srcNames[i];
|
|
160
203
|
const destName = destNames[i];
|
|
161
204
|
const artifact = await copyArtifact(srcName, destName);
|
|
162
205
|
await generateDeclarationFile(destName);
|
|
163
|
-
|
|
164
|
-
leaves.push(contractLeaf.toField());
|
|
206
|
+
contractDataList.push(await computeContractData(artifact, AztecAddress.fromBigInt(BigInt(contractAddressMapping[destName]))));
|
|
165
207
|
}
|
|
166
|
-
await generateOutputFile(destNames,
|
|
208
|
+
await generateOutputFile(destNames, contractDataList);
|
|
167
209
|
}
|
|
168
210
|
try {
|
|
169
211
|
await main();
|
package/dest/tests/fixtures.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
export declare function getSampleContractClassRegisteredEventPayload(): Buffer;
|
|
1
|
+
export declare function getSampleContractClassPublishedEventPayload(): Buffer;
|
|
4
2
|
export declare function getSamplePrivateFunctionBroadcastedEventPayload(): Buffer;
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
3
|
+
export declare function getSampleUtilityFunctionBroadcastedEventPayload(): Buffer;
|
|
4
|
+
export declare function getSampleContractInstancePublishedEventPayload(): Buffer;
|
|
7
5
|
export declare function getPathToFixture(name: string): string;
|
|
8
|
-
//# sourceMappingURL=
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZml4dHVyZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0cy9maXh0dXJlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLQSx3QkFBZ0IsMkNBQTJDLElBQUksTUFBTSxDQUdwRTtBQUdELHdCQUFnQiwrQ0FBK0MsSUFBSSxNQUFNLENBR3hFO0FBR0Qsd0JBQWdCLCtDQUErQyxJQUFJLE1BQU0sQ0FHeEU7QUFHRCx3QkFBZ0IsOENBQThDLElBQUksTUFBTSxDQUd2RTtBQUVELHdCQUFnQixnQkFBZ0IsQ0FBQyxJQUFJLEVBQUUsTUFBTSxVQUU1QyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/tests/fixtures.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/tests/fixtures.ts"],"names":[],"mappings":"AAKA,wBAAgB,2CAA2C,IAAI,MAAM,CAGpE;AAGD,wBAAgB,+CAA+C,IAAI,MAAM,CAGxE;AAGD,wBAAgB,+CAA+C,IAAI,MAAM,CAGxE;AAGD,wBAAgB,8CAA8C,IAAI,MAAM,CAGvE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,UAE5C"}
|
package/dest/tests/fixtures.js
CHANGED
|
@@ -2,8 +2,8 @@ import { readFileSync } from 'fs';
|
|
|
2
2
|
import { dirname, resolve } from 'path';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
5
|
-
export function
|
|
6
|
-
const path = getPathToFixture('
|
|
5
|
+
export function getSampleContractClassPublishedEventPayload() {
|
|
6
|
+
const path = getPathToFixture('ContractClassPublishedEventData.hex');
|
|
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
|
|
@@ -12,13 +12,13 @@ export function getSamplePrivateFunctionBroadcastedEventPayload() {
|
|
|
12
12
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
13
13
|
}
|
|
14
14
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
15
|
-
export function
|
|
16
|
-
const path = getPathToFixture('
|
|
15
|
+
export function getSampleUtilityFunctionBroadcastedEventPayload() {
|
|
16
|
+
const path = getPathToFixture('UtilityFunctionBroadcastedEventData.hex');
|
|
17
17
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
18
18
|
}
|
|
19
19
|
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
20
|
-
export function
|
|
21
|
-
const path = getPathToFixture('
|
|
20
|
+
export function getSampleContractInstancePublishedEventPayload() {
|
|
21
|
+
const path = getPathToFixture('ContractInstancePublishedEventData.hex');
|
|
22
22
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
23
23
|
}
|
|
24
24
|
export function getPathToFixture(name) {
|
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.
|
|
5
|
+
"version": "0.0.1-commit.001888fc",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dest/index.js",
|
|
@@ -14,23 +14,21 @@
|
|
|
14
14
|
"typedocOptions": {
|
|
15
15
|
"entryPoints": [
|
|
16
16
|
"./src/index.ts",
|
|
17
|
-
"./src/class-
|
|
18
|
-
"./src/instance-
|
|
17
|
+
"./src/class-registry/index.ts",
|
|
18
|
+
"./src/instance-registry/index.ts"
|
|
19
19
|
],
|
|
20
20
|
"name": "Protocol Contracts",
|
|
21
21
|
"tsconfig": "./tsconfig.json"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"build": "yarn clean && yarn generate && yarn generate:cleanup-artifacts && tsc
|
|
25
|
-
"build:keep-debug-symbols": "yarn clean && yarn generate && tsc
|
|
24
|
+
"build": "yarn clean && yarn generate && yarn generate:cleanup-artifacts && ../scripts/tsc.sh",
|
|
25
|
+
"build:keep-debug-symbols": "yarn clean && yarn generate && ../scripts/tsc.sh",
|
|
26
26
|
"generate": "yarn generate:data",
|
|
27
27
|
"generate:cleanup-artifacts": "node --no-warnings --loader @swc-node/register/esm src/scripts/cleanup_artifacts.ts",
|
|
28
28
|
"generate:data": "node --no-warnings --loader @swc-node/register/esm src/scripts/generate_data.ts",
|
|
29
|
-
"build:dev": "tsc
|
|
30
|
-
"build:ts": "tsc
|
|
29
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
30
|
+
"build:ts": "../scripts/tsc.sh",
|
|
31
31
|
"clean": "rm -rf ./dest .tsbuildinfo ./artifacts",
|
|
32
|
-
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
|
|
33
|
-
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
34
32
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
35
33
|
},
|
|
36
34
|
"inherits": [
|
|
@@ -68,27 +66,32 @@
|
|
|
68
66
|
"testTimeout": 120000,
|
|
69
67
|
"setupFiles": [
|
|
70
68
|
"../../foundation/src/jest/setup.mjs"
|
|
69
|
+
],
|
|
70
|
+
"testEnvironment": "../../foundation/src/jest/env.mjs",
|
|
71
|
+
"setupFilesAfterEnv": [
|
|
72
|
+
"../../foundation/src/jest/setupAfterEnv.mjs"
|
|
71
73
|
]
|
|
72
74
|
},
|
|
73
75
|
"dependencies": {
|
|
74
|
-
"@aztec/constants": "0.0.
|
|
75
|
-
"@aztec/foundation": "0.0.
|
|
76
|
-
"@aztec/stdlib": "0.0.
|
|
76
|
+
"@aztec/constants": "0.0.1-commit.001888fc",
|
|
77
|
+
"@aztec/foundation": "0.0.1-commit.001888fc",
|
|
78
|
+
"@aztec/stdlib": "0.0.1-commit.001888fc",
|
|
77
79
|
"lodash.chunk": "^4.2.0",
|
|
78
80
|
"lodash.omit": "^4.5.0",
|
|
79
81
|
"tslib": "^2.4.0"
|
|
80
82
|
},
|
|
81
83
|
"devDependencies": {
|
|
82
|
-
"@jest/globals": "^
|
|
83
|
-
"@types/jest": "^
|
|
84
|
+
"@jest/globals": "^30.0.0",
|
|
85
|
+
"@types/jest": "^30.0.0",
|
|
84
86
|
"@types/lodash.chunk": "^4.2.9",
|
|
85
87
|
"@types/lodash.omit": "^4.5.9",
|
|
86
|
-
"@types/node": "^
|
|
87
|
-
"
|
|
88
|
-
"jest
|
|
89
|
-
"
|
|
88
|
+
"@types/node": "^22.15.17",
|
|
89
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
90
|
+
"jest": "^30.0.0",
|
|
91
|
+
"jest-mock-extended": "^4.0.0",
|
|
92
|
+
"ts-loader": "^9.5.4",
|
|
90
93
|
"ts-node": "^10.9.1",
|
|
91
|
-
"typescript": "^5.
|
|
94
|
+
"typescript": "^5.3.3"
|
|
92
95
|
},
|
|
93
96
|
"files": [
|
|
94
97
|
"dest",
|
|
@@ -98,6 +101,6 @@
|
|
|
98
101
|
"!src/scripts/*"
|
|
99
102
|
],
|
|
100
103
|
"engines": {
|
|
101
|
-
"node": ">=
|
|
104
|
+
"node": ">=20.10"
|
|
102
105
|
}
|
|
103
106
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
1
|
+
import { type ContractArtifact, loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
import type { NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
3
3
|
|
|
4
|
-
import AuthRegistryJson from '../../artifacts/AuthRegistry.json'
|
|
4
|
+
import AuthRegistryJson from '../../artifacts/AuthRegistry.json' with { type: 'json' };
|
|
5
5
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
6
6
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
7
7
|
|
|
8
8
|
let protocolContract: ProtocolContract;
|
|
9
9
|
|
|
10
|
-
export const AuthRegistryArtifact = loadContractArtifact(AuthRegistryJson as NoirCompiledContract);
|
|
10
|
+
export const AuthRegistryArtifact: ContractArtifact = loadContractArtifact(AuthRegistryJson as NoirCompiledContract);
|
|
11
11
|
|
|
12
12
|
/** Returns the canonical deployment of the auth registry. */
|
|
13
|
-
export
|
|
13
|
+
export function getCanonicalAuthRegistry(): Promise<ProtocolContract> {
|
|
14
14
|
if (!protocolContract) {
|
|
15
|
-
protocolContract =
|
|
15
|
+
protocolContract = makeProtocolContract('AuthRegistry', AuthRegistryArtifact);
|
|
16
16
|
}
|
|
17
|
-
return protocolContract;
|
|
17
|
+
return Promise.resolve(protocolContract);
|
|
18
18
|
}
|
|
@@ -8,10 +8,10 @@ let protocolContractArtifact: ContractArtifact;
|
|
|
8
8
|
|
|
9
9
|
export async function getAuthRegistryArtifact(): Promise<ContractArtifact> {
|
|
10
10
|
if (!protocolContractArtifact) {
|
|
11
|
-
// Cannot assert this import as it's incompatible with
|
|
12
|
-
// https://
|
|
13
|
-
//
|
|
14
|
-
//
|
|
11
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
12
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
13
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
14
|
+
// "text/javascript"
|
|
15
15
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
16
16
|
const { default: authRegistryJson } = await import('../../artifacts/AuthRegistry.json');
|
|
17
17
|
protocolContractArtifact = loadContractArtifact(authRegistryJson);
|
|
@@ -23,7 +23,7 @@ export async function getAuthRegistryArtifact(): Promise<ContractArtifact> {
|
|
|
23
23
|
export async function getCanonicalAuthRegistry(): Promise<ProtocolContract> {
|
|
24
24
|
if (!protocolContract) {
|
|
25
25
|
const authRegistryArtifact = await getAuthRegistryArtifact();
|
|
26
|
-
protocolContract =
|
|
26
|
+
protocolContract = makeProtocolContract('AuthRegistry', authRegistryArtifact);
|
|
27
27
|
}
|
|
28
28
|
return protocolContract;
|
|
29
29
|
}
|