Skip to content

Commit

Permalink
Update SignatureChecker.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx authored Jan 6, 2023
1 parent 8a78453 commit a0bda75
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions contracts/utils/cryptography/SignatureChecker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ library SignatureChecker {
*/
function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {
(address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature);

return (error == ECDSA.RecoverError.NoError && recovered == signer)
|| isValidERC1271SignatureNow(signer,hash,signature);
return (error == ECDSA.RecoverError.NoError && recovered == signer) ||
isValidERC1271SignatureNow(signer,hash,signature);
}


Expand All @@ -44,7 +43,6 @@ library SignatureChecker {
(bool success, bytes memory result) = signer.staticcall(
abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature)
);

return (success &&
result.length == 32 &&
abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));
Expand Down

0 comments on commit a0bda75

Please sign in to comment.