Open Ivshti opened 2 years ago
Hi @Ivshti, thanks for creating the issue. It's correct that the CowSwap smart contract supports EIP1271 and it would be a better UX to use this order type in smart contract wallets that support it.
Currently the limiting factor is our backend (https://github.com/gnosis/gp-v2-services), which only supports ethsign, EIP 712 and PreSign orders.
In order to add EIP1271 to the backend one would have to follow a similar implementation path as we did for PreSign
We haven't prioritised this feature yet, since we didn't see that much demand for this order type (therefore it's good that you raised it). Of course, we would be happy to accept code contributions.
thanks @fleupold, we're adding this to our pipeline, we should be able to get it done by the end of the month!
Description It appears that signing orders with SC wallets uses sig mode 4, pre-signing an order (https://docs.cowswap.exchange/smart-contracts/settlement-contract/signature-schemes) instead of sig mode 3 (EIP 1271 signature)
This issue happens with Ambire Wallet
How to Reproduce Steps to reproduce the behavior:
Expected behavior CowSwap should be using personal_sign to request an EIP1271 signature from the wallet, to avoid extra gas costs
Screenshots
(note: wallet addr was deleted via DevTools in the second screenshot for privacy)
Additional context Ambire Wallet is a smrat contract wallet that supports EIP1271 as evident here https://github.com/AmbireTech/wallet/blob/main/contracts/Identity.sol#L152. This has been verified with multiple dApps such as Opensea