@@ -27,6 +27,11 @@ abstract contract TransceiverRegistryBase {
27
27
uint8 enabled;
28
28
}
29
29
30
+ /// @notice Error when attempting to enable an transceiver that is already enabled.
31
+ /// @dev Selector: TODO.
32
+ /// @param transceiver The address of the transceiver.
33
+ error TransceiverAlreadyEnabled (address transceiver );
34
+
30
35
uint8 public constant MAX_TRANSCEIVERS = 64 ;
31
36
32
37
bytes32 internal constant TRANSCEIVER_INFOS_SLOT =
@@ -197,11 +202,6 @@ abstract contract TransceiverRegistry is TransceiverRegistryBase {
197
202
/// @param transceiver The address of the transceiver.
198
203
error NonRegisteredTransceiver (address transceiver );
199
204
200
- /// @notice Error when attempting to enable a transceiver that is already enabled.
201
- /// @dev Selector 0x8d68f84d.
202
- /// @param transceiver The address of the transceiver.
203
- error TransceiverAlreadyEnabled (address transceiver );
204
-
205
205
/// @notice Error when attempting to use an incorrect chain.
206
206
/// @dev Selector: 0x587c94c3.
207
207
/// @param chain The id of the incorrect chain.
@@ -237,7 +237,7 @@ abstract contract TransceiverRegistry is TransceiverRegistryBase {
237
237
_checkDelegateCallRevert (success, returnData);
238
238
}
239
239
240
- function _enableSendTransceiverForChain (uint16 chain , address transceiver ) internal {
240
+ function enableSendTransceiverForChain (uint16 chain , address transceiver ) public {
241
241
(bool success , bytes memory returnData ) = _admin.delegatecall (
242
242
abi.encodeWithSelector (
243
243
TransceiverRegistryAdmin._enableSendTransceiverForChain.selector , chain, transceiver
@@ -246,7 +246,7 @@ abstract contract TransceiverRegistry is TransceiverRegistryBase {
246
246
_checkDelegateCallRevert (success, returnData);
247
247
}
248
248
249
- function _disableSendTransceiverForChain (uint16 chain , address transceiver ) internal {
249
+ function disableSendTransceiverForChain (uint16 chain , address transceiver ) public {
250
250
(bool success , bytes memory returnData ) = _admin.delegatecall (
251
251
abi.encodeWithSelector (
252
252
TransceiverRegistryAdmin._disableSendTransceiverForChain.selector ,
@@ -257,7 +257,7 @@ abstract contract TransceiverRegistry is TransceiverRegistryBase {
257
257
_checkDelegateCallRevert (success, returnData);
258
258
}
259
259
260
- function _enableRecvTransceiverForChain (uint16 chain , address transceiver ) internal {
260
+ function enableRecvTransceiverForChain (uint16 chain , address transceiver ) public {
261
261
(bool success , bytes memory returnData ) = _admin.delegatecall (
262
262
abi.encodeWithSelector (
263
263
TransceiverRegistryAdmin._enableRecvTransceiverForChain.selector , chain, transceiver
@@ -266,10 +266,12 @@ abstract contract TransceiverRegistry is TransceiverRegistryBase {
266
266
_checkDelegateCallRevert (success, returnData);
267
267
}
268
268
269
- function _disableRecvTransceiverForChain (uint16 chain , address transceiver ) internal {
269
+ function disableRecvTransceiverForChain (uint16 chain , address transceiver ) public {
270
270
(bool success , bytes memory returnData ) = _admin.delegatecall (
271
271
abi.encodeWithSelector (
272
- TransceiverRegistryAdmin._enableRecvTransceiverForChain.selector , chain, transceiver
272
+ TransceiverRegistryAdmin._disableRecvTransceiverForChain.selector ,
273
+ chain,
274
+ transceiver
273
275
)
274
276
);
275
277
_checkDelegateCallRevert (success, returnData);
@@ -395,11 +397,6 @@ contract TransceiverRegistryAdmin is TransceiverRegistryBase {
395
397
/// @param transceiver The address of the transceiver.
396
398
event RecvTransceiverDisabledForChain (uint16 chain , address transceiver );
397
399
398
- /// @notice Error when attempting to enable an transceiver that is already enabled.
399
- /// @dev Selector: TODO.
400
- /// @param transceiver The address of the transceiver.
401
- error TransceiverAlreadyEnabled (address transceiver );
402
-
403
400
/// @notice Error when the transceiver is the zero address.
404
401
/// @dev Selector: TODO.
405
402
error InvalidTransceiverZeroAddress ();
@@ -455,7 +452,7 @@ contract TransceiverRegistryAdmin is TransceiverRegistryBase {
455
452
_enabledTransceiverBitmap.bitmap | uint64 (1 << transceiverInfos[transceiver].index);
456
453
// ensure that this actually changed the bitmap
457
454
if (updatedEnabledTransceiverBitmap == _enabledTransceiverBitmap.bitmap) {
458
- revert TransceiverRegistry. TransceiverAlreadyEnabled (transceiver);
455
+ revert TransceiverAlreadyEnabled (transceiver);
459
456
}
460
457
_enabledTransceiverBitmap.bitmap = updatedEnabledTransceiverBitmap;
461
458
0 commit comments