Skip to content

Commit

Permalink
Specify that permit must revert on invalid signatures (ethereum#4728)
Browse files Browse the repository at this point in the history
* Specify that permit must revert on invalid signatures

* reset status to Draft
  • Loading branch information
frangio authored Feb 10, 2022
1 parent 8e31fb8 commit 855a5dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions EIPS/eip-2612.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ if and only if the following conditions are met:
- `nonces[owner]` (before the state update) is equal to `nonce`.
- `r`, `s` and `v` is a valid `secp256k1` signature from `owner` of the message:

If any of these conditions are not met, the `permit` call must revert.

```sol
keccak256(abi.encodePacked(
hex"1901",
Expand Down Expand Up @@ -171,6 +173,8 @@ There is also an implementation in the token [`Stake`](https://etherscan.io/addr

The specification presented here is in line with the implementation in [Uniswap-v2](https://github.com/uniswap/uniswap-v2-core).

The requirement to revert if the permit is invalid was added when the EIP was already widely deployed, but at the moment it was consistent with all found implementations.

## Test Cases

Some basic tests can be found here https://github.com/Uniswap/uniswap-v2-core/blob/master/test/UniswapV2ERC20.spec.ts.
Expand Down

0 comments on commit 855a5dc

Please sign in to comment.