@@ -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