Skip to content

Commit edbe319

Browse files
committed
clearer override of variables
1 parent 93d099b commit edbe319

2 files changed

Lines changed: 23 additions & 14 deletions

File tree

src/protocol/IMessageRelayer.sol

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ interface IMessageRelayer {
4040
/// needed).
4141
/// @param to Address to send the ETH to
4242
/// @param tip Tip to send to the tip recipient
43-
/// @param tipRecipient Address that will receive the tip
43+
/// @param userSelectedTipRecipient User selected address that will receive the tip
4444
/// @param gasLimit Gas limit to use when forwarding the message
4545
/// @param data Data to send to the recipient
46-
function receiveMessage(address to, uint256 tip, address tipRecipient, uint256 gasLimit, bytes memory data)
47-
external
48-
payable;
46+
function receiveMessage(
47+
address to,
48+
uint256 tip,
49+
address userSelectedTipRecipient,
50+
uint256 gasLimit,
51+
bytes memory data
52+
) external payable;
4953
}

src/protocol/taiko_alethia/MessageRelayer.sol

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ import {MessageRelayer} from "src/protocol/taiko_alethia/MessageRelayer.sol";
3737
/// )
3838
///
3939
/// To relay the message:
40-
// 1. Anyone is allowed to call relayMessage however the tip recipient is determined the two following cases:
41-
// a) If no tip recipient is specified in the ETHDeposit message the one in temporary storage will be used
42-
// b) If a tip recipient is specified in the ETHDeposit message it will be used
43-
// It is up to the relayer to decide whether it is worth to relay this message or not (decided if they control the
44-
// tipRecipient address or not)
40+
/// 1. Anyone is allowed to call `relayMessage` however the tip recipient is determined by one of the two following
41+
/// cases:
42+
/// a) If no tip recipient is specified in the ETHDeposit message the one in temporary storage will be used
43+
/// b) If a tip recipient is specified in the ETHDeposit message it will be used
44+
/// It is up to the relayer to decide whether it is worth to relay this message or not (decided if they control the
45+
/// tipRecipient address or not)
4546
/// 2. This will call claimDeposit on the ETHBridge
4647
/// 3. If the original message was specified correctly, this will call receiveMessage on this contract
4748
/// 4. This will call the message recipient and send the tip to the tip recipient
@@ -79,11 +80,15 @@ contract MessageRelayer is ReentrancyGuardTransient, IMessageRelayer {
7980
}
8081

8182
/// @inheritdoc IMessageRelayer
82-
function receiveMessage(address to, uint256 tip, address tipRecipient, uint256 gasLimit, bytes memory data)
83-
external
84-
payable
85-
nonReentrant
86-
{
83+
function receiveMessage(
84+
address to,
85+
uint256 tip,
86+
address userSelectedTipRecipient,
87+
uint256 gasLimit,
88+
bytes memory data
89+
) external payable nonReentrant {
90+
address tipRecipient = userSelectedTipRecipient;
91+
8792
// If none specified use the one in temporary storage
8893
if (tipRecipient == address(0)) {
8994
tipRecipient = TIP_RECIPIENT_SLOT.asAddress().tload();

0 commit comments

Comments
 (0)