Skip to content

Commit 66b8597

Browse files
author
Rahul Maganti
committed
evm: add natspec to transceiver registry
1 parent b51c12a commit 66b8597

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

evm/src/NttManager/TransceiverRegistry.sol

+28-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
// SPDX-License-Identifier: Apache 2
22
pragma solidity >=0.8.8 <0.9.0;
33

4-
/// @dev This contract is responsible for handling the registration of Transceivers.
4+
/// @notice This contract is responsible for handling the registration of Transceivers.
5+
/// edev This contract a few critical invariants hold when transceivers are added or removed,
6+
/// including:
7+
/// 1. if a transceiver is not registered, it should be enabled.
8+
/// 2. The value set in the bitmap of trannsceivers
9+
/// should directly correspond to the whether the transceiver is enabled
510
abstract contract TransceiverRegistry {
611
constructor() {
712
_checkTransceiversInvariants();
@@ -33,11 +38,33 @@ abstract contract TransceiverRegistry {
3338

3439
uint8 constant MAX_TRANSCEIVERS = 64;
3540

41+
/// @notice Error when the caller is not the transceiver.
42+
/// @dev Selector 0xa0ae911d.
43+
/// @param caller The address of the caller.
3644
error CallerNotTransceiver(address caller);
45+
46+
/// @notice Error when the transceiver is the zero address.
47+
/// @dev Selector 0x2f44bd77.
3748
error InvalidTransceiverZeroAddress();
49+
50+
/// @notice Error when the transceiver is disabled.
51+
/// @dev Selector 0x1f61ba44.
3852
error DisabledTransceiver(address transceiver);
53+
54+
/// @notice Error when the number of registered transceivers
55+
/// exceeeds (MAX_TRANSCEIVERS = 64).
56+
/// @dev Selector 0x891684c3.
3957
error TooManyTransceivers();
58+
59+
/// @notice Error when attempting to remove a transceiver
60+
/// that is not registered.
61+
/// @dev Selector 0xd583f470.
62+
/// @param transceiver The address of the transceiver.
4063
error NonRegisteredTransceiver(address transceiver);
64+
65+
/// @notice Error when attempting to enable a transceiver that is already enabled.
66+
/// @dev Selector 0x8d68f84d.
67+
/// @param transceiver The address of the transceiver.
4168
error TransceiverAlreadyEnabled(address transceiver);
4269

4370
modifier onlyTransceiver() {

0 commit comments

Comments
 (0)