From e6f1761c2a42b7a94f91b5b29c207b8ad31a71fe Mon Sep 17 00:00:00 2001 From: jimjimvalkema Date: Thu, 26 Sep 2024 23:11:10 +0200 Subject: [PATCH] added xDomainMessageSender to the-scroll-messenger.mdx xDomainMessageSender wasnt documented before but is essential in bridging cross chain messages safely. It is also used in the eth and erc20 gateways. --- .../l1-and-l2-bridging/the-scroll-messenger.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/content/docs/en/developers/l1-and-l2-bridging/the-scroll-messenger.mdx b/src/content/docs/en/developers/l1-and-l2-bridging/the-scroll-messenger.mdx index d18efb80..ea3ad231 100644 --- a/src/content/docs/en/developers/l1-and-l2-bridging/the-scroll-messenger.mdx +++ b/src/content/docs/en/developers/l1-and-l2-bridging/the-scroll-messenger.mdx @@ -146,3 +146,12 @@ Relay a L2 => L1 message with message proof. | nonce | The nonce of the message to avoid replay attack. | | message | The content of the message. | | proof | The proof used to verify the correctness of the transaction. | + +### xDomainMessageSender +`xDomainMessageSender` contains the address of the `msg.sender` that called `sendMessage` on the other chain. +```solidity +address public override xDomainMessageSender; +``` +Note: `xDomainMessageSender` resets after the `relayMessageWithProof` function ends. +Make sure that only the `scrollMessenger` contract can call functions that use `xDomainMessageSender`. +See the [scroll contracts](/developers/scroll-contracts/#advanced-bridge-contracts) page to see the scrollMessenger contract addresses.