Skip to content

Conversation

@0xFirekeeper
Copy link
Member

@0xFirekeeper 0xFirekeeper commented Dec 6, 2024

Enables smart accounts to sign messages and auth as themselves without requiring deployment.


PR-Codex overview

This PR focuses on enhancing the Thirdweb wallet functionality by implementing ERC-6492 signature verification, adding new classes for multicall operations, and improving contract interaction methods, including support for encoding function calls.

Detailed summary

  • Added ERC-6942 verification in Thirdweb.SmartWallet.Tests.cs.
  • Introduced Multicall3_Call3, Multicall3_Result, and Erc6492Signature classes in AATypes.cs.
  • Enhanced SupportsInterface method in ThirdwebExtensions.cs.
  • Implemented CreateCallData method in ThirdwebExtensions.cs.
  • Modified cache key generation in ThirdwebRPC.cs to include _rpcUrl.
  • Created EncodeFunctionCall method in ThirdwebContract.cs.
  • Updated IsValidSignature method in SmartWallet.cs for ERC-6492 verification.
  • Added SerializeErc6492Signature method in Utils.cs.
  • Defined constants for magic values and addresses in Constants.cs.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Enables smart accounts to sign messages and auth as themselves without requiring deployment.
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 91.01124% with 8 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@b75f909). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...irdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs 83.33% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #105   +/-   ##
=======================================
  Coverage        ?   78.20%           
=======================================
  Files           ?       28           
  Lines           ?     4488           
  Branches        ?      619           
=======================================
  Hits            ?     3510           
  Misses          ?      812           
  Partials        ?      166           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

{
result = await multicall3
.Read<List<Multicall3_Result>>(
method: "aggregate3",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come you're calling multicall3 here? Was expecting to see a encoded call with the universal validator abi

I guess that works too but then you have a dependency on multicall3 being deployed.

Seems cleaner to do the deploy+ isvalidsig call in solidity which is what the universal validator does

@0xFirekeeper 0xFirekeeper merged commit 8537bf3 into main Dec 6, 2024
1 check passed
@0xFirekeeper 0xFirekeeper deleted the firekeeper/erc6492 branch December 6, 2024 23:20
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

Successfully merging this pull request may close these issues.

4 participants