Uniswap / permit2

🔑🔑🔑 next generation token approvals mechanism
MIT License
759 stars 187 forks source link

feat: add IPermit2 interface #214

Closed PaulRBerg closed 1 year ago

PaulRBerg commented 1 year ago

Addresses #213.

ewilz commented 1 year ago

@marktoda do you have any opinions on this?? I think we had left the these two separate interfaces intentionally.

This issue alludes to frozen version issue, but I don't see how that's related as that is the impl contracts (not the interface contracts which are relevant to this PR)

ewilz commented 1 year ago

ok going to merge this still

PaulRBerg commented 1 year ago

This issue alludes to frozen version issue, but I don't see how that's related as that is the impl contracts

Without an interface like the one introduced by this PR, users who want to use the signature and the allowance modes at the same time have to use the Permit2 contract itself; but they can only do so only if they are on Solidity 0.8.17.

PaulRBerg commented 1 year ago

Thanks for merging!

ewilz commented 1 year ago

we've just been importing both interfaces as needed

PaulRBerg commented 1 year ago

Yeah but you can't use them in all cases, e.g. struct fields. It's either this:

struct Permit2Thingy {
    IAllowanceTransfer permit2Address;
}

Or this:

struct Permit2Thingy {
    ISignatureTransfer permit2Address;
}