@aztec/protocol-contracts 0.0.1-commit.4d79d1f2d → 0.0.1-commit.4d9804df
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 +2644 -444
- package/artifacts/ContractInstanceRegistry.json +3523 -936
- package/artifacts/FeeJuice.json +3989 -959
- 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 +3 -5
- 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 +2 -4
- package/dest/fee-juice/index.d.ts +1 -1
- package/dest/fee-juice/index.d.ts.map +1 -1
- package/dest/fee-juice/index.js +3 -3
- package/dest/fee-juice/lazy.js +2 -2
- 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/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.js +2 -2
- 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 +30 -14
- 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 +14 -5
- package/dest/protocol_contract_data.d.ts.map +1 -1
- package/dest/protocol_contract_data.js +72 -32
- package/dest/provider/bundle.d.ts +1 -1
- package/dest/provider/bundle.d.ts.map +1 -1
- package/dest/provider/bundle.js +2 -8
- 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 +75 -28
- package/dest/tests/fixtures.d.ts +1 -3
- package/dest/tests/fixtures.d.ts.map +1 -1
- package/dest/tests/fixtures.js +2 -12
- package/package.json +4 -4
- package/src/class-registry/contract_class_published_event.ts +16 -22
- package/src/class-registry/index.ts +3 -5
- package/src/class-registry/lazy.ts +2 -4
- package/src/fee-juice/index.ts +3 -3
- package/src/fee-juice/lazy.ts +2 -2
- package/src/instance-registry/contract_instance_published_event.ts +5 -1
- package/src/instance-registry/index.ts +3 -3
- package/src/instance-registry/lazy.ts +2 -2
- package/src/make_protocol_contract.ts +39 -15
- package/src/protocol_contract.ts +9 -1
- package/src/protocol_contract_data.ts +61 -34
- package/src/provider/bundle.ts +1 -7
- package/src/provider/lazy.ts +0 -9
- package/src/tests/fixtures.ts +2 -14
- package/artifacts/AuthRegistry.d.json.ts +0 -5
- package/artifacts/AuthRegistry.json +0 -2764
- package/artifacts/MultiCallEntrypoint.d.json.ts +0 -5
- package/artifacts/MultiCallEntrypoint.json +0 -2769
- package/artifacts/PublicChecks.d.json.ts +0 -5
- package/artifacts/PublicChecks.json +0 -980
- 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
|
@@ -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,
|
|
@@ -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
|
}
|
|
@@ -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');
|
|
@@ -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,50 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
1
2
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
-
import {
|
|
3
|
+
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
3
4
|
|
|
4
5
|
import type { ProtocolContract } from './protocol_contract.js';
|
|
5
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
ProtocolContractAddress,
|
|
8
|
+
ProtocolContractClassId,
|
|
9
|
+
ProtocolContractClassIdPreimage,
|
|
10
|
+
ProtocolContractInitializationHash,
|
|
11
|
+
type ProtocolContractName,
|
|
12
|
+
ProtocolContractPrivateFunctions,
|
|
13
|
+
ProtocolContractSalt,
|
|
14
|
+
} from './protocol_contract_data.js';
|
|
6
15
|
|
|
7
16
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
17
|
+
* Reconstructs a ProtocolContract from precomputed data without performing any hash computations.
|
|
18
|
+
* Internal to the protocol-contracts package — not part of the public API.
|
|
10
19
|
*/
|
|
11
|
-
export
|
|
12
|
-
name: ProtocolContractName,
|
|
13
|
-
artifact: ContractArtifact,
|
|
14
|
-
): Promise<ProtocolContract> {
|
|
20
|
+
export function makeProtocolContract(name: ProtocolContractName, artifact: ContractArtifact): ProtocolContract {
|
|
15
21
|
const address = ProtocolContractAddress[name];
|
|
16
22
|
const salt = ProtocolContractSalt[name];
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
const classId = ProtocolContractClassId[name];
|
|
24
|
+
const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment } = ProtocolContractClassIdPreimage[name];
|
|
25
|
+
const initializationHash = ProtocolContractInitializationHash[name];
|
|
26
|
+
|
|
27
|
+
const contractClass = {
|
|
28
|
+
id: classId,
|
|
29
|
+
version: 1 as const,
|
|
30
|
+
artifactHash,
|
|
31
|
+
privateFunctionsRoot,
|
|
32
|
+
publicBytecodeCommitment,
|
|
33
|
+
packedBytecode: artifact.functions.find(f => f.name === 'public_dispatch')?.bytecode ?? Buffer.alloc(0),
|
|
34
|
+
privateFunctions: ProtocolContractPrivateFunctions[name],
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const instance = {
|
|
38
|
+
version: 2 as const,
|
|
39
|
+
currentContractClassId: classId,
|
|
40
|
+
originalContractClassId: classId,
|
|
41
|
+
initializationHash,
|
|
42
|
+
immutablesHash: Fr.ZERO, // Protocol Contracts Have No Immutables
|
|
43
|
+
publicKeys: PublicKeys.default(),
|
|
44
|
+
salt,
|
|
45
|
+
deployer: address,
|
|
24
46
|
address,
|
|
25
47
|
};
|
|
48
|
+
|
|
49
|
+
return { instance, contractClass, artifact, address };
|
|
26
50
|
}
|
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';
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
// GENERATED FILE - DO NOT EDIT. RUN `yarn generate` or `yarn generate:data`
|
|
3
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
+
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
4
5
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
6
|
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
export const protocolContractNames = [
|
|
9
|
-
'
|
|
10
|
-
'ContractInstanceRegistry',
|
|
10
|
+
'ContractInstanceRegistry',
|
|
11
11
|
'ContractClassRegistry',
|
|
12
|
-
'
|
|
13
|
-
'FeeJuice',
|
|
14
|
-
'PublicChecks'
|
|
12
|
+
'FeeJuice'
|
|
15
13
|
] as const;
|
|
16
14
|
|
|
17
15
|
export type ProtocolContractName = typeof protocolContractNames[number];
|
|
@@ -19,53 +17,82 @@
|
|
|
19
17
|
|
|
20
18
|
|
|
21
19
|
export const ProtocolContractSalt: Record<ProtocolContractName, Fr> = {
|
|
22
|
-
|
|
23
|
-
ContractInstanceRegistry: new Fr(1),
|
|
20
|
+
ContractInstanceRegistry: new Fr(1),
|
|
24
21
|
ContractClassRegistry: new Fr(1),
|
|
25
|
-
|
|
26
|
-
FeeJuice: new Fr(1),
|
|
27
|
-
PublicChecks: new Fr(1)
|
|
22
|
+
FeeJuice: new Fr(1)
|
|
28
23
|
};
|
|
29
24
|
|
|
30
25
|
|
|
31
26
|
|
|
32
27
|
export const ProtocolContractAddress: Record<ProtocolContractName, AztecAddress> = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
MultiCallEntrypoint: AztecAddress.fromBigInt(4n),
|
|
37
|
-
FeeJuice: AztecAddress.fromBigInt(5n),
|
|
38
|
-
PublicChecks: AztecAddress.fromBigInt(6n)
|
|
28
|
+
ContractInstanceRegistry: AztecAddress.fromBigIntUnsafe(2n),
|
|
29
|
+
ContractClassRegistry: AztecAddress.fromBigIntUnsafe(1n),
|
|
30
|
+
FeeJuice: AztecAddress.fromBigIntUnsafe(3n)
|
|
39
31
|
};
|
|
40
32
|
|
|
41
33
|
|
|
42
34
|
|
|
43
35
|
export const ProtocolContractDerivedAddress = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
ContractInstanceRegistry: AztecAddress.fromStringUnsafe('0x2ce1dfe11c45332d557e8302d624b011eb471f0dfa40d2fae64d9fb21590321b'),
|
|
37
|
+
ContractClassRegistry: AztecAddress.fromStringUnsafe('0x1bbb52d2b4ac8c634f4b5026f2228580627c918895c369495f71caae13d996fe'),
|
|
38
|
+
FeeJuice: AztecAddress.fromStringUnsafe('0x258a4892dd83d064f6f250601711a82a7b2aaa20f39dbab216237af3ae0c63f2')
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
export const ProtocolContractClassId: Record<ProtocolContractName, Fr> = {
|
|
44
|
+
ContractInstanceRegistry: Fr.fromString('0x265816820ef83a476c1725199f5b25fefffcf30d564b31ae95fa8eeee579aa30'),
|
|
45
|
+
ContractClassRegistry: Fr.fromString('0x0026d0944a8b8204b840c37cf238b145bdd6b1af9daf59eeb5e689022a708e5e'),
|
|
46
|
+
FeeJuice: Fr.fromString('0x2a58e1588a3ee6ef0d4c951051959789ec8a3680c551f74148f4b4dab7a3df9d')
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const ProtocolContractClassIdPreimage: Record<ProtocolContractName, { artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }> = {
|
|
50
|
+
ContractInstanceRegistry: {
|
|
51
|
+
artifactHash: Fr.fromString('0x19835337f0aee2e9042f3a0ae0d334bdb39ecb22794b40d2670d26b2ca72b98f'),
|
|
52
|
+
privateFunctionsRoot: Fr.fromString('0x05bb912d9d2871492d76c610472544d8219df70aa874768f9667e99861d7971f'),
|
|
53
|
+
publicBytecodeCommitment: Fr.fromString('0x1a226919cd754b17c3c32ad430ecb2ce41117aa6bab5d52f070d3ab4c103c45f'),
|
|
54
|
+
},
|
|
55
|
+
ContractClassRegistry: {
|
|
56
|
+
artifactHash: Fr.fromString('0x0d0ef0a61d9c829c306eee702aa7914299d58e7d3fc9f11d5aebd38c838fa1d0'),
|
|
57
|
+
privateFunctionsRoot: Fr.fromString('0x119c77be6d76c221642b63a337d94bf7b6ed8f872927ef3645c7e6b5002baa34'),
|
|
58
|
+
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
59
|
+
},
|
|
60
|
+
FeeJuice: {
|
|
61
|
+
artifactHash: Fr.fromString('0x2686d931d674aa3a340ad779b9464901ea46b645570f62ddf6beeafcab989e5b'),
|
|
62
|
+
privateFunctionsRoot: Fr.fromString('0x1c4bf54a4a33e3b9eae6f816dfc81e128d76d2646807a5443598c8adbd47f81f'),
|
|
63
|
+
publicBytecodeCommitment: Fr.fromString('0x1d4b1a8f71b8250d4fb65f8e16a4604e9165648279f47d80e024ce2684c4bdfb'),
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const ProtocolContractInitializationHash: Record<ProtocolContractName, Fr> = {
|
|
68
|
+
ContractInstanceRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
69
|
+
ContractClassRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
70
|
+
FeeJuice: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const ProtocolContractPrivateFunctions: Record<ProtocolContractName, { selector: FunctionSelector; vkHash: Fr }[]> = {
|
|
74
|
+
ContractInstanceRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000077cff62f')), vkHash: Fr.fromString('0x19172c0acecd517dd8995c2e36178ca2aa16cbe001c3606d8cd848776ab80d23') }],
|
|
75
|
+
ContractClassRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x000000000000000000000000000000000000000000000000000000006934ed0d')), vkHash: Fr.fromString('0x1241fdbf61631c59b977bb6a520cafe3169604036705b8680dea59f05fb71251') }],
|
|
76
|
+
FeeJuice: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000cbe67243')), vkHash: Fr.fromString('0x0bdf2e5c4467f295f8defb436546a7f2e642e7fe75786d0d54aef497b76527a1') }, { selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000e8d374b6')), vkHash: Fr.fromString('0x2616a94d2d2981737c31ed7d74b9fd32ddc8376bf436dd60fb2507662b47c6dd') }]
|
|
50
77
|
};
|
|
51
78
|
|
|
52
79
|
|
|
53
80
|
|
|
54
81
|
export const ProtocolContractsList = new ProtocolContracts([
|
|
55
|
-
AztecAddress.
|
|
56
|
-
AztecAddress.
|
|
57
|
-
AztecAddress.
|
|
58
|
-
AztecAddress.
|
|
59
|
-
AztecAddress.
|
|
60
|
-
AztecAddress.
|
|
61
|
-
AztecAddress.
|
|
62
|
-
AztecAddress.
|
|
63
|
-
AztecAddress.
|
|
64
|
-
AztecAddress.
|
|
65
|
-
AztecAddress.
|
|
82
|
+
AztecAddress.fromStringUnsafe('0x1bbb52d2b4ac8c634f4b5026f2228580627c918895c369495f71caae13d996fe'),
|
|
83
|
+
AztecAddress.fromStringUnsafe('0x2ce1dfe11c45332d557e8302d624b011eb471f0dfa40d2fae64d9fb21590321b'),
|
|
84
|
+
AztecAddress.fromStringUnsafe('0x258a4892dd83d064f6f250601711a82a7b2aaa20f39dbab216237af3ae0c63f2'),
|
|
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')
|
|
66
93
|
]);
|
|
67
94
|
|
|
68
|
-
export const protocolContractsHash = Fr.fromString('
|
|
95
|
+
export const protocolContractsHash = Fr.fromString('0x08d0026a4983c49638d0910859942c6648d5ea0a3a152c8a376e4983d0a003d9');
|
|
69
96
|
|
|
70
97
|
|
|
71
98
|
|
package/src/provider/bundle.ts
CHANGED
|
@@ -1,27 +1,21 @@
|
|
|
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 {
|
|
24
18
|
getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract> {
|
|
25
|
-
return makeProtocolContract(name, ProtocolContractArtifact[name]);
|
|
19
|
+
return Promise.resolve(makeProtocolContract(name, ProtocolContractArtifact[name]));
|
|
26
20
|
}
|
|
27
21
|
}
|
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
|
@@ -2,25 +2,13 @@ import { readFileSync } from 'fs';
|
|
|
2
2
|
import { dirname, resolve } from 'path';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
|
|
5
|
-
// Generated from end-to-end/src/
|
|
5
|
+
// Generated from end-to-end/src/automine/contracts/deploy/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
6
6
|
export function getSampleContractClassPublishedEventPayload(): Buffer {
|
|
7
7
|
const path = getPathToFixture('ContractClassPublishedEventData.hex');
|
|
8
8
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
// Generated from end-to-end/src/
|
|
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
|
-
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
11
|
+
// Generated from end-to-end/src/automine/contracts/deploy/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
24
12
|
export function getSampleContractInstancePublishedEventPayload(): Buffer {
|
|
25
13
|
const path = getPathToFixture('ContractInstancePublishedEventData.hex');
|
|
26
14
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|