The ecrecover
function is susceptible to signature malleability which could lead to replay attacks.
Consider using OpenZeppelin’s ECDSA library. (see here, here and here)
- EVM ecrecover Signature Malleability
- Sig -> (v, r, s)
- Checks s -> Lower Range
- Replay Attacks
- Use OZ ECDSA