permit2 icon indicating copy to clipboard operation
permit2 copied to clipboard

What is the rationale for freezing the Solidity version?

Open lilyanB opened this issue 1 year ago • 3 comments

Hello I've seen that all interfaces have been moved to ^0.8.0 but not contracts. This would make it possible to use them when importing change this: pragma solidity 0.8.17 to this: pragma solidity ^0.8.17; I can do it if needed

lilyanB avatar Oct 17 '24 13:10 lilyanB

The core contract is frozen in version for security reasons - that is the version of solidity that it is audited for. However the interfaces are made to be variable versions so that you can integrate with Permit2 in your codebase. Why is it you need to import Permit2.sol and not just use IPermit2.sol?

hensha256 avatar Oct 17 '24 14:10 hensha256

We need to use Permit2.sol for testing purposes. Right now, we have to fork ETH mainnet to have the contract already deployed so we can use only IPermit2.sol

lilyanB avatar Oct 17 '24 15:10 lilyanB

I came across this same issue and it's rather annoying. I ended up creating a fork that modifies the contracts to compile with any 0.8.x version. Nothing else has been changed besides the pragma statements.

If anyone finds this useful, the repo is at permit2-unlocked, the Soldeer page is here, and you can install it with:

soldeer install uniswap-permit2-unlocked~1.0.0

Or with Forge + Soldeer:

forge soldeer install uniswap-permit2-unlocked~1.0.0

jhubbardsf avatar Apr 02 '25 20:04 jhubbardsf