Skip to content

Commit 8f539ee

Browse files
authored
evm: Fix minor issues from PR#4 (#15)
1 parent 04afa0f commit 8f539ee

File tree

6 files changed

+12
-29
lines changed

6 files changed

+12
-29
lines changed

evm/src/NttManager/ManagerBase.sol

+4-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ abstract contract ManagerBase is
218218
function transferOwnership(
219219
address newOwner
220220
) public override onlyOwner {
221-
// TODO: Just delete this function and let the Ownable one be called directly?
221+
// It's intentional (at this time) that we are not transferring the endpoint admin.
222+
// The endpoint functions are all called by the NttManager, which means the admin
223+
// must remain the NttManager.
222224
super.transferOwnership(newOwner);
223225
}
224226

@@ -354,6 +356,7 @@ abstract contract ManagerBase is
354356
assert(this.mode() == mode);
355357
assert(this.chainId() == chainId);
356358
assert(this.endpoint() == endpoint);
359+
assert(this.executor() == executor);
357360
}
358361

359362
function _checkThresholdInvariants() internal view {

evm/src/NttManager/NttManager.sol

+3-2
Original file line numberDiff line numberDiff line change
@@ -656,12 +656,13 @@ contract NttManager is INttManager, RateLimiter, ManagerBase {
656656
args.amount.untrim(tokenDecimals()),
657657
args.epTotalPriceQuote,
658658
args.recipientChain,
659-
args.sequence,
660-
payloadHash
659+
args.sequence
661660
);
662661

663662
uint128 gasLimit = peerData.gasLimit;
664663
if (gasLimit == 0) {
664+
// The gas limit can only be zero when a contract has been migrated from an older version,
665+
// where the gasLimit was not defined in the manager peer struct and was not set during the upgrade.
665666
revert InvalidGasLimitZero(args.recipientChain);
666667
}
667668

evm/src/interfaces/INttManager.sol

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface INttManager is IManagerBase {
1818

1919
/// @notice Emitted when a message is sent from the nttManager.
2020
/// @dev Topic0
21-
/// 0x75eb8927cc7c4810b30fa2e8011fce37da6da7d18eb82c642c367ae4445c3625.
21+
/// 0xe54e51e42099622516fa3b48e9733581c9dbdcb771cafb093f745a0532a35982.
2222
/// @param recipient The recipient of the message.
2323
/// @param refundAddress The address on the destination chain to which the
2424
/// refund of unused gas will be paid
@@ -32,8 +32,7 @@ interface INttManager is IManagerBase {
3232
uint256 amount,
3333
uint256 fee,
3434
uint16 recipientChain,
35-
uint64 msgSequence,
36-
bytes32 msgHash
35+
uint64 msgSequence
3736
);
3837

3938
/// @notice Emitted when a message is sent from the nttManager.

evm/src/libraries/TransceiverHelpers.sol

-12
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,3 @@ function countSetBits(
3232

3333
return count;
3434
}
35-
36-
// @dev Count the number of set bits in a uint128
37-
function countSetBits128(
38-
uint128 x
39-
) pure returns (uint8 count) {
40-
while (x != 0) {
41-
x &= x - 1;
42-
count++;
43-
}
44-
45-
return count;
46-
}

evm/test/interfaces/ITransceiverReceiver.sol

-8
This file was deleted.

evm/test/libraries/TransceiverHelpers.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@ library TransceiverHelpersLib {
206206
for (uint256 idx = 0; idx < events.length; ++idx) {
207207
if (
208208
events[idx].topics[0]
209-
== bytes32(0x75eb8927cc7c4810b30fa2e8011fce37da6da7d18eb82c642c367ae4445c3625)
209+
== bytes32(0xe54e51e42099622516fa3b48e9733581c9dbdcb771cafb093f745a0532a35982)
210210
&& events[idx].emitter == nttManager
211211
) {
212-
(,,, uint64 sequence,) =
213-
abi.decode(events[idx].data, (uint256, uint256, uint16, uint64, bytes32));
212+
(,,, uint64 sequence) =
213+
abi.decode(events[idx].data, (uint256, uint256, uint16, uint64));
214214

215215
if (sequence == nttSeqNo) {
216216
// The next event in the log should be from the executor

0 commit comments

Comments
 (0)