|
@@ -20,10 +20,12 @@ library SignatureChecker {
|
|
|
* change through time. It could return true at block N and false at block N+1 (or the opposite).
|
|
|
*/
|
|
|
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);
|
|
|
+ if (signer.code.length == 0) {
|
|
|
+ (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);
|
|
|
+ return err == ECDSA.RecoverError.NoError && recovered == signer;
|
|
|
+ } else {
|
|
|
+ return isValidERC1271SignatureNow(signer, hash, signature);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|