@aztec/protocol-contracts 4.0.0-devnet.1-patch.0 → 4.0.0-devnet.2-patch.0

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.
@@ -9,7 +9,8 @@ import { ProtocolContractAddress, ProtocolContractSalt } from './protocol_contra
9
9
  // TODO(@spalladino): This computes the contract class from the artifact twice.
10
10
  const contractClass = await getContractClassFromArtifact(artifact);
11
11
  const instance = await getContractInstanceFromInstantiationParams(artifact, {
12
- salt
12
+ salt,
13
+ deployer: address
13
14
  });
14
15
  return {
15
16
  instance: {
@@ -27,25 +27,25 @@ export const ProtocolContractAddress = {
27
27
  PublicChecks: AztecAddress.fromBigInt(6n)
28
28
  };
29
29
  export const ProtocolContractDerivedAddress = {
30
- AuthRegistry: AztecAddress.fromString('0x00c052aa878325ba78fac127c40ae563511318e9e6948263e379a03d5f1e4a6e'),
31
- ContractInstanceRegistry: AztecAddress.fromString('0x0a01e1e37be489d537634dad2c3acebe6b0ede4179e6a1a890c67335fdd355d6'),
32
- ContractClassRegistry: AztecAddress.fromString('0x25c9135da27c45f28e911a6f6840cd13b5cb7e37dac4e0955d16f32cf71b54e4'),
33
- MultiCallEntrypoint: AztecAddress.fromString('0x25a2606e5b0475329de902e1c02d8cd6b127b075495fa98f4ed2401a18c0e601'),
34
- FeeJuice: AztecAddress.fromString('0x163da85a17e1762dff0020832656ece3d2f89ac74fcc6572dda8c9492510c0c2'),
35
- PublicChecks: AztecAddress.fromString('0x2e1a5de981901564e30ec6268592dcf39e0b4c6bea131c079c9ce4fb52e9f181')
30
+ AuthRegistry: AztecAddress.fromString('0x139f8eb6d6e7e7a7c0322c3b7558687a7e24201f11bf2c4cb2fe56c18d363695'),
31
+ ContractInstanceRegistry: AztecAddress.fromString('0x1254246c88aca5a66fa66f3aa78c408a698ebca3b713120497c7555dfc718592'),
32
+ ContractClassRegistry: AztecAddress.fromString('0x14d670efa326a07b99777b01fb706427ca776095246569150f2a3f17a7d4dc66'),
33
+ MultiCallEntrypoint: AztecAddress.fromString('0x230d0b47ba6d5ed99afb89d584f32ff33438b64f51000f252a140cf995781628'),
34
+ FeeJuice: AztecAddress.fromString('0x204913186c0dd70015d05bf9100a12e31ccb7cc2527aacdfae0c19ad6439fcf4'),
35
+ PublicChecks: AztecAddress.fromString('0x1198142fd84a58c0ab22d5fde371ce527042db49487e05206a326ad154952ac8')
36
36
  };
37
37
  export const ProtocolContractsList = new ProtocolContracts([
38
- AztecAddress.fromString('0x00c052aa878325ba78fac127c40ae563511318e9e6948263e379a03d5f1e4a6e'),
39
- AztecAddress.fromString('0x0a01e1e37be489d537634dad2c3acebe6b0ede4179e6a1a890c67335fdd355d6'),
40
- AztecAddress.fromString('0x25c9135da27c45f28e911a6f6840cd13b5cb7e37dac4e0955d16f32cf71b54e4'),
41
- AztecAddress.fromString('0x25a2606e5b0475329de902e1c02d8cd6b127b075495fa98f4ed2401a18c0e601'),
42
- AztecAddress.fromString('0x163da85a17e1762dff0020832656ece3d2f89ac74fcc6572dda8c9492510c0c2'),
43
- AztecAddress.fromString('0x2e1a5de981901564e30ec6268592dcf39e0b4c6bea131c079c9ce4fb52e9f181'),
38
+ AztecAddress.fromString('0x139f8eb6d6e7e7a7c0322c3b7558687a7e24201f11bf2c4cb2fe56c18d363695'),
39
+ AztecAddress.fromString('0x1254246c88aca5a66fa66f3aa78c408a698ebca3b713120497c7555dfc718592'),
40
+ AztecAddress.fromString('0x14d670efa326a07b99777b01fb706427ca776095246569150f2a3f17a7d4dc66'),
41
+ AztecAddress.fromString('0x230d0b47ba6d5ed99afb89d584f32ff33438b64f51000f252a140cf995781628'),
42
+ AztecAddress.fromString('0x204913186c0dd70015d05bf9100a12e31ccb7cc2527aacdfae0c19ad6439fcf4'),
43
+ AztecAddress.fromString('0x1198142fd84a58c0ab22d5fde371ce527042db49487e05206a326ad154952ac8'),
44
44
  AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
45
45
  AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
46
46
  AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
47
47
  AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
48
48
  AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
49
49
  ]);
50
- export const protocolContractsHash = Fr.fromString('0x23a47d6104763aa9ddd35ee7a23720b7188749ab61ad5e2d941b11bec4204a2d');
50
+ export const protocolContractsHash = Fr.fromString('0x2672340d9a0107a7b81e6d10d25b854debe613f3272e8738e8df0ca2ff297141');
51
51
  export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('0x1a7e1badb79abdd38c684b3c8306ffe7ecb33c69e3380d9855730aaaa83a21a8');
@@ -1,11 +1,11 @@
1
- import { CANONICAL_AUTH_REGISTRY_ADDRESS, CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS, CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE, CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS, FEE_JUICE_ADDRESS, GeneratorIndex, MAX_PROTOCOL_CONTRACTS, MULTI_CALL_ENTRYPOINT_ADDRESS, PUBLIC_CHECKS_ADDRESS } from '@aztec/constants';
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, PUBLIC_CHECKS_ADDRESS } from '@aztec/constants';
2
2
  import { makeTuple } from '@aztec/foundation/array';
3
- import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
4
3
  import { Fr } from '@aztec/foundation/curves/bn254';
5
4
  import { createConsoleLogger } from '@aztec/foundation/log';
6
5
  import { loadContractArtifact } from '@aztec/stdlib/abi';
7
6
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
8
7
  import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
8
+ import { computeSiloedPrivateLogFirstField } from '@aztec/stdlib/hash';
9
9
  import { ProtocolContracts } from '@aztec/stdlib/tx';
10
10
  import { promises as fs } from 'fs';
11
11
  import path from 'path';
@@ -50,9 +50,10 @@ async function copyArtifact(srcName, destName) {
50
50
  await fs.copyFile(src, dest);
51
51
  return artifact;
52
52
  }
53
- async function computeAddress(artifact) {
53
+ async function computeAddress(artifact, deployer) {
54
54
  const instance = await getContractInstanceFromInstantiationParams(loadContractArtifact(artifact), {
55
- salt
55
+ salt,
56
+ deployer
56
57
  });
57
58
  return instance.address;
58
59
  }
@@ -117,10 +118,7 @@ async function generateProtocolContractsList(names, derivedAddresses) {
117
118
  // Generate the siloed log tags for events emitted via private logs.
118
119
  async function generateLogTags() {
119
120
  return `
120
- export const CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG = Fr.fromHexString('${await poseidon2HashWithSeparator([
121
- CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS,
122
- CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE
123
- ], GeneratorIndex.PRIVATE_LOG_FIRST_FIELD)}');
121
+ 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))}');
124
122
  `;
125
123
  }
126
124
  async function generateOutputFile(names, derivedAddresses) {
@@ -154,7 +152,7 @@ async function main() {
154
152
  const destName = destNames[i];
155
153
  const artifact = await copyArtifact(srcName, destName);
156
154
  await generateDeclarationFile(destName);
157
- derivedAddresses.push(await computeAddress(artifact));
155
+ derivedAddresses.push(await computeAddress(artifact, AztecAddress.fromBigInt(contractAddressMapping[destName])));
158
156
  }
159
157
  await generateOutputFile(destNames, derivedAddresses);
160
158
  }
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": "4.0.0-devnet.1-patch.0",
5
+ "version": "4.0.0-devnet.2-patch.0",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": "./dest/index.js",
@@ -73,9 +73,9 @@
73
73
  ]
74
74
  },
75
75
  "dependencies": {
76
- "@aztec/constants": "4.0.0-devnet.1-patch.0",
77
- "@aztec/foundation": "4.0.0-devnet.1-patch.0",
78
- "@aztec/stdlib": "4.0.0-devnet.1-patch.0",
76
+ "@aztec/constants": "4.0.0-devnet.2-patch.0",
77
+ "@aztec/foundation": "4.0.0-devnet.2-patch.0",
78
+ "@aztec/stdlib": "4.0.0-devnet.2-patch.0",
79
79
  "lodash.chunk": "^4.2.0",
80
80
  "lodash.omit": "^4.5.0",
81
81
  "tslib": "^2.4.0"
@@ -16,7 +16,7 @@ export async function makeProtocolContract(
16
16
  const salt = ProtocolContractSalt[name];
17
17
  // TODO(@spalladino): This computes the contract class from the artifact twice.
18
18
  const contractClass = await getContractClassFromArtifact(artifact);
19
- const instance = await getContractInstanceFromInstantiationParams(artifact, { salt });
19
+ const instance = await getContractInstanceFromInstantiationParams(artifact, { salt, deployer: address });
20
20
  return {
21
21
  instance: { ...instance, address },
22
22
  contractClass,
@@ -41,23 +41,23 @@ PublicChecks: AztecAddress.fromBigInt(6n)
41
41
 
42
42
 
43
43
  export const ProtocolContractDerivedAddress = {
44
- AuthRegistry: AztecAddress.fromString('0x00c052aa878325ba78fac127c40ae563511318e9e6948263e379a03d5f1e4a6e'),
45
- ContractInstanceRegistry: AztecAddress.fromString('0x0a01e1e37be489d537634dad2c3acebe6b0ede4179e6a1a890c67335fdd355d6'),
46
- ContractClassRegistry: AztecAddress.fromString('0x25c9135da27c45f28e911a6f6840cd13b5cb7e37dac4e0955d16f32cf71b54e4'),
47
- MultiCallEntrypoint: AztecAddress.fromString('0x25a2606e5b0475329de902e1c02d8cd6b127b075495fa98f4ed2401a18c0e601'),
48
- FeeJuice: AztecAddress.fromString('0x163da85a17e1762dff0020832656ece3d2f89ac74fcc6572dda8c9492510c0c2'),
49
- PublicChecks: AztecAddress.fromString('0x2e1a5de981901564e30ec6268592dcf39e0b4c6bea131c079c9ce4fb52e9f181')
44
+ AuthRegistry: AztecAddress.fromString('0x139f8eb6d6e7e7a7c0322c3b7558687a7e24201f11bf2c4cb2fe56c18d363695'),
45
+ ContractInstanceRegistry: AztecAddress.fromString('0x1254246c88aca5a66fa66f3aa78c408a698ebca3b713120497c7555dfc718592'),
46
+ ContractClassRegistry: AztecAddress.fromString('0x14d670efa326a07b99777b01fb706427ca776095246569150f2a3f17a7d4dc66'),
47
+ MultiCallEntrypoint: AztecAddress.fromString('0x230d0b47ba6d5ed99afb89d584f32ff33438b64f51000f252a140cf995781628'),
48
+ FeeJuice: AztecAddress.fromString('0x204913186c0dd70015d05bf9100a12e31ccb7cc2527aacdfae0c19ad6439fcf4'),
49
+ PublicChecks: AztecAddress.fromString('0x1198142fd84a58c0ab22d5fde371ce527042db49487e05206a326ad154952ac8')
50
50
  };
51
51
 
52
52
 
53
53
 
54
54
  export const ProtocolContractsList = new ProtocolContracts([
55
- AztecAddress.fromString('0x00c052aa878325ba78fac127c40ae563511318e9e6948263e379a03d5f1e4a6e'),
56
- AztecAddress.fromString('0x0a01e1e37be489d537634dad2c3acebe6b0ede4179e6a1a890c67335fdd355d6'),
57
- AztecAddress.fromString('0x25c9135da27c45f28e911a6f6840cd13b5cb7e37dac4e0955d16f32cf71b54e4'),
58
- AztecAddress.fromString('0x25a2606e5b0475329de902e1c02d8cd6b127b075495fa98f4ed2401a18c0e601'),
59
- AztecAddress.fromString('0x163da85a17e1762dff0020832656ece3d2f89ac74fcc6572dda8c9492510c0c2'),
60
- AztecAddress.fromString('0x2e1a5de981901564e30ec6268592dcf39e0b4c6bea131c079c9ce4fb52e9f181'),
55
+ AztecAddress.fromString('0x139f8eb6d6e7e7a7c0322c3b7558687a7e24201f11bf2c4cb2fe56c18d363695'),
56
+ AztecAddress.fromString('0x1254246c88aca5a66fa66f3aa78c408a698ebca3b713120497c7555dfc718592'),
57
+ AztecAddress.fromString('0x14d670efa326a07b99777b01fb706427ca776095246569150f2a3f17a7d4dc66'),
58
+ AztecAddress.fromString('0x230d0b47ba6d5ed99afb89d584f32ff33438b64f51000f252a140cf995781628'),
59
+ AztecAddress.fromString('0x204913186c0dd70015d05bf9100a12e31ccb7cc2527aacdfae0c19ad6439fcf4'),
60
+ AztecAddress.fromString('0x1198142fd84a58c0ab22d5fde371ce527042db49487e05206a326ad154952ac8'),
61
61
  AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
62
62
  AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
63
63
  AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000'),
@@ -65,7 +65,7 @@ AztecAddress.fromString('0x00000000000000000000000000000000000000000000000000000
65
65
  AztecAddress.fromString('0x0000000000000000000000000000000000000000000000000000000000000000')
66
66
  ]);
67
67
 
68
- export const protocolContractsHash = Fr.fromString('0x23a47d6104763aa9ddd35ee7a23720b7188749ab61ad5e2d941b11bec4204a2d');
68
+ export const protocolContractsHash = Fr.fromString('0x2672340d9a0107a7b81e6d10d25b854debe613f3272e8738e8df0ca2ff297141');
69
69
 
70
70
 
71
71