Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Apr 1, 2025


PR-Codex overview

This PR focuses on enhancing the createAndSignUserOp function to handle entrypoint resolution when a factory address is provided but no entrypoint is specified. Additionally, it introduces a test for preparing a user operation.

Detailed summary

  • Added a test case to verify preparation of a 0.7 user operation in smart-wallet-integration-v07.test.ts.
  • Enhanced createAndSignUserOp in userop.ts to resolve the entrypoint from the factory if not explicitly provided.

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

@vercel
Copy link

vercel bot commented Apr 1, 2025

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 Apr 1, 2025 11:32pm
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2025 11:32pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2025 11:32pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2025 11:32pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2025 11:32pm

@joaquim-verges joaquim-verges changed the title [thirdweb] Handle entrypoint resolution inside createAndSignUserOp [SDK] Handle entrypoint resolution inside createAndSignUserOp Apr 1, 2025
@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Apr 1, 2025
@joaquim-verges joaquim-verges marked this pull request as ready for review April 1, 2025 20:45
@joaquim-verges joaquim-verges requested a review from a team as a code owner April 1, 2025 20:45
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

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

@github-actions
Copy link
Contributor

github-actions bot commented Apr 1, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 47.61 KB (0%) 953 ms (0%) 169 ms (+154.89% 🔺) 1.2 s
thirdweb (cjs) 127.63 KB (0%) 2.6 s (0%) 238 ms (+49.62% 🔺) 2.8 s
thirdweb (minimal + tree-shaking) 5.62 KB (0%) 113 ms (0%) 85 ms (+1991.29% 🔺) 198 ms
thirdweb/chains (tree-shaking) 514 B (0%) 11 ms (0%) 69 ms (+3221.04% 🔺) 79 ms
thirdweb/react (minimal + tree-shaking) 19.35 KB (0%) 388 ms (0%) 102 ms (+798.71% 🔺) 489 ms

@codecov
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

Attention: Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Project coverage is 54.97%. Comparing base (58ab8c2) to head (8abd5ff).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/wallets/smart/lib/userop.ts 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6615      +/-   ##
==========================================
+ Coverage   54.91%   54.97%   +0.05%     
==========================================
  Files         885      885              
  Lines       55581    55594      +13     
  Branches     3791     3794       +3     
==========================================
+ Hits        30522    30562      +40     
+ Misses      24964    24937      -27     
  Partials       95       95              
Flag Coverage Δ
packages 54.97% <94.11%> (+0.05%) ⬆️
Files with missing lines Coverage Δ
packages/thirdweb/src/wallets/smart/lib/userop.ts 77.66% <94.11%> (+3.95%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joaquim-verges joaquim-verges force-pushed the _thirdweb_Handle_entrypoint_resolution_inside_createAndSignUserOp branch from 8abd5ff to 9244d30 Compare April 1, 2025 23:23
@changeset-bot
Copy link

changeset-bot bot commented Apr 1, 2025

🦋 Changeset detected

Latest commit: 9244d30

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

This PR includes changesets to release 2 packages
Name Type
thirdweb Patch
@thirdweb-dev/wagmi-adapter Patch

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

Comment on lines 750 to +768
waitForDeployment?: boolean;
isDeployedOverride?: boolean;
}) {
// if factory is passed, but no entrypoint, try to resolve entrypoint from factory
if (
options.smartWalletOptions.factoryAddress &&
!options.smartWalletOptions.overrides?.entrypointAddress
) {
const entrypointAddress = await getEntrypointFromFactory(
options.smartWalletOptions.factoryAddress,
options.client,
options.smartWalletOptions.chain,
);
if (entrypointAddress) {
options.smartWalletOptions.overrides = {
...options.smartWalletOptions.overrides,
entrypointAddress,
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The function needs to check if the smart wallet account is deployed before creating the user operation. After resolving the entrypoint, it should check the deployment status and set the appropriate flags. Add code to check if the account is deployed using isContractDeployed or a similar function, and set the isDeployedOverride parameter accordingly if not explicitly provided.

Spotted by Diamond (based on CI logs)

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

@joaquim-verges joaquim-verges merged commit f618c53 into main Apr 2, 2025
29 of 30 checks passed
@joaquim-verges joaquim-verges deleted the _thirdweb_Handle_entrypoint_resolution_inside_createAndSignUserOp branch April 2, 2025 01:17
@joaquim-verges joaquim-verges mentioned this pull request Apr 2, 2025
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.

2 participants