@@ -13,18 +13,18 @@ import "./libraries/external/ReentrancyGuardUpgradeable.sol";
13
13
import "./libraries/TransceiverStructs.sol " ;
14
14
import "./libraries/TransceiverHelpers.sol " ;
15
15
import "./libraries/RateLimiter.sol " ;
16
- import "./interfaces/IManager .sol " ;
17
- import "./interfaces/IManagerEvents .sol " ;
16
+ import "./interfaces/INttManager .sol " ;
17
+ import "./interfaces/INttManagerEvents .sol " ;
18
18
import "./interfaces/INTTToken.sol " ;
19
19
import "./interfaces/ITransceiver.sol " ;
20
20
import "./TransceiverRegistry.sol " ;
21
21
import "./NttNormalizer.sol " ;
22
22
import "./libraries/PausableOwnable.sol " ;
23
23
import "./libraries/Implementation.sol " ;
24
24
25
- contract Manager is
26
- IManager ,
27
- IManagerEvents ,
25
+ contract NttManager is
26
+ INttManager ,
27
+ INttManagerEvents ,
28
28
TransceiverRegistry ,
29
29
RateLimiter ,
30
30
NttNormalizer ,
@@ -36,9 +36,9 @@ contract Manager is
36
36
using SafeERC20 for IERC20 ;
37
37
38
38
error RefundFailed (uint256 refundAmount );
39
- error CannotRenounceManagerOwnership (address owner );
39
+ error CannotRenounceNttManagerOwnership (address owner );
40
40
error UnexpectedOwner (address expectedOwner , address owner );
41
- error TransceiverAlreadyAttestedToMessage (bytes32 managerMessageHash );
41
+ error TransceiverAlreadyAttestedToMessage (bytes32 nttManagerMessageHash );
42
42
43
43
address public immutable token;
44
44
address immutable deployer;
@@ -188,7 +188,7 @@ contract Manager is
188
188
deployer = msg .sender ;
189
189
}
190
190
191
- function __Manager_init () internal onlyInitializing {
191
+ function __NttManager_init () internal onlyInitializing {
192
192
// check if the owner is the deployer of this contract
193
193
if (msg .sender != deployer) {
194
194
revert UnexpectedOwner (deployer, msg .sender );
@@ -198,7 +198,7 @@ contract Manager is
198
198
}
199
199
200
200
function _initialize () internal virtual override {
201
- __Manager_init ();
201
+ __NttManager_init ();
202
202
_checkThresholdInvariants ();
203
203
_checkTransceiversInvariants ();
204
204
}
@@ -213,7 +213,7 @@ contract Manager is
213
213
_upgrade (newImplementation);
214
214
}
215
215
216
- /// @dev Transfer ownership of the Manager contract and all Transceiver contracts to a new owner.
216
+ /// @dev Transfer ownership of the NttManager contract and all Transceiver contracts to a new owner.
217
217
function transferOwnership (address newOwner ) public override onlyOwner {
218
218
super .transferOwnership (newOwner);
219
219
// loop through all the registered transceivers and set the new owner of each transceiver to the newOwner
@@ -253,18 +253,18 @@ contract Manager is
253
253
uint256 [] memory priceQuotes ,
254
254
TransceiverStructs.TransceiverInstruction[] memory transceiverInstructions ,
255
255
address [] memory enabledTransceivers ,
256
- bytes memory managerMessage
256
+ bytes memory nttManagerMessage
257
257
) internal {
258
258
uint256 numEnabledTransceivers = enabledTransceivers.length ;
259
259
mapping (address => TransceiverInfo) storage transceiverInfos = _getTransceiverInfosStorage ();
260
260
// call into transceiver contracts to send the message
261
261
for (uint256 i = 0 ; i < numEnabledTransceivers; i++ ) {
262
262
address transceiverAddr = enabledTransceivers[i];
263
- // send it to the recipient manager based on the chain
263
+ // send it to the recipient nttManager based on the chain
264
264
ITransceiver (transceiverAddr).sendMessage {value: priceQuotes[i]}(
265
265
recipientChain,
266
266
transceiverInstructions[transceiverInfos[transceiverAddr].index],
267
- managerMessage ,
267
+ nttManagerMessage ,
268
268
getSibling (recipientChain)
269
269
);
270
270
}
@@ -554,16 +554,16 @@ contract Manager is
554
554
amount, toWormholeFormat (token), recipient, recipientChain
555
555
);
556
556
557
- // construct the ManagerMessage payload
558
- bytes memory encodedManagerPayload = TransceiverStructs.encodeManagerMessage (
559
- TransceiverStructs.ManagerMessage (
557
+ // construct the NttManagerMessage payload
558
+ bytes memory encodedNttManagerPayload = TransceiverStructs.encodeNttManagerMessage (
559
+ TransceiverStructs.NttManagerMessage (
560
560
seq, toWormholeFormat (sender), TransceiverStructs.encodeNativeTokenTransfer (ntt)
561
561
)
562
562
);
563
563
564
564
// send the message
565
565
_sendMessageToTransceivers (
566
- recipientChain, priceQuotes, instructions, enabledTransceivers, encodedManagerPayload
566
+ recipientChain, priceQuotes, instructions, enabledTransceivers, encodedNttManagerPayload
567
567
);
568
568
569
569
emit TransferSent (recipient, _nttDenormalize (amount), recipientChain, seq);
@@ -594,16 +594,16 @@ contract Manager is
594
594
}
595
595
596
596
/// @dev Called after a message has been sufficiently verified to execute the command in the message.
597
- /// This function will decode the payload as an ManagerMessage to extract the sequence, msgType, and other parameters.
597
+ /// This function will decode the payload as an NttManagerMessage to extract the sequence, msgType, and other parameters.
598
598
function executeMsg (
599
599
uint16 sourceChainId ,
600
- bytes32 sourceManagerAddress ,
601
- TransceiverStructs.ManagerMessage memory message
600
+ bytes32 sourceNttManagerAddress ,
601
+ TransceiverStructs.NttManagerMessage memory message
602
602
) public {
603
603
// verify chain has not forked
604
604
checkFork (evmChainId);
605
605
606
- bytes32 digest = TransceiverStructs.managerMessageDigest (sourceChainId, message);
606
+ bytes32 digest = TransceiverStructs.nttManagerMessageDigest (sourceChainId, message);
607
607
608
608
if (! isMessageApproved (digest)) {
609
609
revert MessageNotApproved (digest);
@@ -614,7 +614,7 @@ contract Manager is
614
614
// end execution early to mitigate the possibility of race conditions from transceivers
615
615
// attempting to deliver the same message when (threshold < number of transceiver messages)
616
616
// notify client (off-chain process) so they don't attempt redundant msg delivery
617
- emit MessageAlreadyExecuted (sourceManagerAddress , digest);
617
+ emit MessageAlreadyExecuted (sourceNttManagerAddress , digest);
618
618
return ;
619
619
}
620
620
@@ -719,7 +719,7 @@ contract Manager is
719
719
}
720
720
721
721
/// @notice this sets the corresponding sibling.
722
- /// @dev The manager that executes the message sets the source manager as the sibling.
722
+ /// @dev The nttManager that executes the message sets the source nttManager as the sibling.
723
723
function setSibling (uint16 siblingChainId , bytes32 siblingContract ) public onlyOwner {
724
724
if (siblingChainId == 0 ) {
725
725
revert InvalidSiblingChainIdZero ();
@@ -742,28 +742,29 @@ contract Manager is
742
742
743
743
function attestationReceived (
744
744
uint16 sourceChainId ,
745
- bytes32 sourceManagerAddress ,
746
- TransceiverStructs.ManagerMessage memory payload
745
+ bytes32 sourceNttManagerAddress ,
746
+ TransceiverStructs.NttManagerMessage memory payload
747
747
) external onlyTransceiver {
748
- _verifySibling (sourceChainId, sourceManagerAddress );
748
+ _verifySibling (sourceChainId, sourceNttManagerAddress );
749
749
750
- bytes32 managerMessageHash = TransceiverStructs.managerMessageDigest (sourceChainId, payload);
750
+ bytes32 nttManagerMessageHash =
751
+ TransceiverStructs.nttManagerMessageDigest (sourceChainId, payload);
751
752
752
753
// set the attested flag for this transceiver.
753
754
// NOTE: Attestation is idempotent (bitwise or 1), but we revert
754
755
// anyway to ensure that the client does not continue to initiate calls
755
756
// to receive the same message through the same transceiver.
756
757
if (
757
758
transceiverAttestedToMessage (
758
- managerMessageHash , _getTransceiverInfosStorage ()[msg .sender ].index
759
+ nttManagerMessageHash , _getTransceiverInfosStorage ()[msg .sender ].index
759
760
)
760
761
) {
761
- revert TransceiverAlreadyAttestedToMessage (managerMessageHash );
762
+ revert TransceiverAlreadyAttestedToMessage (nttManagerMessageHash );
762
763
}
763
- _setTransceiverAttestedToMessage (managerMessageHash , msg .sender );
764
+ _setTransceiverAttestedToMessage (nttManagerMessageHash , msg .sender );
764
765
765
- if (isMessageApproved (managerMessageHash )) {
766
- executeMsg (sourceChainId, sourceManagerAddress , payload);
766
+ if (isMessageApproved (nttManagerMessageHash )) {
767
+ executeMsg (sourceChainId, sourceNttManagerAddress , payload);
767
768
}
768
769
}
769
770
@@ -772,7 +773,7 @@ contract Manager is
772
773
return countSetBits (_getMessageAttestations (digest));
773
774
}
774
775
775
- function tokenDecimals () public view override (IManager , RateLimiter) returns (uint8 ) {
776
+ function tokenDecimals () public view override (INttManager , RateLimiter) returns (uint8 ) {
776
777
return tokenDecimals_;
777
778
}
778
779
0 commit comments