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: deployless call via bytecode #2408

Merged
merged 11 commits into from
Jun 15, 2024
Merged

feat: deployless call via bytecode #2408

merged 11 commits into from
Jun 15, 2024

Conversation

jxom
Copy link
Member

@jxom jxom commented Jun 14, 2024

Adding ability to perform a deployless contract call via bytecode.


PR-Codex overview

This PR introduces Deployless Call patterns via bytecode and factory. It enhances contract interaction and testing capabilities.

Detailed summary

  • Added support for Deployless Calls via Bytecode in writeContract and readContract
  • Improved contract testing with simulateContract and writeContract updates
  • Updated CounterfactualDeploymentFailedError constructor to handle optional factory address
  • Added deployless flag in ContractFunctionReturnType for deployless calls
  • Included new contracts for Deployless Call via Bytecode and Factory
  • Updated documentation for Deployless Calls via Bytecode and Factory in readContract.md

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

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

Copy link

changeset-bot bot commented Jun 14, 2024

🦋 Changeset detected

Latest commit: 13750b4

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

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

Copy link

vercel bot commented Jun 14, 2024

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

Name Status Preview Updated (UTC)
viem ✅ Ready (Inspect) Visit Preview Jun 15, 2024 3:37am

Copy link
Contributor

github-actions bot commented Jun 14, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
viem (esm) 58.32 KB (+0.44% 🔺) 1.2 s (+0.44% 🔺) 13.4 s (+44.61% 🔺) 14.6 s
viem (cjs) 69.28 KB (+0.21% 🔺) 1.4 s (+0.21% 🔺) 10 s (-46.35% 🔽) 11.4 s
viem (minimal surface - tree-shaking) 3.31 KB (0%) 67 ms (0%) 91 ms (-57.81% 🔽) 157 ms
viem/accounts 73.84 KB (0%) 1.5 s (0%) 1.5 s (-70.1% 🔽) 3 s
viem/accounts (tree-shaking) 18.91 KB (0%) 379 ms (0%) 1.6 s (+65.38% 🔺) 2 s
viem/actions 45.23 KB (+0.41% 🔺) 905 ms (+0.41% 🔺) 3.8 s (-39.65% 🔽) 4.7 s
viem/actions (tree-shaking) 318 B (0%) 10 ms (0%) 34 ms (-5.06% 🔽) 44 ms
viem/chains 28.52 KB (0%) 571 ms (0%) 9.7 s (+98.73% 🔺) 10.3 s
viem/chains (tree-shaking) 324 B (0%) 10 ms (0%) 284 ms (+404.17% 🔺) 294 ms
viem/chains/utils 1.02 KB (0%) 21 ms (0%) 49 ms (-40.71% 🔽) 69 ms
viem/ens 45.23 KB (+0.41% 🔺) 905 ms (+0.41% 🔺) 4.5 s (+44.72% 🔺) 5.4 s
viem/ens (tree-shaking) 21.93 KB (+0.9% 🔺) 439 ms (+0.9% 🔺) 2.5 s (-64.28% 🔽) 2.9 s
viem/siwe 29.64 KB (+0.37% 🔺) 593 ms (+0.37% 🔺) 3.4 s (+25.45% 🔺) 4 s
viem/siwe (tree-shaking) 28.56 KB (+0.68% 🔺) 572 ms (+0.68% 🔺) 4.2 s (+3.79% 🔺) 4.8 s

Copy link

codecov bot commented Jun 14, 2024

Codecov Report

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

Project coverage is 99.62%. Comparing base (07dcb05) to head (13750b4).

Files Patch % Lines
src/errors/contract.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2408   +/-   ##
=======================================
  Coverage   99.61%   99.62%           
=======================================
  Files         684      684           
  Lines       57609    57658   +49     
  Branches     2784     2789    +5     
=======================================
+ Hits        57390    57440   +50     
- Misses        203      204    +1     
+ Partials       16       14    -2     

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

}
| {
/** Bytecode to perform the call on. */
bytecode?: Hex | undefined
Copy link
Member

Choose a reason for hiding this comment

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

Should we call this code instead of bytecode? Aligns better with Ethereum terminology 'eth_getCode' (the getBytecode action should probably be called getCode too).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah let’s do it. Guess it also consistent with code in state overrides.

Copy link
Member

Choose a reason for hiding this comment

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

@jxom jxom changed the title wip: deployless call via bytecode feat: deployless call via bytecode Jun 15, 2024
@jxom jxom marked this pull request as ready for review June 15, 2024 02:17
@jxom jxom merged commit 21cb684 into main Jun 15, 2024
32 of 34 checks passed
@jxom jxom deleted the counterfactual-bytecode branch June 15, 2024 05:08
@github-actions github-actions bot mentioned this pull request Jun 15, 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.

2 participants