From 5bb10dc383dd050ddf9443fdf9f7c194ccc2c805 Mon Sep 17 00:00:00 2001 From: cristovaoth Date: Thu, 28 Sep 2023 05:34:52 +0200 Subject: [PATCH] Move moduleOnly only to more straigthforward shape --- contracts/core/Modifier.sol | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/contracts/core/Modifier.sol b/contracts/core/Modifier.sol index aa2b963c..7b5a6c1b 100644 --- a/contracts/core/Modifier.sol +++ b/contracts/core/Modifier.sol @@ -74,15 +74,10 @@ abstract contract Modifier is Module, IAvatar, EIP712Signature { */ modifier moduleOnly() { - bool wasSent = modules[msg.sender] != address(0); - bool wasSigned = !wasSent && modules[eip712SignedBy()] != address(0); - bool isAuthorized = wasSent || wasSigned; - - if (!isAuthorized) { - revert NotAuthorized(msg.sender); - } - - if (wasSigned) { + if (modules[msg.sender] == address(0)) { + if (modules[eip712SignedBy()] == address(0)) { + revert NotAuthorized(msg.sender); + } eip712BumpNonce(); }