Skip to content

Commit

Permalink
evm: update _prepareNativeTokenTransfer params
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-gray committed Oct 18, 2024
1 parent 63b6031 commit 5d6ca4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions evm/src/NttManager/NttManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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, ""
Expand Down
4 changes: 2 additions & 2 deletions evm/test/mocks/MockNttManagerAdditionalPayload.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5d6ca4d

Please sign in to comment.