Remove redundant ECDSA constraint (#3591)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com> Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
@ -17,7 +17,7 @@ library ECDSA {
|
||||
InvalidSignature,
|
||||
InvalidSignatureLength,
|
||||
InvalidSignatureS,
|
||||
InvalidSignatureV
|
||||
InvalidSignatureV // Deprecated in v4.8
|
||||
}
|
||||
|
||||
function _throwError(RecoverError error) private pure {
|
||||
@ -29,8 +29,6 @@ library ECDSA {
|
||||
revert("ECDSA: invalid signature length");
|
||||
} else if (error == RecoverError.InvalidSignatureS) {
|
||||
revert("ECDSA: invalid signature 's' value");
|
||||
} else if (error == RecoverError.InvalidSignatureV) {
|
||||
revert("ECDSA: invalid signature 'v' value");
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,9 +147,6 @@ library ECDSA {
|
||||
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
|
||||
return (address(0), RecoverError.InvalidSignatureS);
|
||||
}
|
||||
if (v != 27 && v != 28) {
|
||||
return (address(0), RecoverError.InvalidSignatureV);
|
||||
}
|
||||
|
||||
// If the signature is valid (and not malleable), return the signer address
|
||||
address signer = ecrecover(hash, v, r, s);
|
||||
|
||||
Reference in New Issue
Block a user