Skip to content

Commit 5564175

Browse files
author
Rahul Maganti
committed
evm: add natspec to transceiver registry
1 parent 41d5e30 commit 5564175

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

evm/src/NttManager/TransceiverRegistry.sol

+30-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
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+
/// @title TransceiverRegistry
5+
/// @author Wormhole Project Contributors.
6+
/// @notice This contract is responsible for handling the registration of Transceivers.
7+
/// edev This contract a few critical invariants hold when transceivers are added or removed,
8+
/// including:
9+
/// 1. if a transceiver is not registered, it should be enabled.
10+
/// 2. The value set in the bitmap of trannsceivers
11+
/// should directly correspond to the whether the transceiver is enabled
512
abstract contract TransceiverRegistry {
613
constructor() {
714
_checkTransceiversInvariants();
@@ -33,11 +40,33 @@ abstract contract TransceiverRegistry {
3340

3441
uint8 constant MAX_TRANSCEIVERS = 64;
3542

43+
/// @notice Error when the caller is not the transceiver.
44+
/// @dev Selector 0xa0ae911d.
45+
/// @param caller The address of the caller.
3646
error CallerNotTransceiver(address caller);
47+
48+
/// @notice Error when the transceiver is the zero address.
49+
/// @dev Selector 0x2f44bd77.
3750
error InvalidTransceiverZeroAddress();
51+
52+
/// @notice Error when the transceiver is disabled.
53+
/// @dev Selector 0x1f61ba44.
3854
error DisabledTransceiver(address transceiver);
55+
56+
/// @notice Error when the number of registered transceivers
57+
/// exceeeds (MAX_TRANSCEIVERS = 64).
58+
/// @dev Selector 0x891684c3.
3959
error TooManyTransceivers();
60+
61+
/// @notice Error when attempting to remove a transceiver
62+
/// that is not registered.
63+
/// @dev Selector 0xd583f470.
64+
/// @param transceiver The address of the transceiver.
4065
error NonRegisteredTransceiver(address transceiver);
66+
67+
/// @notice Error when attempting to enable a transceiver that is already enabled.
68+
/// @dev Selector 0x8d68f84d.
69+
/// @param transceiver The address of the transceiver.
4170
error TransceiverAlreadyEnabled(address transceiver);
4271

4372
modifier onlyTransceiver() {

0 commit comments

Comments
 (0)