web-examples icon indicating copy to clipboard operation
web-examples copied to clipboard

feat: erc 6492 signature validation

Open guru-web3 opened this issue 1 year ago • 3 comments

PR Documentation Outline: Title: Add ERC-6942 Signature Validation for Pre-Deployed Contracts

Summary: This PR implements signature validation using ERC-6942, which enables verifying signatures for smart contract wallets even when they aren't deployed. This is necessary because some wallets delay contract deployment until the first transaction. By adopting ERC-6942, we validate signatures before wallet deployment.

Details:

  • isValidateSignature() currently validates deployed contract signatures.
  • ERC-6942 allows signature verification even when a contract is in the pre-deployment state.
  • This approach avoids delayed wallet interactions and enhances user experience.

Technical Changes:

  • Added new validation logic in accordance with ERC-6942 standards.
  • Ensured backward compatibility with already deployed contracts.

Changes Made:

  • Added signature verification logic compatible with ERC-6942.
  • Updated the isValidateSignature() method to support both deployed and pre-deployed contract signatures.
  • Comprehensive testing for deployed and pre-deployed wallet scenarios.

Why This Change? Some smart contract wallets only deploy upon the first transaction. With ERC-6942, we can validate signatures before deployment, ensuring users experience seamless wallet interactions.

This diagram shows the two flows:

Deployed Contract: Traditional signature verification for deployed wallets. Pre-Deployed Contract (ERC-6942): Signature verification for wallets that haven't been deployed yet.

eip6492 drawio

universal validator ref: https://github.com/AmbireTech/signature-validator/blob/main/index.ts#L32

guru-web3 avatar Oct 10 '24 09:10 guru-web3

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vue-web-examples ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2024 10:19am

vercel[bot] avatar Oct 10 '24 09:10 vercel[bot]

@guru-web3 is attempting to deploy a commit to the Reown Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Oct 10 '24 09:10 vercel[bot]

@ganchoradkov have addressed the comments, review when free please thanks 🙏

guru-web3 avatar Oct 15 '24 02:10 guru-web3