From e96289529f77e4aa2302acefbca63a2005127ee3 Mon Sep 17 00:00:00 2001 From: zeroknots Date: Fri, 29 Mar 2024 11:59:05 +0700 Subject: [PATCH] fix: bug in validator module call in safe7579 --- accounts/safe7579/src/SafeERC7579.sol | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/accounts/safe7579/src/SafeERC7579.sol b/accounts/safe7579/src/SafeERC7579.sol index 03945dd4..4b6bbb5a 100644 --- a/accounts/safe7579/src/SafeERC7579.sol +++ b/accounts/safe7579/src/SafeERC7579.sol @@ -133,7 +133,13 @@ contract SafeERC7579 is ISafeOp, IERC7579Account, AccessControl, IMSA, HookManag if (!_isValidatorInstalled(validator)) return _validateSignatures(userOp); // bubble up the return value of the validator module - validSignature = IValidator(validator).validateUserOp(userOp, userOpHash); + bytes memory retData = _executeReturnData({ + safe: msg.sender, + target: validator, + value: 0, + callData: abi.encodeCall(IValidator.validateUserOp, (userOp, userOpHash)) + }); + validSignature = abi.decode(retData, (uint256)); // pay prefund if (missingAccountFunds != 0) {