Uniswap / permit2

🔑🔑🔑 next generation token approvals mechanism
MIT License
762 stars 188 forks source link

Skip timestamp check when deadline/expiration is set to maximum amount #247

Open doublespending opened 9 months ago

doublespending commented 9 months ago

In order for Permit2 to comply with ERC-4337 validation rules and support account abstraction, certain commonly used operations such as checking the current timestamp cannot be run in function calls.

When permit2 is called with a deadline/expiration with the maximum value possible, this PR interprets that as having no expiry, so the timestamp check is skipped and the operation is compliant with ERC-4337.

For example, this can make user using permit2 to prefund paymaster possible in ERC-4337 validation.

Similar approach has been applied by the permit of USDC.