From cf704147936341680f4ae9ebf02d42dc6d8dee7c Mon Sep 17 00:00:00 2001 From: Auryn Macmillan Date: Mon, 17 Jul 2023 10:53:43 +1000 Subject: [PATCH 1/3] fix: incorrect typecast to zero bytes --- contracts/core/Module.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/core/Module.sol b/contracts/core/Module.sol index 2bad41ec..c53c6255 100644 --- a/contracts/core/Module.sol +++ b/contracts/core/Module.sol @@ -60,7 +60,7 @@ abstract contract Module is FactoryFriendly, Guardable { 0, address(0), payable(0), - bytes("0x"), + bytes(""), msg.sender ); success = IAvatar(target).execTransactionFromModule( @@ -69,7 +69,7 @@ abstract contract Module is FactoryFriendly, Guardable { data, operation ); - IGuard(currentGuard).checkAfterExecution(bytes32("0x"), success); + IGuard(currentGuard).checkAfterExecution(bytes32(""), success); } else { success = IAvatar(target).execTransactionFromModule( to, @@ -107,7 +107,7 @@ abstract contract Module is FactoryFriendly, Guardable { 0, address(0), payable(0), - bytes("0x"), + bytes(""), msg.sender ); (success, returnData) = IAvatar(target) @@ -117,7 +117,7 @@ abstract contract Module is FactoryFriendly, Guardable { data, operation ); - IGuard(currentGuard).checkAfterExecution(bytes32("0x"), success); + IGuard(currentGuard).checkAfterExecution(bytes32(""), success); } else { (success, returnData) = IAvatar(target) .execTransactionFromModuleReturnData( From e5c85329e496358b2700cfac38149d843e4a8dc6 Mon Sep 17 00:00:00 2001 From: Auryn Macmillan Date: Wed, 19 Jul 2023 10:40:24 +1000 Subject: [PATCH 2/3] use `new bytes(0)` --- contracts/core/Module.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/core/Module.sol b/contracts/core/Module.sol index c53c6255..fb3c6ad9 100644 --- a/contracts/core/Module.sol +++ b/contracts/core/Module.sol @@ -60,7 +60,7 @@ abstract contract Module is FactoryFriendly, Guardable { 0, address(0), payable(0), - bytes(""), + new bytes(0), msg.sender ); success = IAvatar(target).execTransactionFromModule( @@ -107,7 +107,7 @@ abstract contract Module is FactoryFriendly, Guardable { 0, address(0), payable(0), - bytes(""), + new bytes(0), msg.sender ); (success, returnData) = IAvatar(target) From 0a646b19021f08529497bc37fab5277757e822ed Mon Sep 17 00:00:00 2001 From: Auryn Macmillan Date: Wed, 19 Jul 2023 21:07:07 +1000 Subject: [PATCH 3/3] use "" for empty bytes --- contracts/core/Module.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/core/Module.sol b/contracts/core/Module.sol index fb3c6ad9..2aa21a6e 100644 --- a/contracts/core/Module.sol +++ b/contracts/core/Module.sol @@ -60,7 +60,7 @@ abstract contract Module is FactoryFriendly, Guardable { 0, address(0), payable(0), - new bytes(0), + "", msg.sender ); success = IAvatar(target).execTransactionFromModule( @@ -107,7 +107,7 @@ abstract contract Module is FactoryFriendly, Guardable { 0, address(0), payable(0), - new bytes(0), + "", msg.sender ); (success, returnData) = IAvatar(target)