Uniswap / v2-core

🦄 🦄 Core smart contracts of Uniswap V2
https://uniswap.org/docs
GNU General Public License v3.0
2.97k stars 3.18k forks source link

Fix PERMIT_TYPEHASH to match selector for permit() #79

Closed petejkim closed 4 years ago

petejkim commented 4 years ago

PERMIT_TYPEHASH wasn't updated when nonce was removed from the arguments for permit()

NoahZinsmeister commented 4 years ago

@petejkim nonce was removed from the function argument list, but it is still an important part of the signature, and needs to be included for safety. you'll notice that the nonce is still passed as an argument: https://github.com/Uniswap/uniswap-v2-core/blob/1e28efb3ccc4fb283f45df5932007bded918838d/contracts/UniswapV2ERC20.sol#L87

petejkim commented 4 years ago

Ah right, makes sense since the typehash identifies the eip-712 signature