@aztec/protocol-contracts 0.0.0-test.0 → 0.0.1-commit.24de95ac
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 +1979 -1183
- package/artifacts/ContractClassRegistry.json +8205 -0
- package/artifacts/ContractInstanceRegistry.json +3587 -0
- package/artifacts/FeeJuice.json +2499 -1930
- package/artifacts/MultiCallEntrypoint.json +1527 -841
- package/artifacts/Router.json +709 -3531
- package/dest/auth-registry/index.d.ts +2 -1
- package/dest/auth-registry/index.d.ts.map +1 -1
- package/dest/auth-registry/index.js +1 -1
- package/dest/auth-registry/lazy.js +4 -4
- package/dest/{class-registerer/contract_class_registered_event.d.ts → class-registry/contract_class_published_event.d.ts} +5 -7
- 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} +12 -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-registerer → class-registry}/private_function_broadcasted_event.d.ts +3 -5
- 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-registerer/unconstrained_function_broadcasted_event.d.ts → class-registry/utility_function_broadcasted_event.d.ts} +12 -14
- 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} +19 -19
- package/dest/fee-juice/index.js +1 -1
- package/dest/fee-juice/lazy.js +4 -4
- package/dest/index.d.ts +0 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +0 -1
- package/dest/{instance-deployer/contract_instance_deployed_event.d.ts → instance-registry/contract_instance_published_event.d.ts} +5 -5
- 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} +5 -5
- package/dest/{instance-deployer → instance-registry}/contract_instance_updated_event.d.ts +4 -3
- 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-deployer → instance-registry}/index.d.ts +3 -3
- package/dest/instance-registry/index.d.ts.map +1 -0
- package/dest/{instance-deployer → instance-registry}/index.js +5 -5
- package/dest/{instance-deployer → instance-registry}/lazy.d.ts +3 -3
- 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.js +2 -2
- package/dest/multi-call-entrypoint/index.js +1 -1
- package/dest/multi-call-entrypoint/lazy.js +4 -4
- package/dest/protocol_contract_data.d.ts +12 -14
- package/dest/protocol_contract_data.d.ts.map +1 -1
- package/dest/protocol_contract_data.js +29 -19
- package/dest/provider/bundle.js +4 -4
- package/dest/provider/lazy.js +6 -6
- package/dest/router/index.js +1 -1
- package/dest/router/lazy.js +4 -4
- package/dest/scripts/cleanup_artifacts.js +2 -2
- package/dest/scripts/generate_data.js +38 -45
- package/dest/tests/fixtures.d.ts +3 -5
- package/dest/tests/fixtures.d.ts.map +1 -1
- package/dest/tests/fixtures.js +6 -6
- package/package.json +18 -16
- package/src/auth-registry/index.ts +3 -3
- package/src/auth-registry/lazy.ts +4 -4
- 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} +16 -22
- package/src/{class-registerer → class-registry}/index.ts +7 -9
- package/src/class-registry/lazy.ts +33 -0
- package/src/{class-registerer → class-registry}/private_function_broadcasted_event.ts +12 -8
- package/src/{class-registerer/unconstrained_function_broadcasted_event.ts → class-registry/utility_function_broadcasted_event.ts} +25 -21
- package/src/fee-juice/index.ts +1 -1
- package/src/fee-juice/lazy.ts +4 -4
- 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} +6 -6
- package/src/{instance-deployer → instance-registry}/contract_instance_updated_event.ts +14 -14
- package/src/{instance-deployer → instance-registry}/index.ts +6 -6
- package/src/{instance-deployer → instance-registry}/lazy.ts +11 -11
- package/src/make_protocol_contract.ts +2 -2
- package/src/multi-call-entrypoint/index.ts +1 -1
- package/src/multi-call-entrypoint/lazy.ts +4 -4
- package/src/protocol_contract_data.ts +30 -19
- package/src/provider/bundle.ts +4 -4
- package/src/provider/lazy.ts +6 -6
- package/src/router/index.ts +1 -1
- package/src/router/lazy.ts +4 -4
- package/src/tests/fixtures.ts +6 -6
- package/artifacts/ContractClassRegisterer.json +0 -7219
- package/artifacts/ContractInstanceDeployer.json +0 -2984
- 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.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.map +0 -1
- package/dest/class-registerer/unconstrained_function_broadcasted_event.d.ts.map +0 -1
- package/dest/instance-deployer/contract_instance_deployed_event.d.ts.map +0 -1
- 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.map +0 -1
- 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/src/build_protocol_contract_tree.ts +0 -29
- package/src/class-registerer/lazy.ts +0 -33
- package/src/protocol_contract_tree.ts +0 -44
- /package/artifacts/{ContractClassRegisterer.d.json.ts → ContractClassRegistry.d.json.ts} +0 -0
- /package/artifacts/{ContractInstanceDeployer.d.json.ts → ContractInstanceRegistry.d.json.ts} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE } from '@aztec/constants';
|
|
2
|
+
import { FieldReader } from '@aztec/foundation/serialize';
|
|
3
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import { ProtocolContractAddress } from '../protocol_contract_data.js';
|
|
5
|
+
/** Event emitted from the ContractInstanceRegistry. */ export class ContractInstanceUpdatedEvent {
|
|
6
|
+
address;
|
|
7
|
+
prevContractClassId;
|
|
8
|
+
newContractClassId;
|
|
9
|
+
timestampOfChange;
|
|
10
|
+
constructor(address, prevContractClassId, newContractClassId, timestampOfChange){
|
|
11
|
+
this.address = address;
|
|
12
|
+
this.prevContractClassId = prevContractClassId;
|
|
13
|
+
this.newContractClassId = newContractClassId;
|
|
14
|
+
this.timestampOfChange = timestampOfChange;
|
|
15
|
+
}
|
|
16
|
+
static isContractInstanceUpdatedEvent(log) {
|
|
17
|
+
return log.contractAddress.equals(ProtocolContractAddress.ContractInstanceRegistry) && log.fields[0].toBigInt() === CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE;
|
|
18
|
+
}
|
|
19
|
+
static fromLog(log) {
|
|
20
|
+
const reader = new FieldReader(log.fields.slice(1));
|
|
21
|
+
const address = reader.readObject(AztecAddress);
|
|
22
|
+
const prevContractClassId = reader.readField();
|
|
23
|
+
const newContractClassId = reader.readField();
|
|
24
|
+
const timestampOfChange = reader.readField().toBigInt();
|
|
25
|
+
return new ContractInstanceUpdatedEvent(address, prevContractClassId, newContractClassId, timestampOfChange);
|
|
26
|
+
}
|
|
27
|
+
toContractInstanceUpdate() {
|
|
28
|
+
return {
|
|
29
|
+
address: this.address,
|
|
30
|
+
prevContractClassId: this.prevContractClassId,
|
|
31
|
+
newContractClassId: this.newContractClassId,
|
|
32
|
+
timestampOfChange: this.timestampOfChange
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './contract_instance_published_event.js';
|
|
3
3
|
export * from './contract_instance_updated_event.js';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const ContractInstanceRegistryArtifact: import("@aztec/stdlib/abi").ContractArtifact;
|
|
5
5
|
/** Returns the canonical deployment of the contract. */
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function getCanonicalInstanceRegistry(): Promise<ProtocolContract>;
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/instance-registry/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AAErD,eAAO,MAAM,gCAAgC,8CAE5C,CAAC;AAIF,wDAAwD;AACxD,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAK9E"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
-
import
|
|
2
|
+
import ContractInstanceRegistryJson from '../../artifacts/ContractInstanceRegistry.json' with {
|
|
3
3
|
type: 'json'
|
|
4
4
|
};
|
|
5
5
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
6
|
-
export * from './
|
|
6
|
+
export * from './contract_instance_published_event.js';
|
|
7
7
|
export * from './contract_instance_updated_event.js';
|
|
8
|
-
export const
|
|
8
|
+
export const ContractInstanceRegistryArtifact = loadContractArtifact(ContractInstanceRegistryJson);
|
|
9
9
|
let protocolContract;
|
|
10
|
-
/** Returns the canonical deployment of the contract. */ export async function
|
|
10
|
+
/** Returns the canonical deployment of the contract. */ export async function getCanonicalInstanceRegistry() {
|
|
11
11
|
if (!protocolContract) {
|
|
12
|
-
protocolContract = await makeProtocolContract('
|
|
12
|
+
protocolContract = await makeProtocolContract('ContractInstanceRegistry', ContractInstanceRegistryArtifact);
|
|
13
13
|
}
|
|
14
14
|
return protocolContract;
|
|
15
15
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
import type { ProtocolContract } from '../protocol_contract.js';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './contract_instance_published_event.js';
|
|
4
4
|
export * from './contract_instance_updated_event.js';
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function getContractInstanceRegistryArtifact(): Promise<ContractArtifact>;
|
|
6
6
|
/** Returns the canonical deployment of the auth registry. */
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function getCanonicalInstanceRegistry(): Promise<ProtocolContract>;
|
|
8
8
|
//# sourceMappingURL=lazy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/instance-
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/instance-registry/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAwB,MAAM,mBAAmB,CAAC;AAGhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AAKrD,wBAAsB,mCAAmC,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAWrF;AAED,6DAA6D;AAC7D,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAM9E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
+
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
3
|
+
export * from './contract_instance_published_event.js';
|
|
4
|
+
export * from './contract_instance_updated_event.js';
|
|
5
|
+
let protocolContract;
|
|
6
|
+
let protocolContractArtifact;
|
|
7
|
+
export async function getContractInstanceRegistryArtifact() {
|
|
8
|
+
if (!protocolContractArtifact) {
|
|
9
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
10
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
11
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
12
|
+
// "text/javascript"
|
|
13
|
+
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
14
|
+
const { default: contractInstanceRegistryJson } = await import('../../artifacts/ContractInstanceRegistry.json');
|
|
15
|
+
protocolContractArtifact = loadContractArtifact(contractInstanceRegistryJson);
|
|
16
|
+
}
|
|
17
|
+
return protocolContractArtifact;
|
|
18
|
+
}
|
|
19
|
+
/** Returns the canonical deployment of the auth registry. */ export async function getCanonicalInstanceRegistry() {
|
|
20
|
+
if (!protocolContract) {
|
|
21
|
+
const contractInstanceRegistryArtifact = await getContractInstanceRegistryArtifact();
|
|
22
|
+
protocolContract = await makeProtocolContract('ContractInstanceRegistry', contractInstanceRegistryArtifact);
|
|
23
|
+
}
|
|
24
|
+
return protocolContract;
|
|
25
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getContractClassFromArtifact,
|
|
1
|
+
import { getContractClassFromArtifact, getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
2
2
|
import { ProtocolContractAddress, ProtocolContractSalt } from './protocol_contract_data.js';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the canonical deployment given its name and artifact.
|
|
@@ -8,7 +8,7 @@ import { ProtocolContractAddress, ProtocolContractSalt } from './protocol_contra
|
|
|
8
8
|
const salt = ProtocolContractSalt[name];
|
|
9
9
|
// TODO(@spalladino): This computes the contract class from the artifact twice.
|
|
10
10
|
const contractClass = await getContractClassFromArtifact(artifact);
|
|
11
|
-
const instance = await
|
|
11
|
+
const instance = await getContractInstanceFromInstantiationParams(artifact, {
|
|
12
12
|
salt
|
|
13
13
|
});
|
|
14
14
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
-
import MultiCallEntrypointJson from '../../artifacts/MultiCallEntrypoint.json'
|
|
2
|
+
import MultiCallEntrypointJson from '../../artifacts/MultiCallEntrypoint.json' with {
|
|
3
3
|
type: 'json'
|
|
4
4
|
};
|
|
5
5
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
@@ -4,10 +4,10 @@ let protocolContract;
|
|
|
4
4
|
let protocolContractArtifact;
|
|
5
5
|
export async function getMultiCallEntrypointArtifact() {
|
|
6
6
|
if (!protocolContractArtifact) {
|
|
7
|
-
// Cannot assert this import as it's incompatible with
|
|
8
|
-
// https://
|
|
9
|
-
//
|
|
10
|
-
//
|
|
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
11
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
12
12
|
const { default: multiCallEntrypointJson } = await import('../../artifacts/MultiCallEntrypoint.json');
|
|
13
13
|
protocolContractArtifact = loadContractArtifact(multiCallEntrypointJson);
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
-
|
|
3
|
+
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
4
|
+
export declare const protocolContractNames: readonly ["AuthRegistry", "ContractInstanceRegistry", "ContractClassRegistry", "MultiCallEntrypoint", "FeeJuice", "Router"];
|
|
4
5
|
export type ProtocolContractName = typeof protocolContractNames[number];
|
|
5
6
|
export declare const ProtocolContractSalt: Record<ProtocolContractName, Fr>;
|
|
6
7
|
export declare const ProtocolContractAddress: Record<ProtocolContractName, AztecAddress>;
|
|
7
|
-
export declare const
|
|
8
|
-
AuthRegistry:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
MultiCallEntrypoint:
|
|
12
|
-
FeeJuice:
|
|
13
|
-
Router:
|
|
8
|
+
export declare const ProtocolContractDerivedAddress: {
|
|
9
|
+
AuthRegistry: AztecAddress;
|
|
10
|
+
ContractInstanceRegistry: AztecAddress;
|
|
11
|
+
ContractClassRegistry: AztecAddress;
|
|
12
|
+
MultiCallEntrypoint: AztecAddress;
|
|
13
|
+
FeeJuice: AztecAddress;
|
|
14
|
+
Router: AztecAddress;
|
|
14
15
|
};
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_TAG: Fr;
|
|
19
|
-
export declare const DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_TAG: Fr;
|
|
20
|
-
export declare const DEPLOYER_CONTRACT_INSTANCE_UPDATED_TAG: Fr;
|
|
16
|
+
export declare const ProtocolContractsList: ProtocolContracts;
|
|
17
|
+
export declare const protocolContractsHash: Fr;
|
|
18
|
+
export declare const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG: Fr;
|
|
21
19
|
//# sourceMappingURL=protocol_contract_data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol_contract_data.d.ts","sourceRoot":"","sources":["../src/protocol_contract_data.ts"],"names":[],"mappings":"AAEI,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol_contract_data.d.ts","sourceRoot":"","sources":["../src/protocol_contract_data.ts"],"names":[],"mappings":"AAEI,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,eAAO,MAAM,qBAAqB,6HAOxB,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAIxE,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,oBAAoB,EAAE,EAAE,CAOjE,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAO9E,CAAC;AAIF,eAAO,MAAM,8BAA8B;;;;;;;CAO1C,CAAC;AAIF,eAAO,MAAM,qBAAqB,mBAYhC,CAAC;AAEH,eAAO,MAAM,qBAAqB,IAAsF,CAAC;AAI3H,eAAO,MAAM,qCAAqC,IAAyF,CAAC"}
|
|
@@ -1,41 +1,51 @@
|
|
|
1
1
|
// GENERATED FILE - DO NOT EDIT. RUN `yarn generate` or `yarn generate:data`
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
4
5
|
export const protocolContractNames = [
|
|
5
6
|
'AuthRegistry',
|
|
6
|
-
'
|
|
7
|
-
'
|
|
7
|
+
'ContractInstanceRegistry',
|
|
8
|
+
'ContractClassRegistry',
|
|
8
9
|
'MultiCallEntrypoint',
|
|
9
10
|
'FeeJuice',
|
|
10
11
|
'Router'
|
|
11
12
|
];
|
|
12
13
|
export const ProtocolContractSalt = {
|
|
13
14
|
AuthRegistry: new Fr(1),
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
ContractInstanceRegistry: new Fr(1),
|
|
16
|
+
ContractClassRegistry: new Fr(1),
|
|
16
17
|
MultiCallEntrypoint: new Fr(1),
|
|
17
18
|
FeeJuice: new Fr(1),
|
|
18
19
|
Router: new Fr(1)
|
|
19
20
|
};
|
|
20
21
|
export const ProtocolContractAddress = {
|
|
21
22
|
AuthRegistry: AztecAddress.fromBigInt(1n),
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
ContractInstanceRegistry: AztecAddress.fromBigInt(2n),
|
|
24
|
+
ContractClassRegistry: AztecAddress.fromBigInt(3n),
|
|
24
25
|
MultiCallEntrypoint: AztecAddress.fromBigInt(4n),
|
|
25
26
|
FeeJuice: AztecAddress.fromBigInt(5n),
|
|
26
27
|
Router: AztecAddress.fromBigInt(6n)
|
|
27
28
|
};
|
|
28
|
-
export const
|
|
29
|
-
AuthRegistry:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
MultiCallEntrypoint:
|
|
33
|
-
FeeJuice:
|
|
34
|
-
Router:
|
|
29
|
+
export const ProtocolContractDerivedAddress = {
|
|
30
|
+
AuthRegistry: AztecAddress.fromString('0x2e35b6e1a89ac2f901f3513f505249b9a485513ac7dd57f29f1183c0862473f2'),
|
|
31
|
+
ContractInstanceRegistry: AztecAddress.fromString('0x136eade704b136bae7c5282cf8f4e1ccc51835db840123034cfefbad76215c91'),
|
|
32
|
+
ContractClassRegistry: AztecAddress.fromString('0x2b9543f587c4d7976627ed8dfe0345f9e2efa846f618dea97372c1be7240994b'),
|
|
33
|
+
MultiCallEntrypoint: AztecAddress.fromString('0x191a929597d30fafe8d5708533b89bd4022c8d3194c8fcf37d04ac51a2f804eb'),
|
|
34
|
+
FeeJuice: AztecAddress.fromString('0x2f3ffae9d3b40e8f162fc2dabbd8dba5deaf112191dfa7be263a55073e16d082'),
|
|
35
|
+
Router: AztecAddress.fromString('0x00943dfa60dc08d7fb79f30220fdab942c0ba3364e45b69777015613983bab58')
|
|
35
36
|
};
|
|
36
|
-
export const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
export const ProtocolContractsList = new ProtocolContracts([
|
|
38
|
+
AztecAddress.fromString('0x2e35b6e1a89ac2f901f3513f505249b9a485513ac7dd57f29f1183c0862473f2'),
|
|
39
|
+
AztecAddress.fromString('0x136eade704b136bae7c5282cf8f4e1ccc51835db840123034cfefbad76215c91'),
|
|
40
|
+
AztecAddress.fromString('0x2b9543f587c4d7976627ed8dfe0345f9e2efa846f618dea97372c1be7240994b'),
|
|
41
|
+
AztecAddress.fromString('0x191a929597d30fafe8d5708533b89bd4022c8d3194c8fcf37d04ac51a2f804eb'),
|
|
42
|
+
AztecAddress.fromString('0x2f3ffae9d3b40e8f162fc2dabbd8dba5deaf112191dfa7be263a55073e16d082'),
|
|
43
|
+
AztecAddress.fromString('0x00943dfa60dc08d7fb79f30220fdab942c0ba3364e45b69777015613983bab58'),
|
|
44
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
45
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
46
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
47
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
48
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
49
|
+
]);
|
|
50
|
+
export const protocolContractsHash = Fr.fromString('0x1114ed602f51159e3e07a19f1b0ad7acbd7dee60fbf342ea0e46d9013f744679');
|
|
51
|
+
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('0x28da3fc471387d4e20b646b77abc8cdfc02a339a7507285a73d84f9b97b13486');
|
package/dest/provider/bundle.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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
7
|
import { RouterArtifact } from '../router/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
|
Router: RouterArtifact
|
package/dest/provider/lazy.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
6
|
import { getCanonicalRouter } from '../router/lazy.js';
|
|
7
7
|
export class LazyProtocolContractsProvider {
|
|
@@ -9,10 +9,10 @@ export class LazyProtocolContractsProvider {
|
|
|
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':
|
package/dest/router/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
-
import RouterJson from '../../artifacts/Router.json'
|
|
2
|
+
import RouterJson from '../../artifacts/Router.json' with {
|
|
3
3
|
type: 'json'
|
|
4
4
|
};
|
|
5
5
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
package/dest/router/lazy.js
CHANGED
|
@@ -4,10 +4,10 @@ let protocolContract;
|
|
|
4
4
|
let protocolContractArtifact;
|
|
5
5
|
export async function getRouterArtifact() {
|
|
6
6
|
if (!protocolContractArtifact) {
|
|
7
|
-
// Cannot assert this import as it's incompatible with
|
|
8
|
-
// https://
|
|
9
|
-
//
|
|
10
|
-
//
|
|
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
11
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
12
12
|
const { default: routerJson } = await import('../../artifacts/Router.json');
|
|
13
13
|
protocolContractArtifact = loadContractArtifact(routerJson);
|
|
@@ -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,14 @@
|
|
|
1
|
-
import { CANONICAL_AUTH_REGISTRY_ADDRESS,
|
|
1
|
+
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, ROUTER_ADDRESS } from '@aztec/constants';
|
|
2
|
+
import { makeTuple } from '@aztec/foundation/array';
|
|
2
3
|
import { poseidon2Hash } from '@aztec/foundation/crypto';
|
|
3
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
5
|
import { createConsoleLogger } from '@aztec/foundation/log';
|
|
5
6
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
6
7
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import {
|
|
8
|
+
import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
9
|
+
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
8
10
|
import { promises as fs } from 'fs';
|
|
9
11
|
import path from 'path';
|
|
10
|
-
import { buildProtocolContractTree } from '../build_protocol_contract_tree.js';
|
|
11
12
|
const log = createConsoleLogger('autogenerate');
|
|
12
13
|
const noirContractsRoot = '../../noir-projects/noir-contracts';
|
|
13
14
|
const srcPath = path.join(noirContractsRoot, './target');
|
|
@@ -16,8 +17,8 @@ const outputFilePath = './src/protocol_contract_data.ts';
|
|
|
16
17
|
const salt = new Fr(1);
|
|
17
18
|
const contractAddressMapping = {
|
|
18
19
|
AuthRegistry: CANONICAL_AUTH_REGISTRY_ADDRESS,
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
ContractInstanceRegistry: CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS,
|
|
21
|
+
ContractClassRegistry: CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS,
|
|
21
22
|
MultiCallEntrypoint: MULTI_CALL_ENTRYPOINT_ADDRESS,
|
|
22
23
|
FeeJuice: FEE_JUICE_ADDRESS,
|
|
23
24
|
Router: ROUTER_ADDRESS
|
|
@@ -49,20 +50,12 @@ async function copyArtifact(srcName, destName) {
|
|
|
49
50
|
await fs.copyFile(src, dest);
|
|
50
51
|
return artifact;
|
|
51
52
|
}
|
|
52
|
-
async function
|
|
53
|
-
const instance = await
|
|
53
|
+
async function computeAddress(artifact) {
|
|
54
|
+
const instance = await getContractInstanceFromInstantiationParams(loadContractArtifact(artifact), {
|
|
54
55
|
salt
|
|
55
56
|
});
|
|
56
57
|
return instance.address;
|
|
57
58
|
}
|
|
58
|
-
async function computeRoot(names, leaves) {
|
|
59
|
-
const data = names.map((name, i)=>({
|
|
60
|
-
address: new AztecAddress(new Fr(contractAddressMapping[name])),
|
|
61
|
-
leaf: leaves[i]
|
|
62
|
-
}));
|
|
63
|
-
const tree = await buildProtocolContractTree(data);
|
|
64
|
-
return Fr.fromBuffer(tree.root);
|
|
65
|
-
}
|
|
66
59
|
async function generateDeclarationFile(destName) {
|
|
67
60
|
const content = `
|
|
68
61
|
import type { NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
@@ -95,46 +88,47 @@ function generateContractAddresses(names) {
|
|
|
95
88
|
};
|
|
96
89
|
`;
|
|
97
90
|
}
|
|
98
|
-
function
|
|
91
|
+
function generateDerivedAddresses(names, derivedAddresses) {
|
|
99
92
|
return `
|
|
100
|
-
export const
|
|
101
|
-
${
|
|
93
|
+
export const ProtocolContractDerivedAddress = {
|
|
94
|
+
${derivedAddresses.map((address, i)=>`${names[i]}: AztecAddress.fromString('${address.toString()}')`).join(',\n')}
|
|
102
95
|
};
|
|
103
96
|
`;
|
|
104
97
|
}
|
|
105
|
-
async function
|
|
106
|
-
const
|
|
98
|
+
async function generateProtocolContractsList(names, derivedAddresses) {
|
|
99
|
+
const list = makeTuple(MAX_PROTOCOL_CONTRACTS, ()=>AztecAddress.zero());
|
|
100
|
+
for(let i = 0; i < names.length; i++){
|
|
101
|
+
const name = names[i];
|
|
102
|
+
const address = contractAddressMapping[name];
|
|
103
|
+
const derivedAddressIndex = address - 1;
|
|
104
|
+
if (!list[derivedAddressIndex].equals(AztecAddress.zero())) {
|
|
105
|
+
throw new Error(`Duplicate protocol contract address: ${address.toString()}`);
|
|
106
|
+
}
|
|
107
|
+
list[derivedAddressIndex] = derivedAddresses[i];
|
|
108
|
+
}
|
|
107
109
|
return `
|
|
108
|
-
export const
|
|
110
|
+
export const ProtocolContractsList = new ProtocolContracts([
|
|
111
|
+
${list.map((address)=>`AztecAddress.fromString('${address.toString()}')`).join(',\n')}
|
|
112
|
+
]);
|
|
113
|
+
|
|
114
|
+
export const protocolContractsHash = Fr.fromString('${(await new ProtocolContracts(list).hash()).toString()}');
|
|
109
115
|
`;
|
|
110
116
|
}
|
|
117
|
+
// Generate the siloed log tags for events emitted via private logs.
|
|
111
118
|
async function generateLogTags() {
|
|
112
|
-
// See silo_contract_class_log for all registerer tags
|
|
113
119
|
return `
|
|
114
|
-
export const
|
|
115
|
-
|
|
116
|
-
|
|
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
|
|
120
|
+
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('${await poseidon2Hash([
|
|
121
|
+
CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS,
|
|
122
|
+
CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE
|
|
129
123
|
])}');
|
|
130
|
-
export const DEPLOYER_CONTRACT_INSTANCE_UPDATED_TAG = new Fr(${DEPLOYER_CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE}n);
|
|
131
124
|
`;
|
|
132
125
|
}
|
|
133
|
-
async function generateOutputFile(names,
|
|
126
|
+
async function generateOutputFile(names, derivedAddresses) {
|
|
134
127
|
const content = `
|
|
135
128
|
// GENERATED FILE - DO NOT EDIT. RUN \`yarn generate\` or \`yarn generate:data\`
|
|
136
129
|
import { Fr } from '@aztec/foundation/fields';
|
|
137
130
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
131
|
+
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
138
132
|
|
|
139
133
|
${generateNames(names)}
|
|
140
134
|
|
|
@@ -142,9 +136,9 @@ async function generateOutputFile(names, leaves) {
|
|
|
142
136
|
|
|
143
137
|
${generateContractAddresses(names)}
|
|
144
138
|
|
|
145
|
-
${
|
|
139
|
+
${generateDerivedAddresses(names, derivedAddresses)}
|
|
146
140
|
|
|
147
|
-
${await
|
|
141
|
+
${await generateProtocolContractsList(names, derivedAddresses)}
|
|
148
142
|
|
|
149
143
|
${await generateLogTags()}
|
|
150
144
|
`;
|
|
@@ -153,17 +147,16 @@ async function generateOutputFile(names, leaves) {
|
|
|
153
147
|
async function main() {
|
|
154
148
|
await clearDestDir();
|
|
155
149
|
const srcNames = JSON.parse(await fs.readFile(path.join(noirContractsRoot, 'protocol_contracts.json'), 'utf8'));
|
|
156
|
-
const
|
|
150
|
+
const derivedAddresses = [];
|
|
157
151
|
const destNames = srcNames.map((n)=>n.split('-')[1]);
|
|
158
152
|
for(let i = 0; i < srcNames.length; i++){
|
|
159
153
|
const srcName = srcNames[i];
|
|
160
154
|
const destName = destNames[i];
|
|
161
155
|
const artifact = await copyArtifact(srcName, destName);
|
|
162
156
|
await generateDeclarationFile(destName);
|
|
163
|
-
|
|
164
|
-
leaves.push(contractLeaf.toField());
|
|
157
|
+
derivedAddresses.push(await computeAddress(artifact));
|
|
165
158
|
}
|
|
166
|
-
await generateOutputFile(destNames,
|
|
159
|
+
await generateOutputFile(destNames, derivedAddresses);
|
|
167
160
|
}
|
|
168
161
|
try {
|
|
169
162
|
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
6
|
//# sourceMappingURL=fixtures.d.ts.map
|
|
@@ -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) {
|