-
Notifications
You must be signed in to change notification settings - Fork 276
Description
Smart contract wallets (i.e., Argent, Dharma) are becoming ever more popular yet they do not possess private keys and therefore can not directly sign messages. This means that valid transactions from smart contract wallets are recognized as invalid by the current method Polygon PoS uses to determine whether a transaction is valid.
I'd like to suggest implementing the EIP-1271 isValidSignature
method in addition to traditional verify
method currently used which only works for EOAs. For example here:
pos-portal/contracts/common/NativeMetaTransaction.sol
Lines 87 to 103 in dabb08e
function verify( | |
address signer, | |
MetaTransaction memory metaTx, | |
bytes32 sigR, | |
bytes32 sigS, | |
uint8 sigV | |
) internal view returns (bool) { | |
require(signer != address(0), "NativeMetaTransaction: INVALID_SIGNER"); | |
return | |
signer == | |
ecrecover( | |
toTypedMessageHash(hashMetaTransaction(metaTx)), | |
sigV, | |
sigR, | |
sigS | |
); | |
} |
(There are also other places where
verify
is used, but I'm not familiar with the codebase enough to know where the change would need to take place)
Further exaggerating this issue IMHO, is that the current Polygon PoS functionality allows one to deposit funds from their smart contract wallet (i.e., Argent) successfully without issue nor warning, but once deposited, the funds remain locked due to the lack of implementation of EIP-1271. I know personally, because I just did this a few days ago to test out Polygon, and now those funds are locked on Polygon PoS with no way to withdraw nor send (Polygon support ticket #4393 open). I'm probably not the only one who has done this so far, and with growing usage of Polygon and smart contract wallets, I certainly won't be the last one to do this.
Another option would be to only allow for smart contract accounts to withdraw their funds back to mainnet L1 to their specific account. This may be an acceptable option if the complexity to implement EIP-1271 for all transaction types would be too high.
Thanks for your time. Feedback welcome!
Resources:
https://eips.ethereum.org/EIPS/eip-1271
https://docs.walletconnect.org/smart-wallets
https://docs.argent.xyz/wallet-connect-and-argent