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

feat: add support for counterfactual contract calls #2405

Merged
merged 11 commits into from
Jun 14, 2024
Merged

Conversation

jxom
Copy link
Member

@jxom jxom commented Jun 13, 2024

Adding support for counterfactual contract calls, via a factory and factoryData parameter on eth_call related Actions. Suitable for use with Create2 factories, ERC-4337 factories, and generally any factory that deploys a contract.


PR-Codex overview

This PR introduces CounterfactualDeploymentFailedError for failed contract deployments. It adds parameters factory & factoryData for deployless counterfactual calls. Detailed summary:

  • Added CounterfactualDeploymentFailedError
  • Updated functions to include factory & factoryData parameters
  • Updated tests for counterfactual calls

The following files were skipped due to too many changes: site/pages/docs/contract/readContract.md, site/pages/docs/actions/public/call.md, src/actions/public/call.test.ts, src/actions/public/call.ts, src/constants/contracts.ts

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

Copy link

vercel bot commented Jun 13, 2024

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

Name Status Preview Updated (UTC)
viem ❌ Failed (Inspect) Jun 14, 2024 2:37am

Copy link

changeset-bot bot commented Jun 13, 2024

🦋 Changeset detected

Latest commit: 721d2f5

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

This PR includes changesets to release 1 package
Name Type
viem 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

Copy link
Contributor

github-actions bot commented Jun 13, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
viem (esm) 58.13 KB (+1.62% 🔺) 1.2 s (+1.62% 🔺) 1.5 s (-35.56% 🔽) 2.6 s
viem (cjs) 69.14 KB (+0.89% 🔺) 1.4 s (+0.89% 🔺) 2.5 s (+15.2% 🔺) 3.9 s
viem (minimal surface - tree-shaking) 3.31 KB (0%) 67 ms (0%) 64 ms (+478.4% 🔺) 130 ms
viem/accounts 73.64 KB (0%) 1.5 s (0%) 862 ms (+29.72% 🔺) 2.4 s
viem/accounts (tree-shaking) 18.91 KB (0%) 379 ms (0%) 540 ms (+297.18% 🔺) 918 ms
viem/actions 45.03 KB (+7.89% 🔺) 901 ms (+7.89% 🔺) 1.2 s (+180.28% 🔺) 2.1 s
viem/actions (tree-shaking) 318 B (0%) 10 ms (0%) 5 ms (-12.21% 🔽) 15 ms
viem/chains 28.49 KB (0%) 570 ms (0%) 709 ms (+20.94% 🔺) 1.3 s
viem/chains (tree-shaking) 324 B (0%) 10 ms (0%) 7 ms (+30.73% 🔺) 17 ms
viem/chains/utils 1.02 KB (0%) 21 ms (0%) 8 ms (-18.24% 🔽) 29 ms
viem/ens 45.03 KB (+7.89% 🔺) 901 ms (+7.89% 🔺) 443 ms (-1.81% 🔽) 1.4 s
viem/ens (tree-shaking) 21.73 KB (+17.96% 🔺) 435 ms (+17.96% 🔺) 613 ms (+98.9% 🔺) 1.1 s
viem/siwe 29.5 KB (+11.07% 🔺) 591 ms (+11.07% 🔺) 706 ms (-12.28% 🔽) 1.3 s
viem/siwe (tree-shaking) 28.36 KB (+11.54% 🔺) 568 ms (+11.54% 🔺) 657 ms (+14.03% 🔺) 1.3 s

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.62%. Comparing base (0a4c527) to head (2445735).
Report is 1 commits behind head on main.

Current head 2445735 differs from pull request most recent head 721d2f5

Please upload reports for the commit 721d2f5 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2405      +/-   ##
==========================================
- Coverage   99.62%   99.62%   -0.01%     
==========================================
  Files         684      684              
  Lines       57499    57597      +98     
  Branches     2777     2785       +8     
==========================================
+ Hits        57283    57380      +97     
  Misses        202      202              
- Partials       14       15       +1     

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

@jxom jxom marked this pull request as ready for review June 14, 2024 01:24
@jxom jxom changed the title wip: add support for counterfactual contract calls feat: add support for counterfactual contract calls Jun 14, 2024
@jxom jxom merged commit fc8919f into main Jun 14, 2024
16 of 31 checks passed
@jxom jxom deleted the counterfactual-call branch June 14, 2024 02:38
@github-actions github-actions bot mentioned this pull request Jun 14, 2024
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.

1 participant