ERC20Permit parameters

Hello, I was studying the uniswap contracts, and saw that it had a permit function, I came to see if openzeppelin provided any extensions and found ERC20Permit.
But I am in doubt, the function "pemit" receives some parameters.

permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s)

And I am in doubt about these last 3 parameters, I don't know what to put there. I saw some old tutorials, but they teach to do a split of the hash in assembly, get these parameters v, r, s and do the validation.

This way the verification would be simpler and the permit function would look like this permit(address owner, address spender, uint value, uint deadline, bytes signature).

1 Like

Hi, welcome to the community! :wave:

If you are checking Uniswap V2, I think you can have a look at their test case for this: v2-core/UniswapV2ERC20.spec.ts | Uniswap/v2-core

If it is helpful, I have made a little tool that will let you check the instruction for that permit function.
https://blackboxmint.io/encode-function-instructions-for-evm/