@aztec/protocol-contracts 0.0.0-test.1 → 0.0.1-commit.017a351
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/ContractClassRegistry.json +3950 -0
- package/artifacts/ContractInstanceRegistry.json +5132 -0
- package/artifacts/FeeJuice.json +5171 -2507
- package/dest/class-registry/contract_class_published_event.d.ts +20 -0
- package/dest/class-registry/contract_class_published_event.d.ts.map +1 -0
- package/dest/class-registry/contract_class_published_event.js +52 -0
- package/dest/class-registry/index.d.ts +6 -0
- package/dest/class-registry/index.d.ts.map +1 -0
- package/dest/class-registry/index.js +15 -0
- package/dest/class-registry/lazy.d.ts +7 -0
- package/dest/class-registry/lazy.d.ts.map +1 -0
- package/dest/class-registry/lazy.js +24 -0
- package/dest/fee-juice/index.d.ts +2 -2
- package/dest/fee-juice/index.d.ts.map +1 -1
- package/dest/fee-juice/index.js +4 -4
- package/dest/fee-juice/lazy.d.ts +1 -1
- package/dest/fee-juice/lazy.js +5 -5
- package/dest/index.d.ts +1 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +0 -1
- package/dest/instance-registry/contract_instance_published_event.d.ts +22 -0
- package/dest/instance-registry/contract_instance_published_event.d.ts.map +1 -0
- package/dest/{instance-deployer/contract_instance_deployed_event.js → instance-registry/contract_instance_published_event.js} +15 -8
- package/dest/instance-registry/contract_instance_updated_event.d.ts +17 -0
- package/dest/instance-registry/contract_instance_updated_event.d.ts.map +1 -0
- package/dest/instance-registry/contract_instance_updated_event.js +35 -0
- package/dest/instance-registry/index.d.ts +7 -0
- package/dest/instance-registry/index.d.ts.map +1 -0
- package/dest/instance-registry/index.js +15 -0
- package/dest/instance-registry/lazy.d.ts +8 -0
- package/dest/{instance-deployer → instance-registry}/lazy.d.ts.map +1 -1
- package/dest/instance-registry/lazy.js +25 -0
- package/dest/make_protocol_contract.d.ts +4 -4
- package/dest/make_protocol_contract.d.ts.map +1 -1
- package/dest/make_protocol_contract.js +30 -14
- package/dest/protocol_contract.d.ts +1 -1
- package/dest/protocol_contract_data.d.ts +23 -16
- package/dest/protocol_contract_data.d.ts.map +1 -1
- package/dest/protocol_contract_data.js +82 -32
- package/dest/provider/bundle.d.ts +1 -1
- package/dest/provider/bundle.d.ts.map +1 -1
- package/dest/provider/bundle.js +6 -12
- package/dest/provider/lazy.d.ts +1 -1
- package/dest/provider/lazy.d.ts.map +1 -1
- package/dest/provider/lazy.js +6 -15
- package/dest/provider/protocol_contracts_provider.d.ts +1 -1
- package/dest/scripts/cleanup_artifacts.js +2 -2
- package/dest/scripts/generate_data.js +96 -56
- package/dest/tests/fixtures.d.ts +3 -7
- package/dest/tests/fixtures.d.ts.map +1 -1
- package/dest/tests/fixtures.js +4 -14
- package/package.json +23 -20
- package/src/class-registry/__snapshots__/README.md +9 -0
- package/src/class-registry/contract_class_published_event.ts +72 -0
- package/src/class-registry/index.ts +21 -0
- package/src/class-registry/lazy.ts +31 -0
- package/src/fee-juice/index.ts +5 -5
- package/src/fee-juice/lazy.ts +5 -5
- package/src/index.ts +0 -1
- package/src/instance-registry/__snapshots__/README.md +9 -0
- package/src/{instance-deployer/contract_instance_deployed_event.ts → instance-registry/contract_instance_published_event.ts} +18 -8
- package/src/{instance-deployer → instance-registry}/contract_instance_updated_event.ts +15 -15
- package/src/instance-registry/index.ts +23 -0
- package/src/instance-registry/lazy.ts +32 -0
- package/src/make_protocol_contract.ts +39 -15
- package/src/protocol_contract_data.ts +70 -32
- package/src/provider/bundle.ts +5 -11
- package/src/provider/lazy.ts +6 -15
- package/src/tests/fixtures.ts +4 -16
- package/artifacts/AuthRegistry.json +0 -2725
- package/artifacts/ContractClassRegisterer.json +0 -7219
- package/artifacts/ContractInstanceDeployer.d.json.ts +0 -5
- package/artifacts/ContractInstanceDeployer.json +0 -2984
- package/artifacts/MultiCallEntrypoint.d.json.ts +0 -5
- package/artifacts/MultiCallEntrypoint.json +0 -2005
- package/artifacts/Router.d.json.ts +0 -5
- package/artifacts/Router.json +0 -3798
- package/dest/auth-registry/index.d.ts +0 -5
- 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/build_protocol_contract_tree.d.ts +0 -10
- package/dest/build_protocol_contract_tree.d.ts.map +0 -1
- package/dest/build_protocol_contract_tree.js +0 -20
- package/dest/class-registerer/contract_class_registered_event.d.ts +0 -18
- package/dest/class-registerer/contract_class_registered_event.d.ts.map +0 -1
- package/dest/class-registerer/contract_class_registered_event.js +0 -63
- package/dest/class-registerer/index.d.ts +0 -8
- package/dest/class-registerer/index.d.ts.map +0 -1
- package/dest/class-registerer/index.js +0 -17
- package/dest/class-registerer/lazy.d.ts +0 -9
- package/dest/class-registerer/lazy.d.ts.map +0 -1
- package/dest/class-registerer/lazy.js +0 -26
- package/dest/class-registerer/private_function_broadcasted_event.d.ts +0 -46
- package/dest/class-registerer/private_function_broadcasted_event.d.ts.map +0 -1
- package/dest/class-registerer/private_function_broadcasted_event.js +0 -85
- package/dest/class-registerer/unconstrained_function_broadcasted_event.d.ts +0 -40
- package/dest/class-registerer/unconstrained_function_broadcasted_event.d.ts.map +0 -1
- package/dest/class-registerer/unconstrained_function_broadcasted_event.js +0 -81
- package/dest/instance-deployer/contract_instance_deployed_event.d.ts +0 -20
- package/dest/instance-deployer/contract_instance_deployed_event.d.ts.map +0 -1
- package/dest/instance-deployer/contract_instance_updated_event.d.ts +0 -16
- package/dest/instance-deployer/contract_instance_updated_event.d.ts.map +0 -1
- package/dest/instance-deployer/contract_instance_updated_event.js +0 -36
- package/dest/instance-deployer/index.d.ts +0 -7
- package/dest/instance-deployer/index.d.ts.map +0 -1
- package/dest/instance-deployer/index.js +0 -15
- package/dest/instance-deployer/lazy.d.ts +0 -8
- package/dest/instance-deployer/lazy.js +0 -25
- package/dest/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/protocol_contract_tree.d.ts +0 -7
- package/dest/protocol_contract_tree.d.ts.map +0 -1
- package/dest/protocol_contract_tree.js +0 -34
- package/dest/router/index.d.ts +0 -5
- package/dest/router/index.d.ts.map +0 -1
- package/dest/router/index.js +0 -13
- package/dest/router/lazy.d.ts +0 -6
- package/dest/router/lazy.d.ts.map +0 -1
- package/dest/router/lazy.js +0 -23
- package/src/auth-registry/index.ts +0 -18
- package/src/auth-registry/lazy.ts +0 -29
- package/src/build_protocol_contract_tree.ts +0 -29
- package/src/class-registerer/contract_class_registered_event.ts +0 -83
- package/src/class-registerer/index.ts +0 -25
- package/src/class-registerer/lazy.ts +0 -33
- package/src/class-registerer/private_function_broadcasted_event.ts +0 -105
- package/src/class-registerer/unconstrained_function_broadcasted_event.ts +0 -99
- package/src/instance-deployer/index.ts +0 -23
- package/src/instance-deployer/lazy.ts +0 -32
- package/src/multi-call-entrypoint/index.ts +0 -18
- package/src/multi-call-entrypoint/lazy.ts +0 -29
- package/src/protocol_contract_tree.ts +0 -44
- package/src/router/index.ts +0 -18
- package/src/router/lazy.ts +0 -29
- /package/artifacts/{AuthRegistry.d.json.ts → ContractClassRegistry.d.json.ts} +0 -0
- /package/artifacts/{ContractClassRegisterer.d.json.ts → ContractInstanceRegistry.d.json.ts} +0 -0
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"protocol_contract_data.d.ts","sourceRoot":"","sources":["../src/protocol_contract_data.ts"],"names":[],"mappings":"AAEI,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,eAAO,MAAM,qBAAqB,4EAIxB,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAIxE,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,oBAAoB,EAAE,EAAE,CAIjE,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAI9E,CAAC;AAIF,eAAO,MAAM,8BAA8B;;;;CAI1C,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,oBAAoB,EAAE,EAAE,CAIpE,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,oBAAoB,EAAE;IAAE,YAAY,EAAE,EAAE,CAAC;IAAC,oBAAoB,EAAE,EAAE,CAAC;IAAC,wBAAwB,EAAE,EAAE,CAAA;CAAE,CAgBtJ,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,MAAM,CAAC,oBAAoB,EAAE,EAAE,CAI/E,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,oBAAoB,EAAE;IAAE,QAAQ,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,EAAE,CAAA;CAAE,EAAE,CAIvH,CAAC;AAIF,eAAO,MAAM,qBAAqB,mBAYhC,CAAC;AAEH,eAAO,MAAM,qBAAqB,IAAsF,CAAC;AAI3H,eAAO,MAAM,qCAAqC,IAAyF,CAAC"}
|
|
@@ -1,41 +1,91 @@
|
|
|
1
1
|
// GENERATED FILE - DO NOT EDIT. RUN `yarn generate` or `yarn generate:data`
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
3
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
4
6
|
export const protocolContractNames = [
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'MultiCallEntrypoint',
|
|
9
|
-
'FeeJuice',
|
|
10
|
-
'Router'
|
|
7
|
+
'ContractInstanceRegistry',
|
|
8
|
+
'ContractClassRegistry',
|
|
9
|
+
'FeeJuice'
|
|
11
10
|
];
|
|
12
11
|
export const ProtocolContractSalt = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
MultiCallEntrypoint: new Fr(1),
|
|
17
|
-
FeeJuice: new Fr(1),
|
|
18
|
-
Router: new Fr(1)
|
|
12
|
+
ContractInstanceRegistry: new Fr(1),
|
|
13
|
+
ContractClassRegistry: new Fr(1),
|
|
14
|
+
FeeJuice: new Fr(1)
|
|
19
15
|
};
|
|
20
16
|
export const ProtocolContractAddress = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
MultiCallEntrypoint: AztecAddress.fromBigInt(4n),
|
|
25
|
-
FeeJuice: AztecAddress.fromBigInt(5n),
|
|
26
|
-
Router: AztecAddress.fromBigInt(6n)
|
|
17
|
+
ContractInstanceRegistry: AztecAddress.fromBigInt(2n),
|
|
18
|
+
ContractClassRegistry: AztecAddress.fromBigInt(1n),
|
|
19
|
+
FeeJuice: AztecAddress.fromBigInt(3n)
|
|
27
20
|
};
|
|
28
|
-
export const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
MultiCallEntrypoint: Fr.fromHexString('0x121f834b03a64d38463ae18ddebceeb4dce8192cc289052e175ad754a883a7fe'),
|
|
33
|
-
FeeJuice: Fr.fromHexString('0x141a566ade0bef915526762c2c2fb19b2a756ad7c82e83fde6dbf86848ecc131'),
|
|
34
|
-
Router: Fr.fromHexString('0x2c20bd328fbd33c01fbcda9e6299c31da5d5b29ea30e9c7b9d631618b839bca9')
|
|
21
|
+
export const ProtocolContractDerivedAddress = {
|
|
22
|
+
ContractInstanceRegistry: AztecAddress.fromString('0x290f7bf7cea0eb4c440a06dc8bcf825865479348c9ebf8f540b10ad10fd32c44'),
|
|
23
|
+
ContractClassRegistry: AztecAddress.fromString('0x20b16259faa0a096d687572fc76221263f1cad4a4b726ef49e2cd7b7ce7c7465'),
|
|
24
|
+
FeeJuice: AztecAddress.fromString('0x0fa3ba3e01e6646cd2adade41018dbfff04e59c444760e33bf773ec43d683019')
|
|
35
25
|
};
|
|
36
|
-
export const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export const
|
|
26
|
+
export const ProtocolContractClassId = {
|
|
27
|
+
ContractInstanceRegistry: Fr.fromString('0x123597d7f3c460a3e91bfb92e729fcd048d4f50a88b7c25e694cf75827062e3f'),
|
|
28
|
+
ContractClassRegistry: Fr.fromString('0x243b6ce1af8f520d531b26ce5081fa29c0870ce8d5949c5304a6705b07947a2e'),
|
|
29
|
+
FeeJuice: Fr.fromString('0x1f65e3db036c48ac8f8635b156880ed17e9437ed8904a0c0554f0d6251bf0997')
|
|
30
|
+
};
|
|
31
|
+
export const ProtocolContractClassIdPreimage = {
|
|
32
|
+
ContractInstanceRegistry: {
|
|
33
|
+
artifactHash: Fr.fromString('0x0cb37c0b0ec8670b88b472fca5858f8cb112a41ba2aad664903ac1a3bed468b3'),
|
|
34
|
+
privateFunctionsRoot: Fr.fromString('0x0239b0f293384aad456e2e27901eb97cd9073322a28d14b0ac7816a5297b2812'),
|
|
35
|
+
publicBytecodeCommitment: Fr.fromString('0x2c79b6699098244e947caca071a31799c20aa20e7124910a2b7c918fe817d65e')
|
|
36
|
+
},
|
|
37
|
+
ContractClassRegistry: {
|
|
38
|
+
artifactHash: Fr.fromString('0x1e252471ee2b770fba961d03289344f1798336d9a94e1d8f137397754708de0e'),
|
|
39
|
+
privateFunctionsRoot: Fr.fromString('0x0672f623ec0753ab9fbb02a9a241df81b9bcc0dbed8628d8cab8790e0cb0c03d'),
|
|
40
|
+
publicBytecodeCommitment: Fr.fromString('0x0ce4c618c3ed7f3a20410e618c06bb701e150af7fe28a3e92f68e7733809f33e')
|
|
41
|
+
},
|
|
42
|
+
FeeJuice: {
|
|
43
|
+
artifactHash: Fr.fromString('0x1243f24c1d3e8b42c900aa95d3a12448d84f8b5da3fe047f8ac8a46e67bb10b7'),
|
|
44
|
+
privateFunctionsRoot: Fr.fromString('0x247aaafc67f6bf5b06736649181a477dac9f18d3468969b14669708c3dabb275'),
|
|
45
|
+
publicBytecodeCommitment: Fr.fromString('0x1d4b1a8f71b8250d4fb65f8e16a4604e9165648279f47d80e024ce2684c4bdfb')
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
export const ProtocolContractInitializationHash = {
|
|
49
|
+
ContractInstanceRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
50
|
+
ContractClassRegistry: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
51
|
+
FeeJuice: Fr.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
52
|
+
};
|
|
53
|
+
export const ProtocolContractPrivateFunctions = {
|
|
54
|
+
ContractInstanceRegistry: [
|
|
55
|
+
{
|
|
56
|
+
selector: FunctionSelector.fromField(Fr.fromString('0x0000000000000000000000000000000000000000000000000000000077cff62f')),
|
|
57
|
+
vkHash: Fr.fromString('0x08a57d0b4d164c6c8d92da9c3bfe57a4ac1a639ab0a2a0ccb60bbb6bcd37f245')
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
ContractClassRegistry: [
|
|
61
|
+
{
|
|
62
|
+
selector: FunctionSelector.fromField(Fr.fromString('0x000000000000000000000000000000000000000000000000000000006934ed0d')),
|
|
63
|
+
vkHash: Fr.fromString('0x1531ed0e20d6d05f1aeb06f746c8c4b8f467174836d6edf915b0c45099b393ed')
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
FeeJuice: [
|
|
67
|
+
{
|
|
68
|
+
selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000cbe67243')),
|
|
69
|
+
vkHash: Fr.fromString('0x2dbad42bf59fe7ea908485dea59573b4d7fb8ddefb6a0f73bbcce79aa27d545c')
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
selector: FunctionSelector.fromField(Fr.fromString('0x00000000000000000000000000000000000000000000000000000000e8d374b6')),
|
|
73
|
+
vkHash: Fr.fromString('0x2e9880e15fb0c9a5494faef915861144769e94aded54c737819ee75918fbda51')
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
};
|
|
77
|
+
export const ProtocolContractsList = new ProtocolContracts([
|
|
78
|
+
AztecAddress.fromString('0x20b16259faa0a096d687572fc76221263f1cad4a4b726ef49e2cd7b7ce7c7465'),
|
|
79
|
+
AztecAddress.fromString('0x290f7bf7cea0eb4c440a06dc8bcf825865479348c9ebf8f540b10ad10fd32c44'),
|
|
80
|
+
AztecAddress.fromString('0x0fa3ba3e01e6646cd2adade41018dbfff04e59c444760e33bf773ec43d683019'),
|
|
81
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
82
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
83
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
84
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
85
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
86
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
87
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
|
|
88
|
+
AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
|
|
89
|
+
]);
|
|
90
|
+
export const protocolContractsHash = Fr.fromString('0x04194c6dd98d175d07d300b253a9967f5c46782d0e9c3c88473f79ca8b8b16d6');
|
|
91
|
+
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('0x1a7e1badb79abdd38c684b3c8306ffe7ecb33c69e3380d9855730aaaa83a21a8');
|
|
@@ -6,4 +6,4 @@ export declare const ProtocolContractArtifact: Record<ProtocolContractName, Cont
|
|
|
6
6
|
export declare class BundledProtocolContractsProvider implements ProtocolContractsProvider {
|
|
7
7
|
getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract>;
|
|
8
8
|
}
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVuZGxlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHJvdmlkZXIvYnVuZGxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFNMUQsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxvQkFBb0IsRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBQ3pFLE9BQU8sS0FBSyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFFbEYsZUFBTyxNQUFNLHdCQUF3QixFQUFFLE1BQU0sQ0FBQyxvQkFBb0IsRUFBRSxnQkFBZ0IsQ0FJbkYsQ0FBQztBQUVGLHFCQUFhLGdDQUFpQyxZQUFXLHlCQUF5QjtJQUNoRiwyQkFBMkIsQ0FBQyxJQUFJLEVBQUUsb0JBQW9CLEdBQUcsT0FBTyxDQUFDLGdCQUFnQixDQUFDLENBRWpGO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/provider/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/provider/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAM1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAElF,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,oBAAoB,EAAE,gBAAgB,CAInF,CAAC;AAEF,qBAAa,gCAAiC,YAAW,yBAAyB;IAChF,2BAA2B,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAEjF;CACF"}
|
package/dest/provider/bundle.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ContractClassRegistererArtifact } from '../class-registerer/index.js';
|
|
1
|
+
import { ContractClassRegistryArtifact } from '../class-registry/index.js';
|
|
3
2
|
import { FeeJuiceArtifact } from '../fee-juice/index.js';
|
|
4
|
-
import {
|
|
3
|
+
import { ContractInstanceRegistryArtifact } from '../instance-registry/index.js';
|
|
5
4
|
import { makeProtocolContract } from '../make_protocol_contract.js';
|
|
6
|
-
import { MultiCallEntrypointArtifact } from '../multi-call-entrypoint/index.js';
|
|
7
|
-
import { RouterArtifact } from '../router/index.js';
|
|
8
5
|
export const ProtocolContractArtifact = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
MultiCallEntrypoint: MultiCallEntrypointArtifact,
|
|
13
|
-
FeeJuice: FeeJuiceArtifact,
|
|
14
|
-
Router: RouterArtifact
|
|
6
|
+
ContractInstanceRegistry: ContractInstanceRegistryArtifact,
|
|
7
|
+
ContractClassRegistry: ContractClassRegistryArtifact,
|
|
8
|
+
FeeJuice: FeeJuiceArtifact
|
|
15
9
|
};
|
|
16
10
|
export class BundledProtocolContractsProvider {
|
|
17
11
|
getProtocolContractArtifact(name) {
|
|
18
|
-
return makeProtocolContract(name, ProtocolContractArtifact[name]);
|
|
12
|
+
return Promise.resolve(makeProtocolContract(name, ProtocolContractArtifact[name]));
|
|
19
13
|
}
|
|
20
14
|
}
|
package/dest/provider/lazy.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ import type { ProtocolContractsProvider } from './protocol_contracts_provider.js
|
|
|
4
4
|
export declare class LazyProtocolContractsProvider implements ProtocolContractsProvider {
|
|
5
5
|
getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract>;
|
|
6
6
|
}
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Byb3ZpZGVyL2xhenkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0EsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxvQkFBb0IsRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBQ3pFLE9BQU8sS0FBSyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFFbEYscUJBQWEsNkJBQThCLFlBQVcseUJBQXlCO0lBQzdFLDJCQUEyQixDQUFDLElBQUksRUFBRSxvQkFBb0IsR0FBRyxPQUFPLENBQUMsZ0JBQWdCLENBQUMsQ0FXakY7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/provider/lazy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/provider/lazy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAElF,qBAAa,6BAA8B,YAAW,yBAAyB;IAC7E,2BAA2B,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAWjF;CACF"}
|
package/dest/provider/lazy.js
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getCanonicalClassRegisterer } from '../class-registerer/lazy.js';
|
|
1
|
+
import { getCanonicalClassRegistry } from '../class-registry/lazy.js';
|
|
3
2
|
import { getCanonicalFeeJuice } from '../fee-juice/lazy.js';
|
|
4
|
-
import {
|
|
5
|
-
import { getCanonicalMultiCallEntrypoint } from '../multi-call-entrypoint/lazy.js';
|
|
6
|
-
import { getCanonicalRouter } from '../router/lazy.js';
|
|
3
|
+
import { getCanonicalInstanceRegistry } from '../instance-registry/lazy.js';
|
|
7
4
|
export class LazyProtocolContractsProvider {
|
|
8
5
|
getProtocolContractArtifact(name) {
|
|
9
6
|
switch(name){
|
|
10
|
-
case '
|
|
11
|
-
return
|
|
12
|
-
case '
|
|
13
|
-
return
|
|
14
|
-
case 'ContractClassRegisterer':
|
|
15
|
-
return getCanonicalClassRegisterer();
|
|
16
|
-
case 'MultiCallEntrypoint':
|
|
17
|
-
return getCanonicalMultiCallEntrypoint();
|
|
7
|
+
case 'ContractInstanceRegistry':
|
|
8
|
+
return getCanonicalInstanceRegistry();
|
|
9
|
+
case 'ContractClassRegistry':
|
|
10
|
+
return getCanonicalClassRegistry();
|
|
18
11
|
case 'FeeJuice':
|
|
19
12
|
return getCanonicalFeeJuice();
|
|
20
|
-
case 'Router':
|
|
21
|
-
return getCanonicalRouter();
|
|
22
13
|
default:
|
|
23
14
|
throw new Error(`Unknown protocol contract name: ${name}`);
|
|
24
15
|
}
|
|
@@ -4,4 +4,4 @@ import type { ProtocolContractName } from '../protocol_contract_data.js';
|
|
|
4
4
|
export interface ProtocolContractsProvider {
|
|
5
5
|
getProtocolContractArtifact(name: ProtocolContractName): Promise<ProtocolContract>;
|
|
6
6
|
}
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvdG9jb2xfY29udHJhY3RzX3Byb3ZpZGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHJvdmlkZXIvcHJvdG9jb2xfY29udHJhY3RzX3Byb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSw4QkFBOEIsQ0FBQztBQUV6RSw0REFBNEQ7QUFDNUQsTUFBTSxXQUFXLHlCQUF5QjtJQUN4QywyQkFBMkIsQ0FBQyxJQUFJLEVBQUUsb0JBQW9CLEdBQUcsT0FBTyxDQUFDLGdCQUFnQixDQUFDLENBQUM7Q0FDcEYifQ==
|
|
@@ -8,9 +8,9 @@ async function cleanupArtifacts(target) {
|
|
|
8
8
|
continue;
|
|
9
9
|
}
|
|
10
10
|
const fileData = JSON.parse((await readFile(join(target, file), 'utf8')).toString());
|
|
11
|
-
fileData.file_map = {};
|
|
11
|
+
/* eslint-disable camelcase */ fileData.file_map = {};
|
|
12
12
|
fileData.debug_symbols = {};
|
|
13
|
-
await writeFile(join(target, file), JSON.stringify(fileData));
|
|
13
|
+
/* eslint-enable camelcase */ await writeFile(join(target, file), JSON.stringify(fileData));
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
await cleanupArtifacts(fileURLToPath(new URL('../../artifacts', import.meta.url).href));
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// Reads compiled Noir artifacts for each protocol contract and derives their addresses, class IDs,
|
|
2
|
+
// bytecode commitments, and other deployment data, emitting everything as precomputed constants into
|
|
3
|
+
// `protocol_contract_data.ts`. This avoids clients repeating the expensive hashing at runtime and
|
|
4
|
+
// ensures a single source of truth for the protocol contracts hash enforced by circuits, P2P, and L1.
|
|
5
|
+
import { CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS, CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE, CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS, FEE_JUICE_ADDRESS, MAX_PROTOCOL_CONTRACTS } from '@aztec/constants';
|
|
6
|
+
import { makeTuple } from '@aztec/foundation/array';
|
|
7
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
8
|
import { createConsoleLogger } from '@aztec/foundation/log';
|
|
5
9
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
6
10
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import {
|
|
11
|
+
import { computeContractAddressFromInstance, computeInitializationHash, getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
12
|
+
import { computeSiloedPrivateLogFirstField } from '@aztec/stdlib/hash';
|
|
13
|
+
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
14
|
+
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
8
15
|
import { promises as fs } from 'fs';
|
|
9
16
|
import path from 'path';
|
|
10
|
-
import { buildProtocolContractTree } from '../build_protocol_contract_tree.js';
|
|
11
17
|
const log = createConsoleLogger('autogenerate');
|
|
12
18
|
const noirContractsRoot = '../../noir-projects/noir-contracts';
|
|
13
19
|
const srcPath = path.join(noirContractsRoot, './target');
|
|
@@ -15,12 +21,9 @@ const destArtifactsDir = './artifacts';
|
|
|
15
21
|
const outputFilePath = './src/protocol_contract_data.ts';
|
|
16
22
|
const salt = new Fr(1);
|
|
17
23
|
const contractAddressMapping = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
MultiCallEntrypoint: MULTI_CALL_ENTRYPOINT_ADDRESS,
|
|
22
|
-
FeeJuice: FEE_JUICE_ADDRESS,
|
|
23
|
-
Router: ROUTER_ADDRESS
|
|
24
|
+
ContractInstanceRegistry: CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS,
|
|
25
|
+
ContractClassRegistry: CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS,
|
|
26
|
+
FeeJuice: FEE_JUICE_ADDRESS
|
|
24
27
|
};
|
|
25
28
|
async function clearDestDir() {
|
|
26
29
|
try {
|
|
@@ -49,19 +52,33 @@ async function copyArtifact(srcName, destName) {
|
|
|
49
52
|
await fs.copyFile(src, dest);
|
|
50
53
|
return artifact;
|
|
51
54
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
// Precompute all the expensive contract data that can be obtained from the artifact, to avoid redundant computations in clients.
|
|
56
|
+
// Protocol contracts come from a trusted source, so no class verifications are needed.
|
|
57
|
+
async function computeContractData(artifact, deployer) {
|
|
58
|
+
const loaded = loadContractArtifact(artifact);
|
|
59
|
+
const contractClass = await getContractClassFromArtifact(loaded);
|
|
60
|
+
const constructorArtifact = loaded.functions.find((f)=>f.name === 'constructor');
|
|
61
|
+
const initializationHash = await computeInitializationHash(constructorArtifact, []);
|
|
62
|
+
const instance = {
|
|
63
|
+
version: 2,
|
|
64
|
+
currentContractClassId: contractClass.id,
|
|
65
|
+
originalContractClassId: contractClass.id,
|
|
66
|
+
initializationHash,
|
|
67
|
+
immutablesHash: Fr.ZERO,
|
|
68
|
+
publicKeys: PublicKeys.default(),
|
|
69
|
+
salt,
|
|
70
|
+
deployer
|
|
71
|
+
};
|
|
72
|
+
const address = await computeContractAddressFromInstance(instance);
|
|
73
|
+
return {
|
|
74
|
+
address,
|
|
75
|
+
classId: contractClass.id,
|
|
76
|
+
artifactHash: contractClass.artifactHash,
|
|
77
|
+
privateFunctionsRoot: contractClass.privateFunctionsRoot,
|
|
78
|
+
publicBytecodeCommitment: contractClass.publicBytecodeCommitment,
|
|
79
|
+
initializationHash,
|
|
80
|
+
privateFunctions: contractClass.privateFunctions
|
|
81
|
+
};
|
|
65
82
|
}
|
|
66
83
|
async function generateDeclarationFile(destName) {
|
|
67
84
|
const content = `
|
|
@@ -95,46 +112,68 @@ function generateContractAddresses(names) {
|
|
|
95
112
|
};
|
|
96
113
|
`;
|
|
97
114
|
}
|
|
98
|
-
function
|
|
115
|
+
function generateDerivedAddresses(names, contractData) {
|
|
99
116
|
return `
|
|
100
|
-
export const
|
|
101
|
-
${
|
|
117
|
+
export const ProtocolContractDerivedAddress = {
|
|
118
|
+
${contractData.map((d, i)=>`${names[i]}: AztecAddress.fromString('${d.address.toString()}')`).join(',\n')}
|
|
119
|
+
};
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
function generateClassIdPreimages(names, contractData) {
|
|
123
|
+
return `
|
|
124
|
+
export const ProtocolContractClassId: Record<ProtocolContractName, Fr> = {
|
|
125
|
+
${contractData.map((d, i)=>`${names[i]}: Fr.fromString('${d.classId.toString()}')`).join(',\n')}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export const ProtocolContractClassIdPreimage: Record<ProtocolContractName, { artifactHash: Fr; privateFunctionsRoot: Fr; publicBytecodeCommitment: Fr }> = {
|
|
129
|
+
${contractData.map((d, i)=>`${names[i]}: {
|
|
130
|
+
artifactHash: Fr.fromString('${d.artifactHash.toString()}'),
|
|
131
|
+
privateFunctionsRoot: Fr.fromString('${d.privateFunctionsRoot.toString()}'),
|
|
132
|
+
publicBytecodeCommitment: Fr.fromString('${d.publicBytecodeCommitment.toString()}'),
|
|
133
|
+
}`).join(',\n')}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const ProtocolContractInitializationHash: Record<ProtocolContractName, Fr> = {
|
|
137
|
+
${contractData.map((d, i)=>`${names[i]}: Fr.fromString('${d.initializationHash.toString()}')`).join(',\n')}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const ProtocolContractPrivateFunctions: Record<ProtocolContractName, { selector: FunctionSelector; vkHash: Fr }[]> = {
|
|
141
|
+
${contractData.map((d, i)=>`${names[i]}: [${d.privateFunctions.map((fn)=>`{ selector: FunctionSelector.fromField(Fr.fromString('${fn.selector.toField().toString()}')), vkHash: Fr.fromString('${fn.vkHash.toString()}') }`).join(', ')}]`).join(',\n')}
|
|
102
142
|
};
|
|
103
143
|
`;
|
|
104
144
|
}
|
|
105
|
-
async function
|
|
106
|
-
const
|
|
145
|
+
async function generateProtocolContractsList(names, contractData) {
|
|
146
|
+
const list = makeTuple(MAX_PROTOCOL_CONTRACTS, ()=>AztecAddress.zero());
|
|
147
|
+
for(let i = 0; i < names.length; i++){
|
|
148
|
+
const name = names[i];
|
|
149
|
+
const address = contractAddressMapping[name];
|
|
150
|
+
const derivedAddressIndex = address - 1;
|
|
151
|
+
if (!list[derivedAddressIndex].equals(AztecAddress.zero())) {
|
|
152
|
+
throw new Error(`Duplicate protocol contract address: ${address.toString()}`);
|
|
153
|
+
}
|
|
154
|
+
list[derivedAddressIndex] = contractData[i].address;
|
|
155
|
+
}
|
|
107
156
|
return `
|
|
108
|
-
export const
|
|
157
|
+
export const ProtocolContractsList = new ProtocolContracts([
|
|
158
|
+
${list.map((address)=>`AztecAddress.fromString('${address.toString()}')`).join(',\n')}
|
|
159
|
+
]);
|
|
160
|
+
|
|
161
|
+
export const protocolContractsHash = Fr.fromString('${(await new ProtocolContracts(list).hash()).toString()}');
|
|
109
162
|
`;
|
|
110
163
|
}
|
|
164
|
+
// Generate the siloed log tags for events emitted via private logs.
|
|
111
165
|
async function generateLogTags() {
|
|
112
|
-
// See silo_contract_class_log for all registerer tags
|
|
113
166
|
return `
|
|
114
|
-
export const
|
|
115
|
-
REGISTERER_CONTRACT_ADDRESS,
|
|
116
|
-
REGISTERER_CONTRACT_CLASS_REGISTERED_MAGIC_VALUE
|
|
117
|
-
])}');
|
|
118
|
-
export const REGISTERER_PRIVATE_FUNCTION_BROADCASTED_TAG = Fr.fromHexString('${await poseidon2Hash([
|
|
119
|
-
REGISTERER_CONTRACT_ADDRESS,
|
|
120
|
-
REGISTERER_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE
|
|
121
|
-
])}');
|
|
122
|
-
export const REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_TAG = Fr.fromHexString('${await poseidon2Hash([
|
|
123
|
-
REGISTERER_CONTRACT_ADDRESS,
|
|
124
|
-
REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_MAGIC_VALUE
|
|
125
|
-
])}');
|
|
126
|
-
export const DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_TAG = Fr.fromHexString('${await poseidon2Hash([
|
|
127
|
-
DEPLOYER_CONTRACT_ADDRESS,
|
|
128
|
-
DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE
|
|
129
|
-
])}');
|
|
130
|
-
export const DEPLOYER_CONTRACT_INSTANCE_UPDATED_TAG = new Fr(${DEPLOYER_CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE}n);
|
|
167
|
+
export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('${await computeSiloedPrivateLogFirstField(new AztecAddress(new Fr(CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS)), new Fr(CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE))}');
|
|
131
168
|
`;
|
|
132
169
|
}
|
|
133
|
-
async function generateOutputFile(names,
|
|
170
|
+
async function generateOutputFile(names, contractData) {
|
|
134
171
|
const content = `
|
|
135
172
|
// GENERATED FILE - DO NOT EDIT. RUN \`yarn generate\` or \`yarn generate:data\`
|
|
136
|
-
import { Fr } from '@aztec/foundation/
|
|
173
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
174
|
+
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
137
175
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
176
|
+
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
138
177
|
|
|
139
178
|
${generateNames(names)}
|
|
140
179
|
|
|
@@ -142,9 +181,11 @@ async function generateOutputFile(names, leaves) {
|
|
|
142
181
|
|
|
143
182
|
${generateContractAddresses(names)}
|
|
144
183
|
|
|
145
|
-
${
|
|
184
|
+
${generateDerivedAddresses(names, contractData)}
|
|
185
|
+
|
|
186
|
+
${generateClassIdPreimages(names, contractData)}
|
|
146
187
|
|
|
147
|
-
${await
|
|
188
|
+
${await generateProtocolContractsList(names, contractData)}
|
|
148
189
|
|
|
149
190
|
${await generateLogTags()}
|
|
150
191
|
`;
|
|
@@ -153,17 +194,16 @@ async function generateOutputFile(names, leaves) {
|
|
|
153
194
|
async function main() {
|
|
154
195
|
await clearDestDir();
|
|
155
196
|
const srcNames = JSON.parse(await fs.readFile(path.join(noirContractsRoot, 'protocol_contracts.json'), 'utf8'));
|
|
156
|
-
const
|
|
197
|
+
const contractDataList = [];
|
|
157
198
|
const destNames = srcNames.map((n)=>n.split('-')[1]);
|
|
158
199
|
for(let i = 0; i < srcNames.length; i++){
|
|
159
200
|
const srcName = srcNames[i];
|
|
160
201
|
const destName = destNames[i];
|
|
161
202
|
const artifact = await copyArtifact(srcName, destName);
|
|
162
203
|
await generateDeclarationFile(destName);
|
|
163
|
-
|
|
164
|
-
leaves.push(contractLeaf.toField());
|
|
204
|
+
contractDataList.push(await computeContractData(artifact, AztecAddress.fromBigInt(BigInt(contractAddressMapping[destName]))));
|
|
165
205
|
}
|
|
166
|
-
await generateOutputFile(destNames,
|
|
206
|
+
await generateOutputFile(destNames, contractDataList);
|
|
167
207
|
}
|
|
168
208
|
try {
|
|
169
209
|
await main();
|
package/dest/tests/fixtures.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function getSampleContractClassRegisteredEventPayload(): Buffer;
|
|
4
|
-
export declare function getSamplePrivateFunctionBroadcastedEventPayload(): Buffer;
|
|
5
|
-
export declare function getSampleUnconstrainedFunctionBroadcastedEventPayload(): Buffer;
|
|
6
|
-
export declare function getSampleContractInstanceDeployedEventPayload(): Buffer;
|
|
1
|
+
export declare function getSampleContractClassPublishedEventPayload(): Buffer;
|
|
2
|
+
export declare function getSampleContractInstancePublishedEventPayload(): Buffer;
|
|
7
3
|
export declare function getPathToFixture(name: string): string;
|
|
8
|
-
//# sourceMappingURL=
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZml4dHVyZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0cy9maXh0dXJlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLQSx3QkFBZ0IsMkNBQTJDLElBQUksTUFBTSxDQUdwRTtBQUdELHdCQUFnQiw4Q0FBOEMsSUFBSSxNQUFNLENBR3ZFO0FBRUQsd0JBQWdCLGdCQUFnQixDQUFDLElBQUksRUFBRSxNQUFNLFVBRTVDIn0=
|
|
@@ -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,8CAA8C,IAAI,MAAM,CAGvE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,UAE5C"}
|
package/dest/tests/fixtures.js
CHANGED
|
@@ -2,23 +2,13 @@ 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
|
|
10
|
-
export function
|
|
11
|
-
const path = getPathToFixture('
|
|
12
|
-
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
13
|
-
}
|
|
14
|
-
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
15
|
-
export function getSampleUnconstrainedFunctionBroadcastedEventPayload() {
|
|
16
|
-
const path = getPathToFixture('UnconstrainedFunctionBroadcastedEventData.hex');
|
|
17
|
-
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
18
|
-
}
|
|
19
|
-
// Generated from end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts with AZTEC_GENERATE_TEST_DATA=1
|
|
20
|
-
export function getSampleContractInstanceDeployedEventPayload() {
|
|
21
|
-
const path = getPathToFixture('ContractInstanceDeployedEventData.hex');
|
|
10
|
+
export function getSampleContractInstancePublishedEventPayload() {
|
|
11
|
+
const path = getPathToFixture('ContractInstancePublishedEventData.hex');
|
|
22
12
|
return Buffer.from(readFileSync(path).toString(), 'hex');
|
|
23
13
|
}
|
|
24
14
|
export function getPathToFixture(name) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@aztec/protocol-contracts",
|
|
3
3
|
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/protocol-contracts",
|
|
4
4
|
"description": "Canonical Noir contracts for the Aztec Network",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.1-commit.017a351",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dest/index.js",
|
|
@@ -14,23 +14,21 @@
|
|
|
14
14
|
"typedocOptions": {
|
|
15
15
|
"entryPoints": [
|
|
16
16
|
"./src/index.ts",
|
|
17
|
-
"./src/class-
|
|
18
|
-
"./src/instance-
|
|
17
|
+
"./src/class-registry/index.ts",
|
|
18
|
+
"./src/instance-registry/index.ts"
|
|
19
19
|
],
|
|
20
20
|
"name": "Protocol Contracts",
|
|
21
21
|
"tsconfig": "./tsconfig.json"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"build": "yarn clean && yarn generate && yarn generate:cleanup-artifacts && tsc
|
|
25
|
-
"build:keep-debug-symbols": "yarn clean && yarn generate && tsc
|
|
24
|
+
"build": "yarn clean && yarn generate && yarn generate:cleanup-artifacts && ../scripts/tsc.sh",
|
|
25
|
+
"build:keep-debug-symbols": "yarn clean && yarn generate && ../scripts/tsc.sh",
|
|
26
26
|
"generate": "yarn generate:data",
|
|
27
27
|
"generate:cleanup-artifacts": "node --no-warnings --loader @swc-node/register/esm src/scripts/cleanup_artifacts.ts",
|
|
28
28
|
"generate:data": "node --no-warnings --loader @swc-node/register/esm src/scripts/generate_data.ts",
|
|
29
|
-
"build:dev": "tsc
|
|
30
|
-
"build:ts": "tsc
|
|
29
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
30
|
+
"build:ts": "../scripts/tsc.sh",
|
|
31
31
|
"clean": "rm -rf ./dest .tsbuildinfo ./artifacts",
|
|
32
|
-
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
|
|
33
|
-
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
34
32
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
35
33
|
},
|
|
36
34
|
"inherits": [
|
|
@@ -68,27 +66,32 @@
|
|
|
68
66
|
"testTimeout": 120000,
|
|
69
67
|
"setupFiles": [
|
|
70
68
|
"../../foundation/src/jest/setup.mjs"
|
|
69
|
+
],
|
|
70
|
+
"testEnvironment": "../../foundation/src/jest/env.mjs",
|
|
71
|
+
"setupFilesAfterEnv": [
|
|
72
|
+
"../../foundation/src/jest/setupAfterEnv.mjs"
|
|
71
73
|
]
|
|
72
74
|
},
|
|
73
75
|
"dependencies": {
|
|
74
|
-
"@aztec/constants": "0.0.
|
|
75
|
-
"@aztec/foundation": "0.0.
|
|
76
|
-
"@aztec/stdlib": "0.0.
|
|
76
|
+
"@aztec/constants": "0.0.1-commit.017a351",
|
|
77
|
+
"@aztec/foundation": "0.0.1-commit.017a351",
|
|
78
|
+
"@aztec/stdlib": "0.0.1-commit.017a351",
|
|
77
79
|
"lodash.chunk": "^4.2.0",
|
|
78
80
|
"lodash.omit": "^4.5.0",
|
|
79
81
|
"tslib": "^2.4.0"
|
|
80
82
|
},
|
|
81
83
|
"devDependencies": {
|
|
82
|
-
"@jest/globals": "^
|
|
83
|
-
"@types/jest": "^
|
|
84
|
+
"@jest/globals": "^30.0.0",
|
|
85
|
+
"@types/jest": "^30.0.0",
|
|
84
86
|
"@types/lodash.chunk": "^4.2.9",
|
|
85
87
|
"@types/lodash.omit": "^4.5.9",
|
|
86
|
-
"@types/node": "^
|
|
87
|
-
"
|
|
88
|
-
"jest
|
|
89
|
-
"
|
|
88
|
+
"@types/node": "^22.15.17",
|
|
89
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
90
|
+
"jest": "^30.0.0",
|
|
91
|
+
"jest-mock-extended": "^4.0.0",
|
|
92
|
+
"ts-loader": "^9.5.4",
|
|
90
93
|
"ts-node": "^10.9.1",
|
|
91
|
-
"typescript": "^5.
|
|
94
|
+
"typescript": "^5.3.3"
|
|
92
95
|
},
|
|
93
96
|
"files": [
|
|
94
97
|
"dest",
|
|
@@ -98,6 +101,6 @@
|
|
|
98
101
|
"!src/scripts/*"
|
|
99
102
|
],
|
|
100
103
|
"engines": {
|
|
101
|
-
"node": ">=
|
|
104
|
+
"node": ">=20.10"
|
|
102
105
|
}
|
|
103
106
|
}
|