Skip to content

Commit

Permalink
check message before sending
Browse files Browse the repository at this point in the history
Signed-off-by: bennett <bennett@umaproject.org>
  • Loading branch information
bmzig committed Sep 26, 2024
1 parent f914722 commit 427fd1c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contracts/chain-adapters/Rerouter_Adapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ contract Rerouter_Adapter is AdapterInterface {
* @dev The message passed into this function is wrapped into a `relayMessage` function call, which is then passed
* to L2. The l2Target contract implements AdapterInterface, so upon arrival on L2, the arguments to the L2 contract's
* `relayMessage` call will be these target and message values.
* @dev Since the message is either meant to be executed by the L3 spoke pool or the L2 forwarder, an extra uint8 is
* attached to `message` to specify the number of layer hops `message` must make before execution.
*/
function relayMessage(address target, bytes memory message) external payable override {
// Check whether the message is malformed.
abi.decode(message, (uint8, bytes));
bytes memory updatedMessage = abi.encodeCall(AdapterInterface.relayMessage, (target, message));
(bool success, ) = l1Adapter.delegatecall(
abi.encodeCall(AdapterInterface.relayMessage, (l2Target, updatedMessage))
Expand Down

0 comments on commit 427fd1c

Please sign in to comment.