From 5d6ca4dabcf268814ffaabe740d9edc3351a545e Mon Sep 17 00:00:00 2001 From: Evan Gray Date: Thu, 17 Oct 2024 13:12:10 -0400 Subject: [PATCH] evm: update _prepareNativeTokenTransfer params --- evm/src/NttManager/NttManager.sol | 11 ++++++----- evm/test/mocks/MockNttManagerAdditionalPayload.sol | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/evm/src/NttManager/NttManager.sol b/evm/src/NttManager/NttManager.sol index 9a5eec74d..7ac021b91 100644 --- a/evm/src/NttManager/NttManager.sol +++ b/evm/src/NttManager/NttManager.sol @@ -540,8 +540,9 @@ contract NttManager is INttManager, RateLimiter, ManagerBase { // push it on the stack again to avoid a stack too deep error uint64 seq = sequence; - TransceiverStructs.NativeTokenTransfer memory ntt = - _prepareNativeTokenTransfer(amount, token, recipient, recipientChain, seq, sender); + TransceiverStructs.NativeTokenTransfer memory ntt = _prepareNativeTokenTransfer( + amount, recipient, recipientChain, seq, sender, refundAddress + ); // construct the NttManagerMessage payload bytes memory encodedNttManagerPayload = TransceiverStructs.encodeNttManagerMessage( @@ -589,20 +590,20 @@ contract NttManager is INttManager, RateLimiter, ManagerBase { /// @dev Override this function to provide an additional payload on the NativeTokenTransfer /// For integrator flexibility, this function is *not* marked pure or view /// @param amount TrimmedAmount of the transfer - /// @param token Address of the token that this NTT Manager is tied to /// @param recipient The recipient address /// @param recipientChain The Wormhole chain ID for the destination /// @param - The sequence number for the manager message (unused, provided for overriding integrators) /// @param - The sender of the funds (unused, provided for overriding integrators). If releasing + /// @param - The address on the destination chain to which the refund of unused gas will be paid /// queued transfers, when rate limiting is used, then this value could be different from msg.sender. /// @return - The TransceiverStructs.NativeTokenTransfer struct function _prepareNativeTokenTransfer( TrimmedAmount amount, - address token, bytes32 recipient, uint16 recipientChain, uint64, // sequence - address // sender + address, // sender + bytes32 // refundAddress ) internal virtual returns (TransceiverStructs.NativeTokenTransfer memory) { return TransceiverStructs.NativeTokenTransfer( amount, toWormholeFormat(token), recipient, recipientChain, "" diff --git a/evm/test/mocks/MockNttManagerAdditionalPayload.sol b/evm/test/mocks/MockNttManagerAdditionalPayload.sol index 4d88040bb..a313c3d86 100644 --- a/evm/test/mocks/MockNttManagerAdditionalPayload.sol +++ b/evm/test/mocks/MockNttManagerAdditionalPayload.sol @@ -16,11 +16,11 @@ contract MockNttManagerAdditionalPayloadContract is NttManagerNoRateLimiting { function _prepareNativeTokenTransfer( TrimmedAmount amount, - address token, bytes32 recipient, uint16 recipientChain, uint64, // sequence - address // sender + address, // sender + bytes32 // refundAddress ) internal override returns (TransceiverStructs.NativeTokenTransfer memory) { bytes memory additionalPayload = abi.encodePacked("banana"); emit AdditionalPayloadSent(additionalPayload);