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

[SDK] Update implementation addr extraction logic #6093

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

kumaryash90
Copy link
Member

@kumaryash90 kumaryash90 commented Jan 29, 2025

TOOL-3258


PR-Codex overview

This PR introduces support for extracting implementation addresses from bytecode that conforms to the EIP-7702 specification. It adds a new utility function and a corresponding test to ensure the functionality works as expected.

Detailed summary

  • Added logic to extractMinimalProxyImplementationAddress.ts to handle EIP-7702 delegation designator.
  • Implemented extraction of the implementation address from bytecode starting with 0xef0100.
  • Added a test case in extractMinimalProxyImplementationAddress.test.ts to verify correct extraction of address from EIP-7702 bytecode.

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

@kumaryash90 kumaryash90 requested review from a team as code owners January 29, 2025 18:23
Copy link

changeset-bot bot commented Jan 29, 2025

🦋 Changeset detected

Latest commit: 08cc489

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

This PR includes changesets to release 3 packages
Name Type
thirdweb Patch
@thirdweb-dev/wagmi-adapter Patch
thirdweb-login 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 Jan 29, 2025

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 Feb 3, 2025 5:59pm
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 5:59pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 5:59pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 5:59pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 5:59pm

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Jan 29, 2025
Copy link
Contributor

graphite-app bot commented Jan 29, 2025

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 Jan 29, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 46.6 KB (0%) 933 ms (0%) 3.6 s (+44.44% 🔺) 4.5 s
thirdweb (cjs) 122.38 KB (-0.01% 🔽) 2.5 s (-0.01% 🔽) 7.2 s (+1.13% 🔺) 9.6 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 417 ms (-21.47% 🔽) 529 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 136 ms (+198.71% 🔺) 146 ms
thirdweb/react (minimal + tree-shaking) 19.29 KB (0%) 386 ms (0%) 935 ms (+2.44% 🔺) 1.4 s

@@ -54,5 +54,10 @@ export function extractMinimalProxyImplementationAddress(
return `0x${implementationAddress}`;
}

if (bytecode.startsWith("0xef0100")) {
Copy link
Member

Choose a reason for hiding this comment

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

niceee

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.92%. Comparing base (f03ded3) to head (08cc489).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6093      +/-   ##
==========================================
+ Coverage   56.90%   56.92%   +0.02%     
==========================================
  Files        1155     1155              
  Lines       63916    63920       +4     
  Branches     5193     5195       +2     
==========================================
+ Hits        36369    36388      +19     
+ Misses      26821    26804      -17     
- Partials      726      728       +2     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from f03ded3
packages 55.13% <100.00%> (+0.03%) ⬆️

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

Files with missing lines Coverage Δ
...tecode/extractMinimalProxyImplementationAddress.ts 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

graphite-app bot pushed a commit that referenced this pull request Feb 3, 2025
TOOL-3258

<!--

## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"

If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):

## Notes for the reviewer

Anything important to call out? Be sure to also clarify these in your comments.

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces a patch related to EIP-7702 in the `thirdweb` package, specifically enhancing the functionality to extract minimal proxy implementation addresses from bytecode.

### Detailed summary
- Added a check for EIP-7702 compliance in the `extractMinimalProxyImplementationAddress.ts` file.
- Implemented logic to extract the implementation address from bytecode if it meets the specified conditions (length of 48 and starts with "0xef0100").

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

<!-- end pr-codex -->
@graphite-app graphite-app bot force-pushed the yash/update-impl-addr-extraction branch from 27b35ec to 62f2cd9 Compare February 3, 2025 16:27
@graphite-app graphite-app bot removed the merge-queue Adds the pull request to Graphite's merge queue. label Feb 3, 2025
@kumaryash90 kumaryash90 added the merge-queue Adds the pull request to Graphite's merge queue. label Feb 3, 2025
TOOL-3258

<!--

## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"

If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):

## Notes for the reviewer

Anything important to call out? Be sure to also clarify these in your comments.

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces support for EIP-7702 by adding functionality to extract the implementation address from a specific bytecode pattern. It includes a new utility function and a corresponding test case.

### Detailed summary
- Added EIP-7702 support in `extractMinimalProxyImplementationAddress.ts` to extract the implementation address from bytecode.
- Implemented a check for bytecode length and prefix.
- Added a test case in `extractMinimalProxyImplementationAddress.test.ts` to validate the new functionality.

> ✨ 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
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.

None yet

2 participants