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

Compute addresses with ref contracts #5699

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kumaryash90
Copy link
Member

@kumaryash90 kumaryash90 commented Dec 11, 2024

TOOL-2796 (XPROT-934)

Problem solved

This was an issue when installing modules published with ref contracts. Module installation goes through infra deployment functions which use computed addresses.

SDK should process ref contracts when computing published contract addresses.


PR-Codex overview

This PR focuses on enhancing the handling of published contract references in the thirdweb library by introducing new functions to compute addresses for these references, improving the deployment process for contracts.

Detailed summary

  • Added processRefDeployments function to handle contract references in constructor parameters.
  • Introduced computeRefDeployments function to compute addresses for published contract references.
  • Updated computeDeploymentInfoFromMetadata to process constructor parameters using computeRefDeployments.
  • Enhanced error handling for invalid or empty parameters in computeRefDeployments.

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

Copy link

changeset-bot bot commented Dec 11, 2024

🦋 Changeset detected

Latest commit: f1a5555

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

Copy link

vercel bot commented Dec 11, 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 19, 2024 5:25pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 5:25pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 5:25pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 5:25pm

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

graphite-app bot commented Dec 11, 2024

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.

Copy link
Contributor

github-actions bot commented Dec 11, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 45.02 KB (0%) 901 ms (0%) 552 ms (-22.86% 🔽) 1.5 s
thirdweb (cjs) 110.76 KB (0%) 2.3 s (0%) 1.5 s (+3.05% 🔺) 3.7 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 183 ms (+177.12% 🔺) 294 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 87 ms (+290.45% 🔺) 97 ms
thirdweb/react (minimal + tree-shaking) 19.1 KB (0%) 383 ms (0%) 206 ms (+17.75% 🔺) 588 ms

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 20.43796% with 109 lines in your changes missing coverage. Please review.

Project coverage is 53.12%. Comparing base (00b6c2e) to head (f1a5555).
Report is 34 commits behind head on main.

Files with missing lines Patch % Lines
...rc/extensions/prebuilts/compute-ref-deployments.ts 12.80% 109 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5699      +/-   ##
==========================================
- Coverage   53.20%   53.12%   -0.09%     
==========================================
  Files        1101     1103       +2     
  Lines       59100    59264     +164     
  Branches     4817     4826       +9     
==========================================
+ Hits        31447    31482      +35     
- Misses      26936    27064     +128     
- Partials      717      718       +1     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 2afb9f0
packages 50.29% <20.43%> (-0.10%) ⬇️

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

Files with missing lines Coverage Δ
...rc/extensions/prebuilts/process-ref-deployments.ts 89.14% <ø> (ø)
.../any-evm/compute-published-contract-deploy-info.ts 100.00% <100.00%> (ø)
...rc/extensions/prebuilts/compute-ref-deployments.ts 12.80% <12.80%> (ø)

... and 6 files with indirect coverage changes

Copy link
Contributor

This PR has been inactive for 30 days. It is now marked as stale and will be closed in 5 days if no further activity occurs.

@github-actions github-actions bot added Stale and removed Stale labels Dec 27, 2024
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