Fail with error ‘EIP2612: invalid signature’
But at the same time I do the signature itself according to the specification, corresponds to eip2612
domain = {
name: await contract.name(),
version: "1",
chainId: await signer.getChainId(),
verifyingContract: contract.address,
};
message = {
owner: userAddress,
spender: RECIPIENT_PERMIT,
value: MAX_ALLOWANCE.toString(), # But also tried the token amount, the same
nonce: (await contract.nonces(userAddress)).toHexString(),
deadline: transactionDeadline, # unix timestamp now + n minutes
};
data = JSON.stringify({
types: {
EIP712Domain,
Permit,
},
domain,
primaryType: "Permit",
message,
});