@aztec/protocol-contracts 0.40.1 → 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.
- package/dest/artifacts/ContractClassRegisterer.json +1 -1
- package/dest/artifacts/ContractInstanceDeployer.json +1 -1
- package/dest/artifacts/GasToken.json +1 -1
- package/dest/artifacts/KeyRegistry.json +1 -1
- package/dest/artifacts/MultiCallEntrypoint.json +1 -1
- package/dest/gas-token/index.d.ts +5 -3
- package/dest/gas-token/index.d.ts.map +1 -1
- package/dest/gas-token/index.js +10 -6
- package/dest/instance-deployer/index.js +2 -2
- package/package.json +4 -4
- package/src/artifacts/ContractClassRegisterer.json +1 -1
- package/src/artifacts/ContractInstanceDeployer.json +1 -1
- package/src/artifacts/GasToken.json +1 -1
- package/src/artifacts/KeyRegistry.json +1 -1
- package/src/artifacts/MultiCallEntrypoint.json +1 -1
- package/src/gas-token/index.ts +12 -6
- package/src/instance-deployer/index.ts +1 -1
package/src/gas-token/index.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import {
|
|
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(
|
|
8
|
-
|
|
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
|
|
12
|
-
|
|
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()})
|
|
11
|
+
`Incorrect address for contract deployer (got ${contract.address.toString()} but expected ${InstanceDeployerAddress.toString()}).`,
|
|
12
12
|
);
|
|
13
13
|
}
|
|
14
14
|
return contract;
|