<!-- canonical: https://0xsimao.com/findings/m-0-eip712-revert-signature-checker -->

# EIP712's _revertIfError should use all SignatureChecker.Error errors

Low/Info · Three Sigma · Stablecoin framework · 8th January, 2024

Finding 3S-M^0-N16 of the M^0 Minter Gateway security review.

- Protocol: https://www.m0.org/
- Report: /reports/m-0
- Codebase: https://github.com/0xsimao/ttg/tree/a8127901fa1f24a2e821cf4d9854a1aa6ac8088c
- Source: https://cdn.sanity.io/files/qoqld077/production/1cdafafad874aba76e062ad8c216c98338c096db.pdf

---

### Description

Function [ERC712._revertIfError](https://github.com/MZero-Labs/common/blob/4a37119f2da946c6d8ad7b9a70dfdd219225115b/src/ERC712.sol#L150-L157) goes through the different error possibilities in
SignatureChecker.Error and raises the right error accordingly. But some are missing:
InvalidSignatureS and InvalidSignatureV.

### Recommendation

Consider either using the missing ones for better error messaging instead of raising the
more general InvalidSignature error, or removing the unused ones from the enum.

### Status

Addressed in [#7eef72d](https://github.com/MZero-Labs/common/commit/7eef72d526cd44995f93fe09f3068ae9a155250f).

---

Related findings:

- [RedeemQueue::get() reverts due to underflow when it should revert and throw the correct error](https://0xsimao.com/findings/mitosis-redeem-queue-reverts-underflow): Mitosis
