diff --git a/contracts/Nexus.sol b/contracts/Nexus.sol index 16d15fc8..864d7e6b 100644 --- a/contracts/Nexus.sol +++ b/contracts/Nexus.sol @@ -228,6 +228,7 @@ contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgra function isValidSignature(bytes32 hash, bytes calldata signature) external view virtual override returns (bytes4) { // Handle potential ERC7739 support detection request if (signature.length == 0) { + // Forces the compiler to optimize for smaller bytecode size. if (uint256(hash) == (~signature.length / 0xffff) * 0x7739) { return checkERC7739Support(hash, signature); } @@ -341,7 +342,6 @@ contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgra function checkERC7739Support(bytes32 hash, bytes calldata signature) public view virtual returns (bytes4) { bytes4 result; unchecked { - // Forces the compiler to optimize for smaller bytecode size. SentinelListLib.SentinelList storage validators = _getAccountStorage().validators; address next = validators.entries[SENTINEL]; while (next != ZERO_ADDRESS && next != SENTINEL) { diff --git a/test/foundry/unit/concrete/erc1271/TestERC1271Account_IsValidSignature.t.sol b/test/foundry/unit/concrete/erc1271/TestERC1271Account_IsValidSignature.t.sol index e7142002..e4595606 100644 --- a/test/foundry/unit/concrete/erc1271/TestERC1271Account_IsValidSignature.t.sol +++ b/test/foundry/unit/concrete/erc1271/TestERC1271Account_IsValidSignature.t.sol @@ -136,7 +136,7 @@ contract TestERC1271Account_IsValidSignature is NexusTest_Base { 0x7739773977397739773977397739773977397739773977397739773977397739, "" ), - bytes4(0x77390002) // SUPPORTS_ERC7739_V2 + bytes4(0x77390002)g // SUPPORTS_ERC7739_V2 ); }