@aztec/protocol-contracts 0.41.0 → 0.42.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.
@@ -1,13 +1,19 @@
1
- import { type AztecAddress, type EthAddress } from '@aztec/circuits.js';
1
+ import { AztecAddress, GAS_TOKEN_ADDRESS } from '@aztec/circuits.js';
2
2
 
3
3
  import { type ProtocolContract, getCanonicalProtocolContract } from '../protocol_contract.js';
4
4
  import { GasTokenArtifact } from './artifact.js';
5
5
 
6
6
  /** Returns the canonical deployment of the gas token. */
7
- export function getCanonicalGasToken(l1Bridge: EthAddress): ProtocolContract {
8
- return getCanonicalProtocolContract(GasTokenArtifact, 1, [l1Bridge]);
7
+ export function getCanonicalGasToken(): ProtocolContract {
8
+ const contract = getCanonicalProtocolContract(GasTokenArtifact, 1);
9
+ if (!contract.address.equals(GasTokenAddress)) {
10
+ throw new Error(
11
+ `Incorrect address for gas token (got ${contract.address.toString()} but expected ${GasTokenAddress.toString()}).`,
12
+ );
13
+ }
14
+ return contract;
9
15
  }
10
16
 
11
- export function getCanonicalGasTokenAddress(l1Bridge: EthAddress): AztecAddress {
12
- return getCanonicalGasToken(l1Bridge).address;
13
- }
17
+ export const GasTokenAddress = AztecAddress.fromBigInt(GAS_TOKEN_ADDRESS);
18
+
19
+ export { GasTokenArtifact };
@@ -8,7 +8,7 @@ export function getCanonicalInstanceDeployer(): ProtocolContract {
8
8
  const contract = getCanonicalProtocolContract(ContractInstanceDeployerArtifact, 1);
9
9
  if (!contract.address.equals(InstanceDeployerAddress)) {
10
10
  throw new Error(
11
- `Incorrect address for contract deployer (got ${contract.address.toString()} but expected ${InstanceDeployerAddress.toString()}). Check DEPLOYER_CONTRACT_ADDRESS is set to the correct value in the constants files and run the protocol-contracts package tests.`,
11
+ `Incorrect address for contract deployer (got ${contract.address.toString()} but expected ${InstanceDeployerAddress.toString()}).`,
12
12
  );
13
13
  }
14
14
  return contract;