Skip to content

Commit 93169a8

Browse files
committed
chore: update multichain interfaces (#1433)
**Motivation:** Small typos in multi chain interfaces. Also, we use absolute imports, which can cause integration difficulties. **Modifications:** Fix typos. Use relative imports. **Result:** Cleaner interfaces.
1 parent d6173ff commit 93169a8

7 files changed

+30
-39
lines changed

src/contracts/interfaces/IBN254CertificateVerifier.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.27;
33

4-
import "src/contracts/libraries/OperatorSetLib.sol";
5-
import "src/contracts/interfaces/ICrossChainRegistry.sol";
6-
import "src/contracts/interfaces/IBaseCertificateVerifier.sol";
7-
import "src/contracts/interfaces/IBN254TableCalculator.sol";
4+
import {BN254} from "../libraries/BN254.sol";
5+
import {OperatorSet} from "../libraries/OperatorSetLib.sol";
6+
import "./IBN254TableCalculator.sol";
7+
import "./IBaseCertificateVerifier.sol";
88

99
interface IBN254CertificateVerifierTypes is IBN254TableCalculatorTypes {
1010
/**
@@ -42,7 +42,7 @@ interface IBN254CertificateVerifierEvents is IBN254CertificateVerifierTypes {
4242
}
4343

4444
/// @notice An interface for verifying BN254 certificates
45-
/// @notice This implements a base interface that all curve certificate verifiers (eg. BN254, ECDSA) must implement
45+
/// @notice This implements the base `IBaseCertificateVerifier` interface
4646
interface IBN254CertificateVerifier is IBN254CertificateVerifierEvents, IBaseCertificateVerifier {
4747
/**
4848
* @notice updates the operator table

src/contracts/interfaces/IBN254TableCalculator.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.27;
33

4-
import "src/contracts/libraries/BN254.sol";
5-
import "src/contracts/libraries/OperatorSetLib.sol";
4+
import {BN254} from "../libraries/BN254.sol";
5+
import {OperatorSet} from "../libraries/OperatorSetLib.sol";
66

77
interface IBN254TableCalculatorTypes {
88
/**

src/contracts/interfaces/IBaseCertificateVerifier.sol

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.27;
33

4-
import "src/contracts/libraries/OperatorSetLib.sol";
5-
import "src/contracts/interfaces/ICrossChainRegistry.sol";
4+
import "./ICrossChainRegistry.sol";
5+
import {OperatorSet} from "../libraries/OperatorSetLib.sol";
66

7-
interface IBaseCertificateVerifierTypes is ICrossChainRegistryTypes {
8-
// TODO: use the `KeyType` from `KeyRegistrar`
9-
/**
10-
* @notice The type of key used by the operatorSet. An OperatorSet can
11-
* only generate one Operator Table for an OperatorSet for a given OperatorKeyType.
12-
*/
13-
enum OperatorKeyType {
14-
ECDSA,
15-
BN254
16-
}
17-
}
18-
19-
interface IBaseCertificateVerifierEvents is IBaseCertificateVerifierTypes {
7+
interface IBaseCertificateVerifierEvents {
208
/// @notice Emitted when the owner of an operatorSet is updated
219
event OperatorSetOwnerUpdated(OperatorSet operatorSet, address owner);
2210

@@ -41,8 +29,12 @@ interface IBaseCertificateVerifierErrors {
4129

4230
/// @notice A base interface that verifies certificates for a given operatorSet
4331
/// @notice This is a base interface that all curve certificate verifiers (eg. BN254, ECDSA) must implement
44-
/// @dev A single `CertificateVerifier` can be used for ONLY 1 operatorSet
45-
interface IBaseCertificateVerifier is IBaseCertificateVerifierEvents, IBaseCertificateVerifierErrors {
32+
/// @dev A single `CertificateVerifier` can be used for multiple operatorSets, but a single key type
33+
interface IBaseCertificateVerifier is
34+
IBaseCertificateVerifierEvents,
35+
IBaseCertificateVerifierErrors,
36+
ICrossChainRegistryTypes
37+
{
4638
/// @notice the address of the owner of the OperatorSet
4739
function getOperatorSetOwner(
4840
OperatorSet memory operatorSet

src/contracts/interfaces/ICrossChainRegistry.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.27;
33

4-
import "src/contracts/libraries/OperatorSetLib.sol";
4+
import {OperatorSet} from "../libraries/OperatorSetLib.sol";
55

66
interface IOperatorTableCalculator {
77
// TODO: implement, stub for now
@@ -91,7 +91,7 @@ interface ICrossChainRegistry is ICrossChainRegistryErrors, ICrossChainRegistryT
9191
/**
9292
* @notice Adds a chainID to the whitelist of chainIDs that can be transported to
9393
* @param chainID the chainID to add to the whitelist
94-
* @dev msg.sender must be UAM permissioned for operatorSet.avs
94+
* @dev msg.sender must be the owner of the CrossChainRegistry
9595
*/
9696
function addChainIDToWhitelist(
9797
uint32 chainID
@@ -100,7 +100,7 @@ interface ICrossChainRegistry is ICrossChainRegistryErrors, ICrossChainRegistryT
100100
/**
101101
* @notice Removes a chainID from the whitelist of chainIDs that can be transported to
102102
* @param chainID the chainID to remove from the whitelist
103-
* @dev msg.sender must be UAM permissioned for operatorSet.avs
103+
* @dev msg.sender must be the owner of the CrossChainRegistry
104104
*/
105105
function removeChainIDFromWhitelist(
106106
uint32 chainID

src/contracts/interfaces/IECDSACertificateVerifier.sol

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.27;
33

4-
import "src/contracts/libraries/OperatorSetLib.sol";
5-
import "src/contracts/interfaces/ICrossChainRegistry.sol";
6-
import "src/contracts/interfaces/IBaseCertificateVerifier.sol";
7-
import "src/contracts/interfaces/IECDSATableCalculator.sol";
4+
import {OperatorSet} from "../libraries/OperatorSetLib.sol";
5+
import "./IBaseCertificateVerifier.sol";
6+
import "./IECDSATableCalculator.sol";
87

98
interface IECDSACertificateVerifierTypes is IECDSATableCalculatorTypes {
109
/**
@@ -26,7 +25,7 @@ interface IECDSACertificateVerifierEvents is IECDSACertificateVerifierTypes {
2625
}
2726

2827
/// @notice An interface for verifying ECDSA certificates
29-
/// @notice This implements a base interface that all curve certificate verifiers (eg. BN254, ECDSA) must implement
28+
/// @notice This implements the base `IBaseCertificateVerifier` interface
3029
interface IECDSACertificateVerifier is IECDSACertificateVerifierEvents, IBaseCertificateVerifier {
3130
/**
3231
* @notice updates the operator table

src/contracts/interfaces/IECDSATableCalculator.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.27;
33

4-
import "src/contracts/libraries/OperatorSetLib.sol";
4+
import {OperatorSet} from "../libraries/OperatorSetLib.sol";
55

66
interface IECDSATableCalculatorTypes {
77
/**

src/contracts/interfaces/IOperatorTableUpdater.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.27;
33

4-
import "src/contracts/libraries/OperatorSetLib.sol";
4+
import {OperatorSet} from "../libraries/OperatorSetLib.sol";
55

6-
import "src/contracts/interfaces/IECDSATableCalculator.sol";
7-
import "src/contracts/interfaces/IBN254TableCalculator.sol";
8-
import "src/contracts/interfaces/IECDSACertificateVerifier.sol";
9-
import "src/contracts/interfaces/IBN254CertificateVerifier.sol";
10-
import "src/contracts/interfaces/ICrossChainRegistry.sol";
6+
import "./IECDSATableCalculator.sol";
7+
import "./IBN254TableCalculator.sol";
8+
import "./IECDSACertificateVerifier.sol";
9+
import "./IBN254CertificateVerifier.sol";
10+
import "./ICrossChainRegistry.sol";
1111

1212
interface IOperatorTableUpdaterErrors {
1313
/// @notice Thrown when the GlobalTableRoot update fails

0 commit comments

Comments
 (0)