-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Use SignatureChecker inside Permit to allow smart contract wallets to use it #3951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c8dc58e
to
abf1855
Compare
Hello @k06a This was already discussed (can't find the issue though :/) and we decided against doing it for the following reasons:
|
The issue is #2845. The main reason is that EIP-2612 specifically says |
I see this comment now. It's true that it doesn't violate the EIP that much... EIP-1271 goes beyond these signatures though. For example, Gnosis Safe's implementation wouldn't work with this. What wallets would be enabled by this change? There is Argent as mentioned in #2845. Are there others? |
@frangio I think smart contract wallets will be able to let receiver claim their tokens without performing transaction. In case of permit to other wallet (EOA or SC). |
BTW Uniswap’s permit2 supports EIP1271: https://github.com/Uniswap/permit2/blob/ca6b6ff2b47afc2942f3c67b0d929ca4f0b32631/src/libraries/SignatureVerification.sol#L43 |
Interresting: they also support both 65 and 64 bytes signatures |
I think they support any length and effectively support Gnosis Safes |
I agree with @Amxx's comment. It seems to me that there is no advantage in using |
USDC finally supports ERC-1271 signatures, could be done as new ERC, extending ERC-2612… |
I don't understand the technical benefits, but if it's becoming standard then it might be worth it |
@elshan-eth you can’t place limit order from miltisig without manually executing approve. |
It's not just about batching, but it is true that in theory AA allows this to be fixed at the account level. That said it won't happen in practice until there's a standard way to do it.
For reference: https://github.com/circlefin/stablecoin-evm/blob/a4ba37d0495b1c979ff0dcfdbad2e5e076828208/contracts/v2/EIP2612.sol#L77 I'm not convinced this is worth doing... It will only work for the simplest accounts, it won't work for Safes, it won't work for passkey accounts, etc. |
@k06a, good example 👍 |
I think we could have separate |
Ah I see, this is what you mean: https://github.com/circlefin/stablecoin-evm/blob/a4ba37d0495b1c979ff0dcfdbad2e5e076828208/contracts/v2/FiatTokenV2_2.sol#L95-L101 |
Could be |
@k06a, I think your example is a pretty strong point for having such a feature. I think it could also be useful for some bridges or other protocols that have some off-chain logic to avoid having to do a physical approve. |
|
Considering that Permits take 65 bits signatures (v,r,s), this is very restrictive on the account. Accounts may need different signature format, for example to accomodate ERC-7739. Additionally, the development of smart account (in particular through ERC-4337 and ERC-7702) is making this mostly irrelevant IMO. Closing. |
I see current implementation of EIP-2612 (aka Permit) is not supporting smart contract wallets and they are required to invent own signature-based operations to execute token approve by smart contract wallet owner signature (pseudocode example: https://ethereum.stackexchange.com/a/142814/3032). Trying to fix it without violating EIP-2612 specification.
First (EIP-2612) defines signature as following:
But if
owner
is smart contract wallet, can we consider signature to be validsecp256k1
signature but of walletowner()
of ERC20owner
?I think it's possible and doesn't violate EIP that much. Let's discuss.