From 21b9371d592e61ca8d5af3cd1a0186eaf4de1989 Mon Sep 17 00:00:00 2001 From: Vectorized Date: Wed, 18 Dec 2024 00:53:24 +0000 Subject: [PATCH] Fix misplacement of selector in LibERC7579 --- src/accounts/LibERC7579.sol | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/accounts/LibERC7579.sol b/src/accounts/LibERC7579.sol index 3cd986e50b..5eef4ea2aa 100644 --- a/src/accounts/LibERC7579.sol +++ b/src/accounts/LibERC7579.sol @@ -45,8 +45,7 @@ library LibERC7579 { assembly { mstore(0x00, callType) mstore(0x01, execType) - mstore(0x02, selector) - mstore(0x06, 0) + mstore(0x06, selector) mstore(0x0a, payload) result := mload(0x00) } @@ -64,7 +63,7 @@ library LibERC7579 { /// @dev Returns the selector of the mode. function getSelector(bytes32 mode) internal pure returns (bytes4) { - return bytes4(bytes32(uint256(mode) << 16)); + return bytes4(bytes32(uint256(mode) << 48)); } /// @dev Returns the payload stored in the mode.