@aztec/protocol-contracts 0.0.1-commit.993d240 → 0.0.1-commit.9a89641
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 +476 -224
- package/artifacts/ContractInstanceRegistry.json +677 -269
- package/artifacts/FeeJuice.json +741 -334
- package/dest/class-registry/contract_class_published_event.d.ts +1 -1
- package/dest/class-registry/contract_class_published_event.d.ts.map +1 -1
- package/dest/class-registry/contract_class_published_event.js +8 -2
- package/dest/class-registry/lazy.js +1 -1
- package/dest/fee-juice/lazy.js +1 -1
- package/dest/instance-registry/lazy.js +1 -1
- package/dest/protocol_contract.d.ts +4 -1
- package/dest/protocol_contract.d.ts.map +1 -1
- package/dest/protocol_contract.js +5 -1
- package/dest/protocol_contract_data.js +32 -32
- package/dest/scripts/generate_data.js +8 -7
- package/dest/tests/fixtures.js +2 -2
- package/package.json +5 -4
- package/src/class-registry/contract_class_published_event.ts +7 -2
- package/src/class-registry/lazy.ts +1 -1
- package/src/fee-juice/lazy.ts +1 -1
- package/src/instance-registry/lazy.ts +1 -1
- package/src/protocol_contract.ts +9 -1
- package/src/protocol_contract_data.ts +31 -31
- package/src/tests/fixtures.ts +2 -2
|
@@ -17,4 +17,4 @@ export declare class ContractClassPublishedEvent {
|
|
|
17
17
|
toContractClassPublicWithBytecodeCommitment(): Promise<ContractClassPublicWithCommitment>;
|
|
18
18
|
static extractContractClassEvents(logs: ContractClassLog[]): ContractClassPublishedEvent[];
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3RfY2xhc3NfcHVibGlzaGVkX2V2ZW50LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xhc3MtcmVnaXN0cnkvY29udHJhY3RfY2xhc3NfcHVibGlzaGVkX2V2ZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUdwRCxPQUFPLEVBQ0wsS0FBSyxtQkFBbUIsRUFDeEIsS0FBSyxpQ0FBaUMsRUFFdkMsTUFBTSx3QkFBd0IsQ0FBQztBQUNoQyxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBSTNELG9EQUFvRDtBQUNwRCxxQkFBYSwyQkFBMkI7YUFFcEIsZUFBZSxFQUFFLEVBQUU7YUFDbkIsT0FBTyxFQUFFLE1BQU07YUFDZixZQUFZLEVBQUUsRUFBRTthQUNoQixvQkFBb0IsRUFBRSxFQUFFO2FBQ3hCLG9CQUFvQixFQUFFLE1BQU07SUFMOUMsWUFDa0IsZUFBZSxFQUFFLEVBQUUsRUFDbkIsT0FBTyxFQUFFLE1BQU0sRUFDZixZQUFZLEVBQUUsRUFBRSxFQUNoQixvQkFBb0IsRUFBRSxFQUFFLEVBQ3hCLG9CQUFvQixFQUFFLE1BQU0sRUFDMUM7SUFFSixNQUFNLENBQUMsNkJBQTZCLENBQUMsR0FBRyxFQUFFLGdCQUFnQixXQUt6RDtJQUVELE1BQU0sQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLGdCQUFnQiwrQkFzQm5DO0lBRUQsdUdBQXVHO0lBQ3ZHLHFCQUFxQixJQUFJLG1CQUFtQixDQVEzQztJQUVELHVGQUF1RjtJQUNqRiwyQ0FBMkMsSUFBSSxPQUFPLENBQUMsaUNBQWlDLENBQUMsQ0FHOUY7SUFFRCxPQUFjLDBCQUEwQixDQUFDLElBQUksRUFBRSxnQkFBZ0IsRUFBRSxHQUFHLDJCQUEyQixFQUFFLENBSWhHO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract_class_published_event.d.ts","sourceRoot":"","sources":["../../src/class-registry/contract_class_published_event.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iCAAiC,EAEvC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,oDAAoD;AACpD,qBAAa,2BAA2B;aAEpB,eAAe,EAAE,EAAE;aACnB,OAAO,EAAE,MAAM;aACf,YAAY,EAAE,EAAE;aAChB,oBAAoB,EAAE,EAAE;aACxB,oBAAoB,EAAE,MAAM;IAL9C,YACkB,eAAe,EAAE,EAAE,EACnB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,EAAE,EAChB,oBAAoB,EAAE,EAAE,EACxB,oBAAoB,EAAE,MAAM,EAC1C;IAEJ,MAAM,CAAC,6BAA6B,CAAC,GAAG,EAAE,gBAAgB,WAKzD;IAED,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,gBAAgB,+
|
|
1
|
+
{"version":3,"file":"contract_class_published_event.d.ts","sourceRoot":"","sources":["../../src/class-registry/contract_class_published_event.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iCAAiC,EAEvC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,oDAAoD;AACpD,qBAAa,2BAA2B;aAEpB,eAAe,EAAE,EAAE;aACnB,OAAO,EAAE,MAAM;aACf,YAAY,EAAE,EAAE;aAChB,oBAAoB,EAAE,EAAE;aACxB,oBAAoB,EAAE,MAAM;IAL9C,YACkB,eAAe,EAAE,EAAE,EACnB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,EAAE,EAChB,oBAAoB,EAAE,EAAE,EACxB,oBAAoB,EAAE,MAAM,EAC1C;IAEJ,MAAM,CAAC,6BAA6B,CAAC,GAAG,EAAE,gBAAgB,WAKzD;IAED,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,gBAAgB,+BAsBnC;IAED,uGAAuG;IACvG,qBAAqB,IAAI,mBAAmB,CAQ3C;IAED,uFAAuF;IACjF,2CAA2C,IAAI,OAAO,CAAC,iCAAiC,CAAC,CAG9F;IAED,OAAc,0BAA0B,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,2BAA2B,EAAE,CAIhG;CACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CONTRACT_CLASS_PUBLISHED_MAGIC_VALUE } from '@aztec/constants';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
3
|
import { FieldReader } from '@aztec/foundation/serialize';
|
|
3
4
|
import { bufferFromFields } from '@aztec/stdlib/abi';
|
|
4
5
|
import { computePublicBytecodeCommitment } from '@aztec/stdlib/contract';
|
|
@@ -20,14 +21,19 @@ import { ProtocolContractAddress } from '../protocol_contract_data.js';
|
|
|
20
21
|
return log.contractAddress.equals(ProtocolContractAddress.ContractClassRegistry) && log.fields.fields[0].toBigInt() === CONTRACT_CLASS_PUBLISHED_MAGIC_VALUE;
|
|
21
22
|
}
|
|
22
23
|
static fromLog(log) {
|
|
23
|
-
// See how the log is serialized in `noir-projects/noir-contracts/contracts/protocol/contract_class_registry_contract/src/events/class_published.nr`.
|
|
24
|
+
// See how the log is serialized in `noir-projects/fnd/noir-contracts/contracts/protocol/contract_class_registry_contract/src/events/class_published.nr`.
|
|
24
25
|
const fieldsWithoutTag = log.fields.fields.slice(1);
|
|
25
26
|
const reader = new FieldReader(fieldsWithoutTag);
|
|
26
27
|
const contractClassId = reader.readField();
|
|
27
28
|
const version = reader.readField().toNumber();
|
|
28
29
|
const artifactHash = reader.readField();
|
|
29
30
|
const privateFunctionsRoot = reader.readField();
|
|
30
|
-
const
|
|
31
|
+
const bytecodeFields = reader.readFieldArray(fieldsWithoutTag.length - reader.cursor);
|
|
32
|
+
// The fixed-size class log can hold at most this many packed-bytecode bytes (every payload field
|
|
33
|
+
// carries 31 bytes). Bound the declared length to it so a malformed log can't declare a multi-MiB
|
|
34
|
+
// length backed by a tiny payload and force a large allocation during early (pre-proof) validation.
|
|
35
|
+
const maxByteLength = (bytecodeFields.length - 1) * (Fr.SIZE_IN_BYTES - 1);
|
|
36
|
+
const packedPublicBytecode = bufferFromFields(bytecodeFields, maxByteLength);
|
|
31
37
|
return new ContractClassPublishedEvent(contractClassId, version, artifactHash, privateFunctionsRoot, packedPublicBytecode);
|
|
32
38
|
}
|
|
33
39
|
/** Converts the event to a contract class, without computing or validating the bytecode commitment. */ toContractClassPublic() {
|
|
@@ -7,7 +7,7 @@ export async function getContractClassRegistryArtifact() {
|
|
|
7
7
|
if (!protocolContractArtifact) {
|
|
8
8
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
9
9
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
10
|
-
// Even if now supported by
|
|
10
|
+
// Even if now supported by all major browsers, the MIME type is replaced with
|
|
11
11
|
// "text/javascript"
|
|
12
12
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
13
13
|
const { default: contractClassRegistryJson } = await import('../../artifacts/ContractClassRegistry.json');
|
package/dest/fee-juice/lazy.js
CHANGED
|
@@ -6,7 +6,7 @@ export async function getFeeJuiceArtifact() {
|
|
|
6
6
|
if (!protocolContractArtifact) {
|
|
7
7
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
8
8
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
9
|
-
// Even if now supported by
|
|
9
|
+
// Even if now supported by all major browsers, the MIME type is replaced with
|
|
10
10
|
// "text/javascript"
|
|
11
11
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
12
12
|
const { default: feeJuiceJson } = await import('../../artifacts/FeeJuice.json');
|
|
@@ -8,7 +8,7 @@ export async function getContractInstanceRegistryArtifact() {
|
|
|
8
8
|
if (!protocolContractArtifact) {
|
|
9
9
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
10
10
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
11
|
-
// Even if now supported by
|
|
11
|
+
// Even if now supported by all major browsers, the MIME type is replaced with
|
|
12
12
|
// "text/javascript"
|
|
13
13
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
14
14
|
const { default: contractInstanceRegistryJson } = await import('../../artifacts/ContractInstanceRegistry.json');
|
|
@@ -1,3 +1,4 @@
|
|
|
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';
|
|
@@ -13,5 +14,7 @@ export interface ProtocolContract {
|
|
|
13
14
|
address: AztecAddress;
|
|
14
15
|
}
|
|
15
16
|
export declare function isProtocolContract(address: AztecAddress): boolean;
|
|
17
|
+
/** Returns whether the given contract class id belongs to a bundled protocol contract. */
|
|
18
|
+
export declare function isProtocolContractClass(classId: Fr): boolean;
|
|
16
19
|
export { type ProtocolContractsProvider } from './provider/protocol_contracts_provider.js';
|
|
17
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvdG9jb2xfY29udHJhY3QuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9wcm90b2NvbF9jb250cmFjdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN6RCxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQzFELE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLHVCQUF1QixFQUFFLG1CQUFtQixFQUFFLDJCQUEyQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFJeEgsdURBQXVEO0FBQ3ZELE1BQU0sV0FBVyxnQkFBZ0I7SUFDL0IsbUNBQW1DO0lBQ25DLFFBQVEsRUFBRSwyQkFBMkIsQ0FBQztJQUN0Qyx1Q0FBdUM7SUFDdkMsYUFBYSxFQUFFLG1CQUFtQixHQUFHLHVCQUF1QixDQUFDO0lBQzdELGtDQUFrQztJQUNsQyxRQUFRLEVBQUUsZ0JBQWdCLENBQUM7SUFDM0Isc0RBQXNEO0lBQ3RELE9BQU8sRUFBRSxZQUFZLENBQUM7Q0FDdkI7QUFFRCx3QkFBZ0Isa0JBQWtCLENBQUMsT0FBTyxFQUFFLFlBQVksV0FFdkQ7QUFJRCwwRkFBMEY7QUFDMUYsd0JBQWdCLHVCQUF1QixDQUFDLE9BQU8sRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUU1RDtBQUVELE9BQU8sRUFBRSxLQUFLLHlCQUF5QixFQUFFLE1BQU0sMkNBQTJDLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol_contract.d.ts","sourceRoot":"","sources":["../src/protocol_contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAIxH,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,QAAQ,EAAE,2BAA2B,CAAC;IACtC,uCAAuC;IACvC,aAAa,EAAE,mBAAmB,GAAG,uBAAuB,CAAC;IAC7D,kCAAkC;IAClC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,sDAAsD;IACtD,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,WAEvD;AAED,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,2CAA2C,CAAC"}
|
|
1
|
+
{"version":3,"file":"protocol_contract.d.ts","sourceRoot":"","sources":["../src/protocol_contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAIxH,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,QAAQ,EAAE,2BAA2B,CAAC;IACtC,uCAAuC;IACvC,aAAa,EAAE,mBAAmB,GAAG,uBAAuB,CAAC;IAC7D,kCAAkC;IAClC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,sDAAsD;IACtD,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,WAEvD;AAID,0FAA0F;AAC1F,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,EAAE,GAAG,OAAO,CAE5D;AAED,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { ProtocolContractAddress } from './protocol_contract_data.js';
|
|
1
|
+
import { ProtocolContractAddress, ProtocolContractClassId } from './protocol_contract_data.js';
|
|
2
2
|
export function isProtocolContract(address) {
|
|
3
3
|
return Object.values(ProtocolContractAddress).some((a)=>a.equals(address));
|
|
4
4
|
}
|
|
5
|
+
const protocolContractClassIds = new Set(Object.values(ProtocolContractClassId).map((id)=>id.toString()));
|
|
6
|
+
/** Returns whether the given contract class id belongs to a bundled protocol contract. */ export function isProtocolContractClass(classId) {
|
|
7
|
+
return protocolContractClassIds.has(classId.toString());
|
|
8
|
+
}
|
|
@@ -14,34 +14,34 @@ export const ProtocolContractSalt = {
|
|
|
14
14
|
FeeJuice: new Fr(1)
|
|
15
15
|
};
|
|
16
16
|
export const ProtocolContractAddress = {
|
|
17
|
-
ContractInstanceRegistry: AztecAddress.
|
|
18
|
-
ContractClassRegistry: AztecAddress.
|
|
19
|
-
FeeJuice: AztecAddress.
|
|
17
|
+
ContractInstanceRegistry: AztecAddress.fromBigIntUnsafe(2n),
|
|
18
|
+
ContractClassRegistry: AztecAddress.fromBigIntUnsafe(1n),
|
|
19
|
+
FeeJuice: AztecAddress.fromBigIntUnsafe(3n)
|
|
20
20
|
};
|
|
21
21
|
export const ProtocolContractDerivedAddress = {
|
|
22
|
-
ContractInstanceRegistry: AztecAddress.
|
|
23
|
-
ContractClassRegistry: AztecAddress.
|
|
24
|
-
FeeJuice: AztecAddress.
|
|
22
|
+
ContractInstanceRegistry: AztecAddress.fromStringUnsafe('0x2ce1dfe11c45332d557e8302d624b011eb471f0dfa40d2fae64d9fb21590321b'),
|
|
23
|
+
ContractClassRegistry: AztecAddress.fromStringUnsafe('0x1bbb52d2b4ac8c634f4b5026f2228580627c918895c369495f71caae13d996fe'),
|
|
24
|
+
FeeJuice: AztecAddress.fromStringUnsafe('0x258a4892dd83d064f6f250601711a82a7b2aaa20f39dbab216237af3ae0c63f2')
|
|
25
25
|
};
|
|
26
26
|
export const ProtocolContractClassId = {
|
|
27
|
-
ContractInstanceRegistry: Fr.fromString('
|
|
28
|
-
ContractClassRegistry: Fr.fromString('
|
|
29
|
-
FeeJuice: Fr.fromString('
|
|
27
|
+
ContractInstanceRegistry: Fr.fromString('0x265816820ef83a476c1725199f5b25fefffcf30d564b31ae95fa8eeee579aa30'),
|
|
28
|
+
ContractClassRegistry: Fr.fromString('0x0026d0944a8b8204b840c37cf238b145bdd6b1af9daf59eeb5e689022a708e5e'),
|
|
29
|
+
FeeJuice: Fr.fromString('0x2a58e1588a3ee6ef0d4c951051959789ec8a3680c551f74148f4b4dab7a3df9d')
|
|
30
30
|
};
|
|
31
31
|
export const ProtocolContractClassIdPreimage = {
|
|
32
32
|
ContractInstanceRegistry: {
|
|
33
|
-
artifactHash: Fr.fromString('
|
|
34
|
-
privateFunctionsRoot: Fr.fromString('
|
|
35
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
33
|
+
artifactHash: Fr.fromString('0x19835337f0aee2e9042f3a0ae0d334bdb39ecb22794b40d2670d26b2ca72b98f'),
|
|
34
|
+
privateFunctionsRoot: Fr.fromString('0x05bb912d9d2871492d76c610472544d8219df70aa874768f9667e99861d7971f'),
|
|
35
|
+
publicBytecodeCommitment: Fr.fromString('0x1a226919cd754b17c3c32ad430ecb2ce41117aa6bab5d52f070d3ab4c103c45f')
|
|
36
36
|
},
|
|
37
37
|
ContractClassRegistry: {
|
|
38
|
-
artifactHash: Fr.fromString('
|
|
39
|
-
privateFunctionsRoot: Fr.fromString('
|
|
38
|
+
artifactHash: Fr.fromString('0x0d0ef0a61d9c829c306eee702aa7914299d58e7d3fc9f11d5aebd38c838fa1d0'),
|
|
39
|
+
privateFunctionsRoot: Fr.fromString('0x119c77be6d76c221642b63a337d94bf7b6ed8f872927ef3645c7e6b5002baa34'),
|
|
40
40
|
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e')
|
|
41
41
|
},
|
|
42
42
|
FeeJuice: {
|
|
43
|
-
artifactHash: Fr.fromString('
|
|
44
|
-
privateFunctionsRoot: Fr.fromString('
|
|
43
|
+
artifactHash: Fr.fromString('0x2686d931d674aa3a340ad779b9464901ea46b645570f62ddf6beeafcab989e5b'),
|
|
44
|
+
privateFunctionsRoot: Fr.fromString('0x1c4bf54a4a33e3b9eae6f816dfc81e128d76d2646807a5443598c8adbd47f81f'),
|
|
45
45
|
publicBytecodeCommitment: Fr.fromString('0x1d4b1a8f71b8250d4fb65f8e16a4604e9165648279f47d80e024ce2684c4bdfb')
|
|
46
46
|
}
|
|
47
47
|
};
|
|
@@ -54,38 +54,38 @@ export const ProtocolContractPrivateFunctions = {
|
|
|
54
54
|
ContractInstanceRegistry: [
|
|
55
55
|
{
|
|
56
56
|
selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000077cff62f')),
|
|
57
|
-
vkHash: Fr.fromString('
|
|
57
|
+
vkHash: Fr.fromString('0x19172c0acecd517dd8995c2e36178ca2aa16cbe001c3606d8cd848776ab80d23')
|
|
58
58
|
}
|
|
59
59
|
],
|
|
60
60
|
ContractClassRegistry: [
|
|
61
61
|
{
|
|
62
62
|
selector: FunctionSelector.fromField(Fr.fromString('0x000000000000000000000000000000000000000000000000000000006934ed0d')),
|
|
63
|
-
vkHash: Fr.fromString('
|
|
63
|
+
vkHash: Fr.fromString('0x1241fdbf61631c59b977bb6a520cafe3169604036705b8680dea59f05fb71251')
|
|
64
64
|
}
|
|
65
65
|
],
|
|
66
66
|
FeeJuice: [
|
|
67
67
|
{
|
|
68
68
|
selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000cbe67243')),
|
|
69
|
-
vkHash: Fr.fromString('
|
|
69
|
+
vkHash: Fr.fromString('0x0bdf2e5c4467f295f8defb436546a7f2e642e7fe75786d0d54aef497b76527a1')
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000e8d374b6')),
|
|
73
|
-
vkHash: Fr.fromString('
|
|
73
|
+
vkHash: Fr.fromString('0x2616a94d2d2981737c31ed7d74b9fd32ddc8376bf436dd60fb2507662b47c6dd')
|
|
74
74
|
}
|
|
75
75
|
]
|
|
76
76
|
};
|
|
77
77
|
export const ProtocolContractsList = new ProtocolContracts([
|
|
78
|
-
AztecAddress.
|
|
79
|
-
AztecAddress.
|
|
80
|
-
AztecAddress.
|
|
81
|
-
AztecAddress.
|
|
82
|
-
AztecAddress.
|
|
83
|
-
AztecAddress.
|
|
84
|
-
AztecAddress.
|
|
85
|
-
AztecAddress.
|
|
86
|
-
AztecAddress.
|
|
87
|
-
AztecAddress.
|
|
88
|
-
AztecAddress.
|
|
78
|
+
AztecAddress.fromStringUnsafe('0x1bbb52d2b4ac8c634f4b5026f2228580627c918895c369495f71caae13d996fe'),
|
|
79
|
+
AztecAddress.fromStringUnsafe('0x2ce1dfe11c45332d557e8302d624b011eb471f0dfa40d2fae64d9fb21590321b'),
|
|
80
|
+
AztecAddress.fromStringUnsafe('0x258a4892dd83d064f6f250601711a82a7b2aaa20f39dbab216237af3ae0c63f2'),
|
|
81
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
82
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
83
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
84
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
85
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
86
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
87
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
88
|
+
AztecAddress.fromStringUnsafe('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
89
89
|
]);
|
|
90
|
-
export const protocolContractsHash = Fr.fromString('
|
|
90
|
+
export const protocolContractsHash = Fr.fromString('0x08d0026a4983c49638d0910859942c6648d5ea0a3a152c8a376e4983d0a003d9');
|
|
91
91
|
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('0x1a7e1badb79abdd38c684b3c8306ffe7ecb33c69e3380d9855730aaaa83a21a8');
|
|
@@ -6,6 +6,7 @@ import { CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS, CONTRACT_INSTANCE_PUBLISHED_M
|
|
|
6
6
|
import { makeTuple } from '@aztec/foundation/array';
|
|
7
7
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
8
|
import { createConsoleLogger } from '@aztec/foundation/log';
|
|
9
|
+
import { fileURLToPath } from '@aztec/foundation/url';
|
|
9
10
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
10
11
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
11
12
|
import { computeContractAddressFromInstance, computeInitializationHash, getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
@@ -15,8 +16,8 @@ import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
|
15
16
|
import { promises as fs } from 'fs';
|
|
16
17
|
import path from 'path';
|
|
17
18
|
const log = createConsoleLogger('autogenerate');
|
|
18
|
-
const
|
|
19
|
-
const srcPath = path.join(
|
|
19
|
+
const artifactsPkgRoot = path.dirname(fileURLToPath(import.meta.resolve('@aztec/protocol-contracts-artifacts/package.json')));
|
|
20
|
+
const srcPath = path.join(artifactsPkgRoot, 'artifacts');
|
|
20
21
|
const destArtifactsDir = './artifacts';
|
|
21
22
|
const outputFilePath = './src/protocol_contract_data.ts';
|
|
22
23
|
const salt = new Fr(1);
|
|
@@ -105,7 +106,7 @@ function generateSalts(names) {
|
|
|
105
106
|
`;
|
|
106
107
|
}
|
|
107
108
|
function generateContractAddresses(names) {
|
|
108
|
-
const addresses = names.map((name)=>`${name}: AztecAddress.
|
|
109
|
+
const addresses = names.map((name)=>`${name}: AztecAddress.fromBigIntUnsafe(${contractAddressMapping[name]}n)`).join(',\n');
|
|
109
110
|
return `
|
|
110
111
|
export const ProtocolContractAddress: Record<ProtocolContractName, AztecAddress> = {
|
|
111
112
|
${addresses}
|
|
@@ -115,7 +116,7 @@ function generateContractAddresses(names) {
|
|
|
115
116
|
function generateDerivedAddresses(names, contractData) {
|
|
116
117
|
return `
|
|
117
118
|
export const ProtocolContractDerivedAddress = {
|
|
118
|
-
${contractData.map((d, i)=>`${names[i]}: AztecAddress.
|
|
119
|
+
${contractData.map((d, i)=>`${names[i]}: AztecAddress.fromStringUnsafe('${d.address.toString()}')`).join(',\n')}
|
|
119
120
|
};
|
|
120
121
|
`;
|
|
121
122
|
}
|
|
@@ -155,7 +156,7 @@ async function generateProtocolContractsList(names, contractData) {
|
|
|
155
156
|
}
|
|
156
157
|
return `
|
|
157
158
|
export const ProtocolContractsList = new ProtocolContracts([
|
|
158
|
-
${list.map((address)=>`AztecAddress.
|
|
159
|
+
${list.map((address)=>`AztecAddress.fromStringUnsafe('${address.toString()}')`).join(',\n')}
|
|
159
160
|
]);
|
|
160
161
|
|
|
161
162
|
export const protocolContractsHash = Fr.fromString('${(await new ProtocolContracts(list).hash()).toString()}');
|
|
@@ -193,7 +194,7 @@ async function generateOutputFile(names, contractData) {
|
|
|
193
194
|
}
|
|
194
195
|
async function main() {
|
|
195
196
|
await clearDestDir();
|
|
196
|
-
const srcNames = JSON.parse(await fs.readFile(path.join(
|
|
197
|
+
const srcNames = JSON.parse(await fs.readFile(path.join(artifactsPkgRoot, 'protocol_contracts.json'), 'utf8'));
|
|
197
198
|
const contractDataList = [];
|
|
198
199
|
const destNames = srcNames.map((n)=>n.split('-')[1]);
|
|
199
200
|
for(let i = 0; i < srcNames.length; i++){
|
|
@@ -201,7 +202,7 @@ async function main() {
|
|
|
201
202
|
const destName = destNames[i];
|
|
202
203
|
const artifact = await copyArtifact(srcName, destName);
|
|
203
204
|
await generateDeclarationFile(destName);
|
|
204
|
-
contractDataList.push(await computeContractData(artifact, AztecAddress.
|
|
205
|
+
contractDataList.push(await computeContractData(artifact, AztecAddress.fromBigIntUnsafe(BigInt(contractAddressMapping[destName]))));
|
|
205
206
|
}
|
|
206
207
|
await generateOutputFile(destNames, contractDataList);
|
|
207
208
|
}
|
package/dest/tests/fixtures.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { readFileSync } from 'fs';
|
|
2
2
|
import { dirname, resolve } from 'path';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
|
-
// Generated from end-to-end/src/
|
|
4
|
+
// Generated from end-to-end/src/automine/contracts/deploy/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
5
5
|
export function getSampleContractClassPublishedEventPayload() {
|
|
6
6
|
const path = getPathToFixture('ContractClassPublishedEventData.hex');
|
|
7
7
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
8
8
|
}
|
|
9
|
-
// Generated from end-to-end/src/
|
|
9
|
+
// Generated from end-to-end/src/automine/contracts/deploy/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
10
10
|
export function getSampleContractInstancePublishedEventPayload() {
|
|
11
11
|
const path = getPathToFixture('ContractInstancePublishedEventData.hex');
|
|
12
12
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@aztec/protocol-contracts",
|
|
3
3
|
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/protocol-contracts",
|
|
4
4
|
"description": "Canonical Noir contracts for the Aztec Network",
|
|
5
|
-
"version": "0.0.1-commit.
|
|
5
|
+
"version": "0.0.1-commit.9a89641",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dest/index.js",
|
|
@@ -73,14 +73,15 @@
|
|
|
73
73
|
]
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@aztec/constants": "0.0.1-commit.
|
|
77
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
78
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
76
|
+
"@aztec/constants": "0.0.1-commit.9a89641",
|
|
77
|
+
"@aztec/foundation": "0.0.1-commit.9a89641",
|
|
78
|
+
"@aztec/stdlib": "0.0.1-commit.9a89641",
|
|
79
79
|
"lodash.chunk": "^4.2.0",
|
|
80
80
|
"lodash.omit": "^4.5.0",
|
|
81
81
|
"tslib": "^2.4.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
+
"@aztec/protocol-contracts-artifacts": "6.0.0-nightly.20260807",
|
|
84
85
|
"@jest/globals": "^30.0.0",
|
|
85
86
|
"@types/jest": "^30.0.0",
|
|
86
87
|
"@types/lodash.chunk": "^4.2.9",
|
|
@@ -29,14 +29,19 @@ 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
|
+
// See how the log is serialized in `noir-projects/fnd/noir-contracts/contracts/protocol/contract_class_registry_contract/src/events/class_published.nr`.
|
|
33
33
|
const fieldsWithoutTag = log.fields.fields.slice(1);
|
|
34
34
|
const reader = new FieldReader(fieldsWithoutTag);
|
|
35
35
|
const contractClassId = reader.readField();
|
|
36
36
|
const version = reader.readField().toNumber();
|
|
37
37
|
const artifactHash = reader.readField();
|
|
38
38
|
const privateFunctionsRoot = reader.readField();
|
|
39
|
-
const
|
|
39
|
+
const bytecodeFields = reader.readFieldArray(fieldsWithoutTag.length - reader.cursor);
|
|
40
|
+
// The fixed-size class log can hold at most this many packed-bytecode bytes (every payload field
|
|
41
|
+
// carries 31 bytes). Bound the declared length to it so a malformed log can't declare a multi-MiB
|
|
42
|
+
// length backed by a tiny payload and force a large allocation during early (pre-proof) validation.
|
|
43
|
+
const maxByteLength = (bytecodeFields.length - 1) * (Fr.SIZE_IN_BYTES - 1);
|
|
44
|
+
const packedPublicBytecode = bufferFromFields(bytecodeFields, maxByteLength);
|
|
40
45
|
|
|
41
46
|
return new ContractClassPublishedEvent(
|
|
42
47
|
contractClassId,
|
|
@@ -12,7 +12,7 @@ export async function getContractClassRegistryArtifact(): Promise<ContractArtifa
|
|
|
12
12
|
if (!protocolContractArtifact) {
|
|
13
13
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
14
14
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
15
|
-
// Even if now supported by
|
|
15
|
+
// Even if now supported by all major browsers, the MIME type is replaced with
|
|
16
16
|
// "text/javascript"
|
|
17
17
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
18
18
|
const { default: contractClassRegistryJson } = await import('../../artifacts/ContractClassRegistry.json');
|
package/src/fee-juice/lazy.ts
CHANGED
|
@@ -10,7 +10,7 @@ export async function getFeeJuiceArtifact(): Promise<ContractArtifact> {
|
|
|
10
10
|
if (!protocolContractArtifact) {
|
|
11
11
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
12
12
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
13
|
-
// Even if now supported by
|
|
13
|
+
// Even if now supported by all major browsers, the MIME type is replaced with
|
|
14
14
|
// "text/javascript"
|
|
15
15
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
16
16
|
const { default: feeJuiceJson } = await import('../../artifacts/FeeJuice.json');
|
|
@@ -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');
|
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';
|
|
@@ -25,41 +25,41 @@ FeeJuice: new Fr(1)
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
export const ProtocolContractAddress: Record<ProtocolContractName, AztecAddress> = {
|
|
28
|
-
ContractInstanceRegistry: AztecAddress.
|
|
29
|
-
ContractClassRegistry: AztecAddress.
|
|
30
|
-
FeeJuice: AztecAddress.
|
|
28
|
+
ContractInstanceRegistry: AztecAddress.fromBigIntUnsafe(2n),
|
|
29
|
+
ContractClassRegistry: AztecAddress.fromBigIntUnsafe(1n),
|
|
30
|
+
FeeJuice: AztecAddress.fromBigIntUnsafe(3n)
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
export const ProtocolContractDerivedAddress = {
|
|
36
|
-
ContractInstanceRegistry: AztecAddress.
|
|
37
|
-
ContractClassRegistry: AztecAddress.
|
|
38
|
-
FeeJuice: AztecAddress.
|
|
36
|
+
ContractInstanceRegistry: AztecAddress.fromStringUnsafe('0x2ce1dfe11c45332d557e8302d624b011eb471f0dfa40d2fae64d9fb21590321b'),
|
|
37
|
+
ContractClassRegistry: AztecAddress.fromStringUnsafe('0x1bbb52d2b4ac8c634f4b5026f2228580627c918895c369495f71caae13d996fe'),
|
|
38
|
+
FeeJuice: AztecAddress.fromStringUnsafe('0x258a4892dd83d064f6f250601711a82a7b2aaa20f39dbab216237af3ae0c63f2')
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
export const ProtocolContractClassId: Record<ProtocolContractName, Fr> = {
|
|
44
|
-
ContractInstanceRegistry: Fr.fromString('
|
|
45
|
-
ContractClassRegistry: Fr.fromString('
|
|
46
|
-
FeeJuice: Fr.fromString('
|
|
44
|
+
ContractInstanceRegistry: Fr.fromString('0x265816820ef83a476c1725199f5b25fefffcf30d564b31ae95fa8eeee579aa30'),
|
|
45
|
+
ContractClassRegistry: Fr.fromString('0x0026d0944a8b8204b840c37cf238b145bdd6b1af9daf59eeb5e689022a708e5e'),
|
|
46
|
+
FeeJuice: Fr.fromString('0x2a58e1588a3ee6ef0d4c951051959789ec8a3680c551f74148f4b4dab7a3df9d')
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
export const ProtocolContractClassIdPreimage: Record<ProtocolContractName, { artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }> = {
|
|
50
50
|
ContractInstanceRegistry: {
|
|
51
|
-
artifactHash: Fr.fromString('
|
|
52
|
-
privateFunctionsRoot: Fr.fromString('
|
|
53
|
-
publicBytecodeCommitment: Fr.fromString('
|
|
51
|
+
artifactHash: Fr.fromString('0x19835337f0aee2e9042f3a0ae0d334bdb39ecb22794b40d2670d26b2ca72b98f'),
|
|
52
|
+
privateFunctionsRoot: Fr.fromString('0x05bb912d9d2871492d76c610472544d8219df70aa874768f9667e99861d7971f'),
|
|
53
|
+
publicBytecodeCommitment: Fr.fromString('0x1a226919cd754b17c3c32ad430ecb2ce41117aa6bab5d52f070d3ab4c103c45f'),
|
|
54
54
|
},
|
|
55
55
|
ContractClassRegistry: {
|
|
56
|
-
artifactHash: Fr.fromString('
|
|
57
|
-
privateFunctionsRoot: Fr.fromString('
|
|
56
|
+
artifactHash: Fr.fromString('0x0d0ef0a61d9c829c306eee702aa7914299d58e7d3fc9f11d5aebd38c838fa1d0'),
|
|
57
|
+
privateFunctionsRoot: Fr.fromString('0x119c77be6d76c221642b63a337d94bf7b6ed8f872927ef3645c7e6b5002baa34'),
|
|
58
58
|
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e'),
|
|
59
59
|
},
|
|
60
60
|
FeeJuice: {
|
|
61
|
-
artifactHash: Fr.fromString('
|
|
62
|
-
privateFunctionsRoot: Fr.fromString('
|
|
61
|
+
artifactHash: Fr.fromString('0x2686d931d674aa3a340ad779b9464901ea46b645570f62ddf6beeafcab989e5b'),
|
|
62
|
+
privateFunctionsRoot: Fr.fromString('0x1c4bf54a4a33e3b9eae6f816dfc81e128d76d2646807a5443598c8adbd47f81f'),
|
|
63
63
|
publicBytecodeCommitment: Fr.fromString('0x1d4b1a8f71b8250d4fb65f8e16a4604e9165648279f47d80e024ce2684c4bdfb'),
|
|
64
64
|
}
|
|
65
65
|
};
|
|
@@ -71,28 +71,28 @@ FeeJuice: Fr.fromString('0x00000000000000000000000000000000000000000000000000000
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
export const ProtocolContractPrivateFunctions: Record<ProtocolContractName, { selector: FunctionSelector; vkHash: Fr }[]> = {
|
|
74
|
-
ContractInstanceRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000077cff62f')), vkHash: Fr.fromString('
|
|
75
|
-
ContractClassRegistry: [{ selector: FunctionSelector.fromField(Fr.fromString('0x000000000000000000000000000000000000000000000000000000006934ed0d')), vkHash: Fr.fromString('
|
|
76
|
-
FeeJuice: [{ selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000cbe67243')), vkHash: Fr.fromString('
|
|
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') }]
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
export const ProtocolContractsList = new ProtocolContracts([
|
|
82
|
-
AztecAddress.
|
|
83
|
-
AztecAddress.
|
|
84
|
-
AztecAddress.
|
|
85
|
-
AztecAddress.
|
|
86
|
-
AztecAddress.
|
|
87
|
-
AztecAddress.
|
|
88
|
-
AztecAddress.
|
|
89
|
-
AztecAddress.
|
|
90
|
-
AztecAddress.
|
|
91
|
-
AztecAddress.
|
|
92
|
-
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')
|
|
93
93
|
]);
|
|
94
94
|
|
|
95
|
-
export const protocolContractsHash = Fr.fromString('
|
|
95
|
+
export const protocolContractsHash = Fr.fromString('0x08d0026a4983c49638d0910859942c6648d5ea0a3a152c8a376e4983d0a003d9');
|
|
96
96
|
|
|
97
97
|
|
|
98
98
|
|
package/src/tests/fixtures.ts
CHANGED
|
@@ -2,13 +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/
|
|
11
|
+
// Generated from end-to-end/src/automine/contracts/deploy/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
12
12
|
export function getSampleContractInstancePublishedEventPayload(): Buffer {
|
|
13
13
|
const path = getPathToFixture('ContractInstancePublishedEventData.hex');
|
|
14
14
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|