Skip to content
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

Implement EIP-1271 isValidSignature to allow smart contract wallets to interact with Polygon PoS #93

Open
skylarweaver opened this issue Aug 28, 2021 · 1 comment

Comments

@skylarweaver
Copy link

skylarweaver commented Aug 28, 2021

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:

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

@skylarweaver
Copy link
Author

skylarweaver commented Sep 14, 2021

Hi @jdkanani @arthcp @itzmeanjan — could you all provide some feedback on the above issue I outlined? On what timeline would this be possible? Many thanks!! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant