Skip to content

Conversation

@kumaryash90
Copy link
Member

@kumaryash90 kumaryash90 commented Nov 8, 2024

PROT-932
PROT-864

Problem solved

https://linear.app/thirdweb/project/[contract-tooling]-deployment-publish-flow-revamp-0194e04e2a84/overview

Handle contract refs in publish form -- Resolve / deploy all linked contracts in publish metadata, and pass the addresses as constructor args for corresponding params.

It recursively deploys all referenced contracts through the ref chain, before deploying the main contract.


PR-Codex overview

This PR focuses on enhancing the deployment and management of smart contracts by introducing dynamic parameters and improving UI components for contract publishing, including better handling of reference contracts and constructor parameters.

Detailed summary

  • Changed error handling in deploy-with-abi.ts to return address instead of throwing an error.
  • Updated UI layout in string-input.tsx for improved responsiveness.
  • Added dynamicValue support in various components for constructor parameters.
  • Enhanced FormFieldSetup to accept optional className.
  • Introduced new DynamicParams type for flexible contract deployment.
  • Implemented dynamic input handling for reference contracts in multiple components.
  • Added handling for implConstructorParams in contract deployment logic.
  • Improved component structure for better readability and maintainability.

The following files were skipped due to too many changes: apps/dashboard/src/components/contract-components/contract-publish-form/contract-params-fieldset.tsx

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

@changeset-bot
Copy link

changeset-bot bot commented Nov 8, 2024

⚠️ No Changeset found

Latest commit: d9fb544

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 8, 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 11, 2024 6:20pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 6:20pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 6:20pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 6:20pm

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 8, 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 github-actions bot added Dashboard Involves changes to the Dashboard. packages labels Nov 8, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 44.93 KB (0%) 899 ms (0%) 3.7 s (-23.04% 🔽) 4.6 s
thirdweb (cjs) 110.71 KB (0%) 2.3 s (0%) 5.7 s (-22.43% 🔽) 7.9 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 174 ms (-51.21% 🔽) 286 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 117 ms (+62.77% 🔺) 127 ms
thirdweb/react (minimal + tree-shaking) 19.07 KB (0%) 382 ms (0%) 525 ms (+2.26% 🔺) 907 ms

@codecov
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 90.38462% with 15 lines in your changes missing coverage. Please review.

Project coverage is 51.42%. Comparing base (b49dde3) to head (d9fb544).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rc/extensions/prebuilts/process-ref-deployments.ts 89.14% 14 Missing ⚠️
...rdweb/src/extensions/prebuilts/deploy-published.ts 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5360      +/-   ##
==========================================
+ Coverage   51.25%   51.42%   +0.16%     
==========================================
  Files        1092     1093       +1     
  Lines       57375    57524     +149     
  Branches     4689     4723      +34     
==========================================
+ Hits        29410    29583     +173     
+ Misses      27249    27225      -24     
  Partials      716      716              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from b49dde3
packages 48.10% <90.38%> (+0.21%) ⬆️

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

Files with missing lines Coverage Δ
...hirdweb/src/contract/deployment/deploy-with-abi.ts 75.64% <100.00%> (+37.17%) ⬆️
.../thirdweb/src/extensions/thirdweb/write/publish.ts 91.25% <100.00%> (+0.11%) ⬆️
...ages/thirdweb/src/utils/any-evm/deploy-metadata.ts 79.71% <ø> (ø)
...rdweb/src/extensions/prebuilts/deploy-published.ts 80.97% <96.00%> (+2.90%) ⬆️
...rc/extensions/prebuilts/process-ref-deployments.ts 89.14% <89.14%> (ø)

... and 3 files with indirect coverage changes

@kumaryash90 kumaryash90 changed the title Ref values for address params in publish [WIP] Ref values for address params in publish Nov 8, 2024
@kumaryash90 kumaryash90 marked this pull request as draft November 8, 2024 21:58
@vercel vercel bot temporarily deployed to Preview – wallet-ui November 9, 2024 15:56 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground November 9, 2024 15:56 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 November 9, 2024 15:56 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui November 9, 2024 17:29 Inactive
Copy link
Member Author

kumaryash90 commented Dec 11, 2024

Merge activity

  • Dec 11, 1:05 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 11, 1:05 PM EST: A user added this pull request to the Graphite merge queue.
  • Dec 11, 1:20 PM EST: A user merged this pull request with the Graphite merge queue.

…5360)

PROT-932
PROT-864

## Problem solved

https://linear.app/thirdweb/project/[contract-tooling]-deployment-publish-flow-revamp-0194e04e2a84/overview

Handle contract refs in publish form -- Resolve / deploy all linked contracts in publish metadata, and pass the addresses as constructor args for corresponding params.

It recursively deploys all referenced contracts through the ref chain, before deploying the main contract.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the contract deployment and parameter handling in the thirdweb platform, introducing dynamic parameters, improved UI components, and better error handling for contract interactions.

### Detailed summary
- Updated `deploy-with-abi.ts` to return the contract address instead of throwing an error if already deployed.
- Enhanced UI components in `string-input.tsx` and `raw-input.tsx` for better user experience.
- Added dynamic parameter handling in multiple components.
- Introduced new types for dynamic parameters in `deploy-metadata.ts`.
- Improved form handling in `FormFieldSetup` and related components.
- Added reference contract input fields in various components for dynamic contract deployments.
- Enhanced error handling and validation in the deployment forms.
- Updated component structure for better maintainability and clarity.

> The following files were skipped due to too many changes: `apps/dashboard/src/components/contract-components/contract-publish-form/contract-params-fieldset.tsx`

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

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dashboard Involves changes to the Dashboard. 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.

4 participants