From 365d2ab5a8641f31a201ec4e9ff3846b3b2e3273 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 4 Sep 2023 19:01:50 +0530 Subject: [PATCH] fix: move up exec params check --- contracts/socket/SocketDst.sol | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/contracts/socket/SocketDst.sol b/contracts/socket/SocketDst.sol index a84852b3..9671a750 100644 --- a/contracts/socket/SocketDst.sol +++ b/contracts/socket/SocketDst.sol @@ -206,6 +206,12 @@ abstract contract SocketDst is SocketBase { .isExecutor(packedMessage, executionDetails_.signature); if (!isValidExecutor) revert NotExecutor(); + // finally make sure executor params were respected by the executor + executionManager__.verifyParams( + messageDetails_.executionParams, + msg.value + ); + // verify message was part of the packet and // authenticated by respective switchboard _verify( @@ -215,8 +221,7 @@ abstract contract SocketDst is SocketBase { packedMessage, packetRoot, plugConfig, - executionDetails_.decapacitorProof, - messageDetails_.executionParams + executionDetails_.decapacitorProof ); // execute message @@ -240,8 +245,7 @@ abstract contract SocketDst is SocketBase { bytes32 packedMessage_, bytes32 packetRoot_, PlugConfig memory plugConfig_, - bytes memory decapacitorProof_, - bytes32 executionParams_ + bytes memory decapacitorProof_ ) internal { // NOTE: is the the first un-trusted call in the system, another one is Plug.inbound if ( @@ -263,9 +267,6 @@ abstract contract SocketDst is SocketBase { decapacitorProof_ ) ) revert InvalidProof(); - - // finally make sure executor params were respected by the executor - executionManager__.verifyParams(executionParams_, msg.value); } /**