@aztec/protocol-contracts 0.0.1-fake-ceab37513c → 0.0.2-commit.217f559981
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 +1625 -1630
- package/artifacts/ContractClassRegistry.json +897 -7230
- package/artifacts/ContractInstanceRegistry.json +1105 -1772
- package/artifacts/FeeJuice.json +2884 -1598
- package/artifacts/MultiCallEntrypoint.json +1190 -1129
- package/artifacts/PublicChecks.json +988 -0
- package/dest/auth-registry/index.d.ts +1 -1
- package/dest/auth-registry/index.d.ts.map +1 -1
- package/dest/auth-registry/index.js +3 -3
- 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 +3 -2
- package/dest/class-registry/contract_class_published_event.d.ts.map +1 -1
- package/dest/class-registry/contract_class_published_event.js +4 -0
- package/dest/class-registry/index.d.ts +1 -1
- package/dest/class-registry/index.d.ts.map +1 -1
- package/dest/class-registry/index.js +3 -3
- package/dest/class-registry/lazy.d.ts +1 -1
- package/dest/class-registry/lazy.js +5 -5
- package/dest/class-registry/private_function_broadcasted_event.d.ts +2 -2
- package/dest/class-registry/private_function_broadcasted_event.d.ts.map +1 -1
- package/dest/class-registry/utility_function_broadcasted_event.d.ts +2 -2
- package/dest/class-registry/utility_function_broadcasted_event.d.ts.map +1 -1
- package/dest/class-registry/utility_function_broadcasted_event.js +1 -1
- 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 +3 -3
- 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 +3 -2
- package/dest/instance-registry/contract_instance_published_event.d.ts.map +1 -1
- package/dest/instance-registry/contract_instance_published_event.js +4 -1
- package/dest/instance-registry/contract_instance_updated_event.d.ts +2 -2
- package/dest/instance-registry/contract_instance_updated_event.d.ts.map +1 -1
- package/dest/instance-registry/contract_instance_updated_event.js +5 -7
- package/dest/instance-registry/index.d.ts +1 -1
- package/dest/instance-registry/index.d.ts.map +1 -1
- package/dest/instance-registry/index.js +3 -3
- package/dest/instance-registry/lazy.d.ts +1 -1
- package/dest/instance-registry/lazy.js +5 -5
- 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 +3 -3
- 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 +25 -11
- package/dest/protocol_contract_data.d.ts.map +1 -1
- package/dest/protocol_contract_data.js +113 -13
- package/dest/provider/bundle.d.ts +1 -1
- package/dest/provider/bundle.d.ts.map +1 -1
- package/dest/provider/bundle.js +3 -3
- package/dest/provider/lazy.d.ts +1 -1
- package/dest/provider/lazy.d.ts.map +1 -1
- package/dest/provider/lazy.js +3 -3
- 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/generate_data.js +88 -37
- package/dest/tests/fixtures.d.ts +1 -1
- package/package.json +9 -8
- package/src/auth-registry/index.ts +3 -3
- package/src/auth-registry/lazy.ts +5 -5
- package/src/class-registry/contract_class_published_event.ts +8 -1
- package/src/class-registry/index.ts +3 -3
- package/src/class-registry/lazy.ts +5 -5
- package/src/class-registry/private_function_broadcasted_event.ts +1 -1
- package/src/class-registry/utility_function_broadcasted_event.ts +1 -1
- package/src/fee-juice/index.ts +4 -4
- package/src/fee-juice/lazy.ts +5 -5
- package/src/index.ts +0 -1
- package/src/instance-registry/contract_instance_published_event.ts +7 -1
- package/src/instance-registry/contract_instance_updated_event.ts +6 -8
- package/src/instance-registry/index.ts +3 -3
- package/src/instance-registry/lazy.ts +5 -5
- package/src/make_protocol_contract.ts +37 -15
- package/src/multi-call-entrypoint/index.ts +3 -3
- package/src/multi-call-entrypoint/lazy.ts +5 -5
- package/src/protocol_contract_data.ts +91 -13
- package/src/provider/bundle.ts +3 -3
- package/src/provider/lazy.ts +3 -3
- package/src/{router → public-checks}/index.ts +5 -5
- package/src/public-checks/lazy.ts +29 -0
- package/artifacts/Router.json +0 -4629
- 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/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/protocol_contract_tree.ts +0 -44
- package/src/router/lazy.ts +0 -29
- /package/artifacts/{Router.d.json.ts → PublicChecks.d.json.ts} +0 -0
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.2-commit.217f559981",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dest/index.js",
|
|
@@ -21,13 +21,13 @@
|
|
|
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
32
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
33
33
|
},
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
]
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@aztec/constants": "0.0.
|
|
77
|
-
"@aztec/foundation": "0.0.
|
|
78
|
-
"@aztec/stdlib": "0.0.
|
|
76
|
+
"@aztec/constants": "0.0.2-commit.217f559981",
|
|
77
|
+
"@aztec/foundation": "0.0.2-commit.217f559981",
|
|
78
|
+
"@aztec/stdlib": "0.0.2-commit.217f559981",
|
|
79
79
|
"lodash.chunk": "^4.2.0",
|
|
80
80
|
"lodash.omit": "^4.5.0",
|
|
81
81
|
"tslib": "^2.4.0"
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
"@types/lodash.chunk": "^4.2.9",
|
|
87
87
|
"@types/lodash.omit": "^4.5.9",
|
|
88
88
|
"@types/node": "^22.15.17",
|
|
89
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
89
90
|
"jest": "^30.0.0",
|
|
90
91
|
"jest-mock-extended": "^4.0.0",
|
|
91
92
|
"ts-loader": "^9.5.4",
|
|
@@ -10,9 +10,9 @@ let protocolContract: ProtocolContract;
|
|
|
10
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
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CONTRACT_CLASS_PUBLISHED_MAGIC_VALUE } from '@aztec/constants';
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import { FieldReader } from '@aztec/foundation/serialize';
|
|
4
4
|
import { bufferFromFields } from '@aztec/stdlib/abi';
|
|
5
5
|
import {
|
|
@@ -29,6 +29,7 @@ export class ContractClassPublishedEvent {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
static fromLog(log: ContractClassLog) {
|
|
32
|
+
// See how the log is serialized in `noir-projects/noir-contracts/contracts/protocol/contract_class_registry_contract/src/events/class_published.nr`.
|
|
32
33
|
const fieldsWithoutTag = log.fields.fields.slice(1);
|
|
33
34
|
const reader = new FieldReader(fieldsWithoutTag);
|
|
34
35
|
const contractClassId = reader.readField();
|
|
@@ -73,4 +74,10 @@ export class ContractClassPublishedEvent {
|
|
|
73
74
|
utilityFunctions: [],
|
|
74
75
|
};
|
|
75
76
|
}
|
|
77
|
+
|
|
78
|
+
public static extractContractClassEvents(logs: ContractClassLog[]): ContractClassPublishedEvent[] {
|
|
79
|
+
return logs
|
|
80
|
+
.filter((log: ContractClassLog) => ContractClassPublishedEvent.isContractClassPublishedEvent(log))
|
|
81
|
+
.map((log: ContractClassLog) => ContractClassPublishedEvent.fromLog(log));
|
|
82
|
+
}
|
|
76
83
|
}
|
|
@@ -14,10 +14,10 @@ export const ContractClassRegistryArtifact = loadContractArtifact(ContractClassR
|
|
|
14
14
|
let protocolContract: ProtocolContract;
|
|
15
15
|
|
|
16
16
|
/** Returns the canonical deployment of the contract. */
|
|
17
|
-
export
|
|
17
|
+
export function getCanonicalClassRegistry(): Promise<ProtocolContract> {
|
|
18
18
|
if (!protocolContract) {
|
|
19
19
|
const artifact = ContractClassRegistryArtifact;
|
|
20
|
-
protocolContract =
|
|
20
|
+
protocolContract = makeProtocolContract('ContractClassRegistry', artifact);
|
|
21
21
|
}
|
|
22
|
-
return protocolContract;
|
|
22
|
+
return Promise.resolve(protocolContract);
|
|
23
23
|
}
|
|
@@ -12,10 +12,10 @@ let protocolContractArtifact: ContractArtifact;
|
|
|
12
12
|
|
|
13
13
|
export async function getContractClassRegistryArtifact(): Promise<ContractArtifact> {
|
|
14
14
|
if (!protocolContractArtifact) {
|
|
15
|
-
// Cannot assert this import as it's incompatible with
|
|
16
|
-
// https://
|
|
17
|
-
//
|
|
18
|
-
//
|
|
15
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
16
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
17
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
18
|
+
// "text/javascript"
|
|
19
19
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
20
20
|
const { default: contractClassRegistryJson } = await import('../../artifacts/ContractClassRegistry.json');
|
|
21
21
|
protocolContractArtifact = loadContractArtifact(contractClassRegistryJson);
|
|
@@ -27,7 +27,7 @@ export async function getContractClassRegistryArtifact(): Promise<ContractArtifa
|
|
|
27
27
|
export async function getCanonicalClassRegistry(): Promise<ProtocolContract> {
|
|
28
28
|
if (!protocolContract) {
|
|
29
29
|
const contractClassRegistryArtifact = await getContractClassRegistryArtifact();
|
|
30
|
-
protocolContract =
|
|
30
|
+
protocolContract = makeProtocolContract('ContractClassRegistry', contractClassRegistryArtifact);
|
|
31
31
|
}
|
|
32
32
|
return protocolContract;
|
|
33
33
|
}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
FUNCTION_TREE_HEIGHT,
|
|
5
5
|
MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS,
|
|
6
6
|
} from '@aztec/constants';
|
|
7
|
-
import { Fr } from '@aztec/foundation/
|
|
7
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
8
|
import type { Tuple } from '@aztec/foundation/serialize';
|
|
9
9
|
import { FieldReader } from '@aztec/foundation/serialize';
|
|
10
10
|
import { FunctionSelector, bufferFromFields } from '@aztec/stdlib/abi';
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
MAX_PACKED_BYTECODE_SIZE_PER_UTILITY_FUNCTION_IN_FIELDS,
|
|
5
5
|
} from '@aztec/constants';
|
|
6
6
|
import { removeArrayPaddingEnd } from '@aztec/foundation/collection';
|
|
7
|
-
import { Fr } from '@aztec/foundation/
|
|
7
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
8
|
import type { Tuple } from '@aztec/foundation/serialize';
|
|
9
9
|
import { FieldReader } from '@aztec/foundation/serialize';
|
|
10
10
|
import { FunctionSelector, bufferFromFields } from '@aztec/stdlib/abi';
|
package/src/fee-juice/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
3
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import { computePublicDataTreeLeafSlot, deriveStorageSlotInMap } from '@aztec/stdlib/hash';
|
|
@@ -14,11 +14,11 @@ export const FeeJuiceArtifact = loadContractArtifact(FeeJuiceJson as NoirCompile
|
|
|
14
14
|
let protocolContract: ProtocolContract;
|
|
15
15
|
|
|
16
16
|
/** Returns the canonical deployment of the contract. */
|
|
17
|
-
export
|
|
17
|
+
export function getCanonicalFeeJuice(): Promise<ProtocolContract> {
|
|
18
18
|
if (!protocolContract) {
|
|
19
|
-
protocolContract =
|
|
19
|
+
protocolContract = makeProtocolContract('FeeJuice', FeeJuiceArtifact);
|
|
20
20
|
}
|
|
21
|
-
return protocolContract;
|
|
21
|
+
return Promise.resolve(protocolContract);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/**
|
package/src/fee-juice/lazy.ts
CHANGED
|
@@ -8,10 +8,10 @@ let protocolContractArtifact: ContractArtifact;
|
|
|
8
8
|
|
|
9
9
|
export async function getFeeJuiceArtifact(): 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: feeJuiceJson } = await import('../../artifacts/FeeJuice.json');
|
|
17
17
|
protocolContractArtifact = loadContractArtifact(feeJuiceJson);
|
|
@@ -23,7 +23,7 @@ export async function getFeeJuiceArtifact(): Promise<ContractArtifact> {
|
|
|
23
23
|
export async function getCanonicalFeeJuice(): Promise<ProtocolContract> {
|
|
24
24
|
if (!protocolContract) {
|
|
25
25
|
const feeJuiceArtifact = await getFeeJuiceArtifact();
|
|
26
|
-
protocolContract =
|
|
26
|
+
protocolContract = makeProtocolContract('FeeJuice', feeJuiceArtifact);
|
|
27
27
|
}
|
|
28
28
|
return protocolContract;
|
|
29
29
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
@@ -61,4 +61,10 @@ export class ContractInstancePublishedEvent {
|
|
|
61
61
|
deployer: this.deployer,
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
+
|
|
65
|
+
public static extractContractInstanceEvents(logs: PrivateLog[]): ContractInstancePublishedEvent[] {
|
|
66
|
+
return logs
|
|
67
|
+
.filter(log => ContractInstancePublishedEvent.isContractInstancePublishedEvent(log))
|
|
68
|
+
.map(log => ContractInstancePublishedEvent.fromLog(log));
|
|
69
|
+
}
|
|
64
70
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE } from '@aztec/constants';
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
3
|
-
import {
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import { FieldReader } from '@aztec/foundation/serialize';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
5
|
import type { ContractInstanceUpdateWithAddress } from '@aztec/stdlib/contract';
|
|
6
6
|
import type { PublicLog } from '@aztec/stdlib/logs';
|
|
@@ -25,13 +25,11 @@ export class ContractInstanceUpdatedEvent {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
static fromLog(log: PublicLog) {
|
|
28
|
-
const
|
|
29
|
-
const reader = new BufferReader(bufferWithoutAddressAndTag);
|
|
28
|
+
const reader = new FieldReader(log.fields.slice(1) /* remove tag */);
|
|
30
29
|
const address = reader.readObject(AztecAddress);
|
|
31
|
-
const prevContractClassId = reader.
|
|
32
|
-
const newContractClassId = reader.
|
|
33
|
-
const timestampOfChange = reader.
|
|
34
|
-
|
|
30
|
+
const prevContractClassId = reader.readField();
|
|
31
|
+
const newContractClassId = reader.readField();
|
|
32
|
+
const timestampOfChange = reader.readField().toBigInt();
|
|
35
33
|
return new ContractInstanceUpdatedEvent(address, prevContractClassId, newContractClassId, timestampOfChange);
|
|
36
34
|
}
|
|
37
35
|
|
|
@@ -15,9 +15,9 @@ export const ContractInstanceRegistryArtifact = loadContractArtifact(
|
|
|
15
15
|
let protocolContract: ProtocolContract;
|
|
16
16
|
|
|
17
17
|
/** Returns the canonical deployment of the contract. */
|
|
18
|
-
export
|
|
18
|
+
export function getCanonicalInstanceRegistry(): Promise<ProtocolContract> {
|
|
19
19
|
if (!protocolContract) {
|
|
20
|
-
protocolContract =
|
|
20
|
+
protocolContract = makeProtocolContract('ContractInstanceRegistry', ContractInstanceRegistryArtifact);
|
|
21
21
|
}
|
|
22
|
-
return protocolContract;
|
|
22
|
+
return Promise.resolve(protocolContract);
|
|
23
23
|
}
|
|
@@ -11,10 +11,10 @@ let protocolContractArtifact: ContractArtifact;
|
|
|
11
11
|
|
|
12
12
|
export async function getContractInstanceRegistryArtifact(): Promise<ContractArtifact> {
|
|
13
13
|
if (!protocolContractArtifact) {
|
|
14
|
-
// Cannot assert this import as it's incompatible with
|
|
15
|
-
// https://
|
|
16
|
-
//
|
|
17
|
-
//
|
|
14
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
15
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
16
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
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');
|
|
20
20
|
protocolContractArtifact = loadContractArtifact(contractInstanceRegistryJson);
|
|
@@ -26,7 +26,7 @@ export async function getContractInstanceRegistryArtifact(): Promise<ContractArt
|
|
|
26
26
|
export async function getCanonicalInstanceRegistry(): Promise<ProtocolContract> {
|
|
27
27
|
if (!protocolContract) {
|
|
28
28
|
const contractInstanceRegistryArtifact = await getContractInstanceRegistryArtifact();
|
|
29
|
-
protocolContract =
|
|
29
|
+
protocolContract = makeProtocolContract('ContractInstanceRegistry', contractInstanceRegistryArtifact);
|
|
30
30
|
}
|
|
31
31
|
return protocolContract;
|
|
32
32
|
}
|
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
-
import {
|
|
2
|
+
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
3
3
|
|
|
4
4
|
import type { ProtocolContract } from './protocol_contract.js';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
ProtocolContractAddress,
|
|
7
|
+
ProtocolContractClassId,
|
|
8
|
+
ProtocolContractClassIdPreimage,
|
|
9
|
+
ProtocolContractInitializationHash,
|
|
10
|
+
type ProtocolContractName,
|
|
11
|
+
ProtocolContractPrivateFunctions,
|
|
12
|
+
ProtocolContractSalt,
|
|
13
|
+
} from './protocol_contract_data.js';
|
|
6
14
|
|
|
7
15
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
16
|
+
* Reconstructs a ProtocolContract from precomputed data without performing any hash computations.
|
|
17
|
+
* Internal to the protocol-contracts package — not part of the public API.
|
|
10
18
|
*/
|
|
11
|
-
export
|
|
12
|
-
name: ProtocolContractName,
|
|
13
|
-
artifact: ContractArtifact,
|
|
14
|
-
): Promise<ProtocolContract> {
|
|
19
|
+
export function makeProtocolContract(name: ProtocolContractName, artifact: ContractArtifact): ProtocolContract {
|
|
15
20
|
const address = ProtocolContractAddress[name];
|
|
16
21
|
const salt = ProtocolContractSalt[name];
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const classId = ProtocolContractClassId[name];
|
|
23
|
+
const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment } = ProtocolContractClassIdPreimage[name];
|
|
24
|
+
const initializationHash = ProtocolContractInitializationHash[name];
|
|
25
|
+
|
|
26
|
+
const contractClass = {
|
|
27
|
+
id: classId,
|
|
28
|
+
version: 1 as const,
|
|
29
|
+
artifactHash,
|
|
30
|
+
privateFunctionsRoot,
|
|
31
|
+
publicBytecodeCommitment,
|
|
32
|
+
packedBytecode: artifact.functions.find(f => f.name === 'public_dispatch')?.bytecode ?? Buffer.alloc(0),
|
|
33
|
+
privateFunctions: ProtocolContractPrivateFunctions[name],
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const instance = {
|
|
37
|
+
version: 1 as const,
|
|
38
|
+
currentContractClassId: classId,
|
|
39
|
+
originalContractClassId: classId,
|
|
40
|
+
initializationHash,
|
|
41
|
+
publicKeys: PublicKeys.default(),
|
|
42
|
+
salt,
|
|
43
|
+
deployer: address,
|
|
24
44
|
address,
|
|
25
45
|
};
|
|
46
|
+
|
|
47
|
+
return { instance, contractClass, artifact, address };
|
|
26
48
|
}
|
|
@@ -10,9 +10,9 @@ export const MultiCallEntrypointArtifact = loadContractArtifact(MultiCallEntrypo
|
|
|
10
10
|
let protocolContract: ProtocolContract;
|
|
11
11
|
|
|
12
12
|
/** Returns the canonical deployment of the contract. */
|
|
13
|
-
export
|
|
13
|
+
export function getCanonicalMultiCallEntrypoint(): Promise<ProtocolContract> {
|
|
14
14
|
if (!protocolContract) {
|
|
15
|
-
protocolContract =
|
|
15
|
+
protocolContract = makeProtocolContract('MultiCallEntrypoint', MultiCallEntrypointArtifact);
|
|
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 getMultiCallEntrypointArtifact(): 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: multiCallEntrypointJson } = await import('../../artifacts/MultiCallEntrypoint.json');
|
|
17
17
|
protocolContractArtifact = loadContractArtifact(multiCallEntrypointJson);
|
|
@@ -23,7 +23,7 @@ export async function getMultiCallEntrypointArtifact(): Promise<ContractArtifact
|
|
|
23
23
|
export async function getCanonicalMultiCallEntrypoint(): Promise<ProtocolContract> {
|
|
24
24
|
if (!protocolContract) {
|
|
25
25
|
const multiCallEntrypointArtifact = await getMultiCallEntrypointArtifact();
|
|
26
|
-
protocolContract =
|
|
26
|
+
protocolContract = makeProtocolContract('MultiCallEntrypoint', multiCallEntrypointArtifact);
|
|
27
27
|
}
|
|
28
28
|
return protocolContract;
|
|
29
29
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
// GENERATED FILE - DO NOT EDIT. RUN `yarn generate` or `yarn generate:data`
|
|
3
|
-
import { Fr } from '@aztec/foundation/
|
|
3
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
+
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
4
5
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
+
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
export const protocolContractNames = [
|
|
@@ -10,7 +12,7 @@
|
|
|
10
12
|
'ContractClassRegistry',
|
|
11
13
|
'MultiCallEntrypoint',
|
|
12
14
|
'FeeJuice',
|
|
13
|
-
'
|
|
15
|
+
'PublicChecks'
|
|
14
16
|
] as const;
|
|
15
17
|
|
|
16
18
|
export type ProtocolContractName = typeof protocolContractNames[number];
|
|
@@ -23,7 +25,7 @@ ContractInstanceRegistry: new Fr(1),
|
|
|
23
25
|
ContractClassRegistry: new Fr(1),
|
|
24
26
|
MultiCallEntrypoint: new Fr(1),
|
|
25
27
|
FeeJuice: new Fr(1),
|
|
26
|
-
|
|
28
|
+
PublicChecks: new Fr(1)
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
|
|
@@ -34,26 +36,102 @@ ContractInstanceRegistry: AztecAddress.fromBigInt(2n),
|
|
|
34
36
|
ContractClassRegistry: AztecAddress.fromBigInt(3n),
|
|
35
37
|
MultiCallEntrypoint: AztecAddress.fromBigInt(4n),
|
|
36
38
|
FeeJuice: AztecAddress.fromBigInt(5n),
|
|
37
|
-
|
|
39
|
+
PublicChecks: AztecAddress.fromBigInt(6n)
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
|
|
41
43
|
|
|
42
|
-
export const
|
|
43
|
-
AuthRegistry:
|
|
44
|
-
ContractInstanceRegistry:
|
|
45
|
-
ContractClassRegistry:
|
|
46
|
-
MultiCallEntrypoint:
|
|
47
|
-
FeeJuice:
|
|
48
|
-
|
|
44
|
+
export const ProtocolContractDerivedAddress = {
|
|
45
|
+
AuthRegistry: AztecAddress.fromString('0x05738188c145f5ae1f85ba32c2955df6cdadf5142a4a6db36c7bbf7919f07630'),
|
|
46
|
+
ContractInstanceRegistry: AztecAddress.fromString('0x0e0e44c7fd88f06c1a52e67137d92be96399a7d47ee5ca033bb306ec8d2b54f3'),
|
|
47
|
+
ContractClassRegistry: AztecAddress.fromString('0x14d670efa326a07b99777b01fb706427ca776095246569150f2a3f17a7d4dc66'),
|
|
48
|
+
MultiCallEntrypoint: AztecAddress.fromString('0x15bff1f94c1c820c5f9384e45114ae5b4c25489f816fdc5b80bfb5f54d852077'),
|
|
49
|
+
FeeJuice: AztecAddress.fromString('0x06ecf77d30887d7b701ad2235f560248e7c3d572e8640279f9d26d87312557ac'),
|
|
50
|
+
PublicChecks: AztecAddress.fromString('0x289c56a961e343e67f77ed2a9119fdf8b50f63034d598c5bba8ff280129e1579')
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
|
|
52
54
|
|
|
53
|
-
export const
|
|
55
|
+
export const ProtocolContractClassId: Record<ProtocolContractName, Fr> = {
|
|
56
|
+
AuthRegistry: Fr.fromString('0x07438c0ca498858064954149028e00a6038eb8ea5529373582574a77a0f913f1'),
|
|
57
|
+
ContractInstanceRegistry: Fr.fromString('0x2112df65cee9b5fc9d222613fc7df8d3e05dd542ad565c9f255ab7b728dd9cc0'),
|
|
58
|
+
ContractClassRegistry: Fr.fromString('0x013466b8a65dea98ad80c119cf236a0acf53acfede687769410cfd57876b8242'),
|
|
59
|
+
MultiCallEntrypoint: Fr.fromString('0x1f87f80a8331b63219e4b04f618b371c04b73b2246c058a0962d9848f15cf1d8'),
|
|
60
|
+
FeeJuice: Fr.fromString('0x0b0ee1791b48ea378c6aed2ccdc29c7a5e63a742d77871294174c6879509806f'),
|
|
61
|
+
PublicChecks: Fr.fromString('0x0f1f06f003dd2ccb739a1719b8dccc2800b4015e7387d1e6ab1126b480871c54')
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const ProtocolContractClassIdPreimage: Record<ProtocolContractName, { artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }> = {
|
|
65
|
+
AuthRegistry: {
|
|
66
|
+
artifactHash: Fr.fromString('0x2fcb5576b472becea02a1d5228473217bb2f63570d868abcf16205a23377ec70'),
|
|
67
|
+
privateFunctionsRoot: Fr.fromString('0x11900a485e3ffa03da98d89abb0c9419200644aaf17f5caa863953fccf1ed88f'),
|
|
68
|
+
publicBytecodeCommitment: Fr.fromString('0x2c9138ec76d2f7db9c313a411adb0855e334ba6bb1bbbe191fff14ee0799deea'),
|
|
69
|
+
},
|
|
70
|
+
ContractInstanceRegistry: {
|
|
71
|
+
artifactHash: Fr.fromString('0x18601566bacdca7a5a40528f221b04ee7b74f382e6cd34fbdf69d31c50d5ee88'),
|
|
72
|
+
privateFunctionsRoot: Fr.fromString('0x136a6705c7ad1d47f65cb881a56909d4c78d3fa8944f5b103734cd91e654ed63'),
|
|
73
|
+
publicBytecodeCommitment: Fr.fromString('0x2ca33d0ab4d4cc2339aa7fa0788572ad32465cd461a222930e71b166aca83967'),
|
|
74
|
+
},
|
|
75
|
+
ContractClassRegistry: {
|
|
76
|
+
artifactHash: Fr.fromString('0x232d868db8a4d1e0f013efa4bfe5c39d96e11f16a62e3e73abbbafc3028fc410'),
|
|
77
|
+
privateFunctionsRoot: Fr.fromString('0x2ac3bf890a7d534a768079aa86889caa1a86373c8e6fc2db48215b11bbb79106'),
|
|
78
|
+
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
79
|
+
},
|
|
80
|
+
MultiCallEntrypoint: {
|
|
81
|
+
artifactHash: Fr.fromString('0x10292f802f1c5b7c6c813c003f6e068e4396892beeb195c9e031a841a4ce5800'),
|
|
82
|
+
privateFunctionsRoot: Fr.fromString('0x266505ecb7c02ce6e227227c0b6bdb44713c8ecd43164ee7bb00b8fb340e8b03'),
|
|
83
|
+
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
84
|
+
},
|
|
85
|
+
FeeJuice: {
|
|
86
|
+
artifactHash: Fr.fromString('0x2eb476f12cce5207be118047fb7f603378b78aa619d6539a4d9eec4700ea2507'),
|
|
87
|
+
privateFunctionsRoot: Fr.fromString('0x0abef3cfc6ae314886c841b42dc33d3eed255ad3dee7773daabf05b229573759'),
|
|
88
|
+
publicBytecodeCommitment: Fr.fromString('0x140b663a54207869cc411e3731d38cd65ea323ac2fc6004d3d73b7f175bb0f33'),
|
|
89
|
+
},
|
|
90
|
+
PublicChecks: {
|
|
91
|
+
artifactHash: Fr.fromString('0x003d3e0bff7456e270c38b0ae046cc77fa0b677df8d5bce6d7ff9bb7ecdfdbdd'),
|
|
92
|
+
privateFunctionsRoot: Fr.fromString('0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1'),
|
|
93
|
+
publicBytecodeCommitment: Fr.fromString('0x2d0834fc9468fd2092091852543a2fbd7b6b313c7e5e4defe8730c8065366a03'),
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const ProtocolContractInitializationHash: Record<ProtocolContractName, Fr> = {
|
|
98
|
+
AuthRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
99
|
+
ContractInstanceRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
100
|
+
ContractClassRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
101
|
+
MultiCallEntrypoint: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
102
|
+
FeeJuice: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
103
|
+
PublicChecks: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const ProtocolContractPrivateFunctions: Record<ProtocolContractName, { selector: FunctionSelector; vkHash: Fr }[]> = {
|
|
107
|
+
AuthRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000079a3d418')), vkHash: Fr.fromString('0x185a64e85b31ece67103f33ec67ddef374308c0a5dc2b7f37e016bca0dce63fb') }],
|
|
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
|
+
FeeJuice: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000cbe67243')), vkHash: Fr.fromString('0x2ad6083b4595f8076c014e5152191013167ab1b5a31ad0cbb06490054c7c59ae') }, { selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000e8d374b6')), vkHash: Fr.fromString('0x05aaffffdf797625ff24575d939339303775c5db77fb6bdcecbf955f726fd071') }],
|
|
112
|
+
PublicChecks: []
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
export const ProtocolContractsList = new ProtocolContracts([
|
|
118
|
+
AztecAddress.fromString('0x05738188c145f5ae1f85ba32c2955df6cdadf5142a4a6db36c7bbf7919f07630'),
|
|
119
|
+
AztecAddress.fromString('0x0e0e44c7fd88f06c1a52e67137d92be96399a7d47ee5ca033bb306ec8d2b54f3'),
|
|
120
|
+
AztecAddress.fromString('0x14d670efa326a07b99777b01fb706427ca776095246569150f2a3f17a7d4dc66'),
|
|
121
|
+
AztecAddress.fromString('0x15bff1f94c1c820c5f9384e45114ae5b4c25489f816fdc5b80bfb5f54d852077'),
|
|
122
|
+
AztecAddress.fromString('0x06ecf77d30887d7b701ad2235f560248e7c3d572e8640279f9d26d87312557ac'),
|
|
123
|
+
AztecAddress.fromString('0x289c56a961e343e67f77ed2a9119fdf8b50f63034d598c5bba8ff280129e1579'),
|
|
124
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
125
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
126
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
127
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
128
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
129
|
+
]);
|
|
130
|
+
|
|
131
|
+
export const protocolContractsHash = Fr.fromString('0x1e13776ddffd17d2a72e97753ee4bdc8fa83f7c826e35421e3c0844ee732a82b');
|
|
54
132
|
|
|
55
133
|
|
|
56
134
|
|
|
57
|
-
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('
|
|
135
|
+
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('0x1a7e1badb79abdd38c684b3c8306ffe7ecb33c69e3380d9855730aaaa83a21a8');
|
|
58
136
|
|
|
59
137
|
|
package/src/provider/bundle.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
|
8
8
|
import { MultiCallEntrypointArtifact } from '../multi-call-entrypoint/index.js';
|
|
9
9
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
10
10
|
import type { ProtocolContractName } from '../protocol_contract_data.js';
|
|
11
|
-
import {
|
|
11
|
+
import { PublicChecksArtifact } from '../public-checks/index.js';
|
|
12
12
|
import type { ProtocolContractsProvider } from './protocol_contracts_provider.js';
|
|
13
13
|
|
|
14
14
|
export const ProtocolContractArtifact: Record<ProtocolContractName, ContractArtifact> = {
|
|
@@ -17,11 +17,11 @@ export const ProtocolContractArtifact: Record<ProtocolContractName, ContractArti
|
|
|
17
17
|
ContractClassRegistry: ContractClassRegistryArtifact,
|
|
18
18
|
MultiCallEntrypoint: MultiCallEntrypointArtifact,
|
|
19
19
|
FeeJuice: FeeJuiceArtifact,
|
|
20
|
-
|
|
20
|
+
PublicChecks: PublicChecksArtifact,
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export class BundledProtocolContractsProvider implements ProtocolContractsProvider {
|
|
24
24
|
getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract> {
|
|
25
|
-
return makeProtocolContract(name, ProtocolContractArtifact[name]);
|
|
25
|
+
return Promise.resolve(makeProtocolContract(name, ProtocolContractArtifact[name]));
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/provider/lazy.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { getCanonicalInstanceRegistry } from '../instance-registry/lazy.js';
|
|
|
5
5
|
import { getCanonicalMultiCallEntrypoint } from '../multi-call-entrypoint/lazy.js';
|
|
6
6
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
7
7
|
import type { ProtocolContractName } from '../protocol_contract_data.js';
|
|
8
|
-
import {
|
|
8
|
+
import { getCanonicalPublicChecks } from '../public-checks/lazy.js';
|
|
9
9
|
import type { ProtocolContractsProvider } from './protocol_contracts_provider.js';
|
|
10
10
|
|
|
11
11
|
export class LazyProtocolContractsProvider implements ProtocolContractsProvider {
|
|
@@ -21,8 +21,8 @@ export class LazyProtocolContractsProvider implements ProtocolContractsProvider
|
|
|
21
21
|
return getCanonicalMultiCallEntrypoint();
|
|
22
22
|
case 'FeeJuice':
|
|
23
23
|
return getCanonicalFeeJuice();
|
|
24
|
-
case '
|
|
25
|
-
return
|
|
24
|
+
case 'PublicChecks':
|
|
25
|
+
return getCanonicalPublicChecks();
|
|
26
26
|
default:
|
|
27
27
|
throw new Error(`Unknown protocol contract name: ${name}`);
|
|
28
28
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
import type { NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import PublicChecksJson from '../../artifacts/PublicChecks.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
|
-
export const
|
|
8
|
+
export const PublicChecksArtifact = loadContractArtifact(PublicChecksJson as NoirCompiledContract);
|
|
9
9
|
|
|
10
10
|
let protocolContract: ProtocolContract;
|
|
11
11
|
|
|
12
12
|
/** Returns the canonical deployment of the contract. */
|
|
13
|
-
export
|
|
13
|
+
export function getCanonicalPublicChecks(): Promise<ProtocolContract> {
|
|
14
14
|
if (!protocolContract) {
|
|
15
|
-
protocolContract =
|
|
15
|
+
protocolContract = makeProtocolContract('PublicChecks', PublicChecksArtifact);
|
|
16
16
|
}
|
|
17
|
-
return protocolContract;
|
|
17
|
+
return Promise.resolve(protocolContract);
|
|
18
18
|
}
|