Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Dec 5, 2024

Problem solved

CNCT-1921


PR-Codex overview

This PR introduces support for ERC20 Token Paymasters in Smart Wallets, allowing users to utilize different token paymasters for transactions.

Detailed summary

  • Added TokenPaymaster constants for BASE_USDC, CELO_CUSD, and LISK_LSK.
  • Replaced erc20Paymaster with tokenPaymaster in SmartWalletOptions.
  • Updated estimateUserOpGas function to include stateOverrides.
  • Enhanced createSmartAccount to validate token paymaster usage.
  • Implemented tests for transactions using different token paymasters.

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

@vercel
Copy link

vercel bot commented Dec 5, 2024

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 9:23pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 9:23pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 9:23pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 9:23pm

@changeset-bot
Copy link

changeset-bot bot commented Dec 5, 2024

🦋 Changeset detected

Latest commit: 4cead60

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
thirdweb Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 5, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Dec 5, 2024
Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

* accountSalt: "0x...", // override account salt
* entrypointAddress: "0x...", // override entrypoint address
* erc20Paymaster: { ... }, // enable erc20 paymaster
* erc20Paymaster: "BASE_USDC", // enable erc20 paymaster
Copy link
Contributor

Choose a reason for hiding this comment

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

The documentation example shows erc20Paymaster but the actual configuration property is tokenPaymaster. The code sample should be updated to:

overrides: {
  tokenPaymaster: TokenPaymaster.BASE_USDC
}

to match the current implementation.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@joaquim-verges joaquim-verges marked this pull request as ready for review December 5, 2024 20:54
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 47.96 KB (0%) 960 ms (0%) 3.5 s (+29.5% 🔺) 4.4 s
thirdweb (cjs) 107.42 KB (0%) 2.2 s (0%) 6.4 s (-3.91% 🔽) 8.6 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 170 ms (+51.47% 🔺) 281 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 164 ms (+51.98% 🔺) 174 ms
thirdweb/react (minimal + tree-shaking) 18.31 KB (+0.06% 🔺) 367 ms (+0.06% 🔺) 437 ms (+74.81% 🔺) 803 ms

@codecov
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 27.50000% with 58 lines in your changes missing coverage. Please review.

Project coverage is 45.88%. Comparing base (b4eed8a) to head (4cead60).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/wallets/smart/lib/userop.ts 3.44% 28 Missing ⚠️
packages/thirdweb/src/wallets/smart/index.ts 3.84% 25 Missing ⚠️
packages/thirdweb/src/wallets/smart/lib/bundler.ts 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5634      +/-   ##
==========================================
- Coverage   45.89%   45.88%   -0.02%     
==========================================
  Files        1083     1083              
  Lines       56333    56393      +60     
  Branches     4123     4127       +4     
==========================================
+ Hits        25853    25874      +21     
- Misses      29788    29827      +39     
  Partials      692      692              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from b4eed8a
packages 41.14% <27.50%> (-0.01%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...ckages/thirdweb/src/wallets/smart/lib/constants.ts 74.13% <100.00%> (+13.61%) ⬆️
...ackages/thirdweb/src/wallets/smart/smart-wallet.ts 43.13% <ø> (ø)
packages/thirdweb/src/wallets/smart/types.ts 2.38% <ø> (ø)
packages/thirdweb/src/wallets/smart/lib/bundler.ts 0.63% <0.00%> (-0.02%) ⬇️
packages/thirdweb/src/wallets/smart/index.ts 12.05% <3.84%> (-0.19%) ⬇️
packages/thirdweb/src/wallets/smart/lib/userop.ts 1.11% <3.44%> (-0.05%) ⬇️

@b-bot
Copy link
Contributor

b-bot commented Feb 5, 2025

TokenPaymaster doesn't seem to be available in thirdweb/wallets - was this removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants