Skip to content

Conversation

@gregfromstl
Copy link
Contributor

@gregfromstl gregfromstl commented Nov 19, 2024

This PR starts the work necessary for CNCT-2398. Further work will be needed to determine how to prepare a deployment transaction that generalizes across all deploy types without access to an account.


PR-Codex overview

This PR refactors the contract deployment functions in the thirdweb package to improve clarity and modularity. It introduces new transaction preparation functions and modifies existing ones to streamline the deployment process for both standard and deterministic contracts.

Detailed summary

  • Renamed zkDeployContract to prepareZkDeployContractTransaction.
  • Introduced prepareZkDeployContractDeterministicTransaction for deterministic deployment.
  • Updated zkDeployCreate2Factory to use the new transaction preparation functions.
  • Removed direct calls to zkDeployContract in favor of new preparation functions.
  • Added handling for optional salt and deploymentType parameters in deployment functions.

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

@gregfromstl gregfromstl added the Feature Adds new functionality to the public API. label Nov 19, 2024
@gregfromstl gregfromstl self-assigned this Nov 19, 2024
@linear
Copy link

linear bot commented Nov 19, 2024

@changeset-bot
Copy link

changeset-bot bot commented Nov 19, 2024

⚠️ No Changeset found

Latest commit: e2ca996

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link

vercel bot commented Nov 19, 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 Nov 20, 2024 1:52am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 1:52am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 1:52am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 1:52am

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 19, 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
Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 44.9 KB (0%) 899 ms (0%) 2.5 s (-6.71% 🔽) 3.4 s
thirdweb (cjs) 105.02 KB (0%) 2.2 s (0%) 6.2 s (+20.98% 🔺) 8.3 s
thirdweb (minimal + tree-shaking) 5.61 KB (0%) 113 ms (0%) 317 ms (+80.5% 🔺) 429 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 88 ms (+132.89% 🔺) 98 ms
thirdweb/react (minimal + tree-shaking) 18.41 KB (0%) 369 ms (0%) 451 ms (+56.43% 🔺) 819 ms

@codecov
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 101 lines in your changes missing coverage. Please review.

Project coverage is 45.48%. Comparing base (2591c75) to head (e2ca996).
Report is 37 commits behind head on main.

Files with missing lines Patch % Lines
...ontract/deployment/zksync/zkDeployDeterministic.ts 0.00% 53 Missing ⚠️
...ntract/deployment/zksync/zkDeployCreate2Factory.ts 0.00% 29 Missing ⚠️
...src/contract/deployment/zksync/zkDeployContract.ts 0.00% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5462      +/-   ##
==========================================
- Coverage   45.50%   45.48%   -0.02%     
==========================================
  Files        1071     1070       -1     
  Lines       55743    55765      +22     
  Branches     4031     4035       +4     
==========================================
  Hits        25367    25367              
- Misses      29689    29711      +22     
  Partials      687      687              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 2591c75
packages 40.59% <0.00%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
...src/contract/deployment/zksync/zkDeployContract.ts 2.27% <0.00%> (-0.36%) ⬇️
...ntract/deployment/zksync/zkDeployCreate2Factory.ts 1.85% <0.00%> (-0.24%) ⬇️
...ontract/deployment/zksync/zkDeployDeterministic.ts 0.91% <0.00%> (-0.50%) ⬇️

... and 2 files with indirect coverage changes

---- 🚨 Try these New Features:

to: create2Signer.address,
value: valueToSend,
}),
return prepareTransaction({
Copy link
Member

Choose a reason for hiding this comment

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

this tx should be done before the second one, so ideally we return 2 transactions in an array here? and we execute them one by one

@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label Nov 20, 2024
Copy link
Contributor Author

Merge activity

  • Nov 19, 8:37 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.

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

Labels

Feature Adds new functionality to the public API. merge-queue Adds the pull request to Graphite's merge queue. packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants