Hi OZ team,

Quick question:

Why is the 'P' in the string of _PERMIT_TYPEHASH capitalized? Shouldn't it match the function signature 'permit(...)'? Perhaps it does not matter, but I think if you build the digest off-chain then you have to ensure this capital 'P'match right?

The hashes obviously are different, though I also see UniswapV2 implementation carried this 'Permit(...)' convention.

ethers.utils.keccak256(ethers.utils.toUtf8Bytes("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"));


ethers.utils.keccak256(ethers.utils.toUtf8Bytes("permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"));


1 Like

I may have answered my own question, but I believe is due to EIP2612 ?

The capital P doesn't come from the permit function (as you can see the parameters in the string do not match the permit's signature). It comes from the Permit structure that is signed using EIP712.

This is defined in https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-712

Capture d’écran du 2022-08-18 12-20-43