Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Feb 12, 2025

Fixes TOOL-3381


PR-Codex overview

This PR focuses on exposing the canClaim function for ERC20, ERC721, and ERC1155 drops, enhancing the claim verification process. It includes updates to related tests and modifies contract ABIs to support the new function.

Detailed summary

  • Added canClaim function to erc20, erc721, and erc1155 extensions.
  • Updated contract ABIs to include verifyClaim function.
  • Enhanced tests for claim verification in drop20.test.ts, drop721.test.ts, and drop1155.test.ts.
  • Modified FiatSteps.tsx to format text correctly.
  • Adjusted gas values in tests for consistency.

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

@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2025

🦋 Changeset detected

Latest commit: 159ffbf

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

@vercel
Copy link

vercel bot commented Feb 12, 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 12, 2025 7:58am
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 7:58am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 7:58am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 7:58am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 7:58am

@github-actions github-actions bot added Playground Changes involving the Playground codebase. packages SDK Involves changes to the thirdweb SDK labels Feb 12, 2025
Copy link
Member Author


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.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@linear
Copy link

linear bot commented Feb 12, 2025

@joaquim-verges joaquim-verges marked this pull request as ready for review February 12, 2025 00:00
@joaquim-verges joaquim-verges requested review from a team and jnsdls as code owners February 12, 2025 00:00
* @example
* ```ts
* import { decodeVerifyClaimResult } from "thirdweb/extensions/erc20";
* const result = decodeVerifyClaimResultResult("...");
Copy link
Contributor

Choose a reason for hiding this comment

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

The example code shows decodeVerifyClaimResultResult but the actual function name is decodeVerifyClaimResult. The extra "Result" suffix should be removed from the example for accuracy.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 46.3 KB (+0.19% 🔺) 926 ms (+0.19% 🔺) 3 s (-19.7% 🔽) 3.9 s
thirdweb (cjs) 121.89 KB (+0.03% 🔺) 2.5 s (+0.03% 🔺) 7 s (+11.8% 🔺) 9.4 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 112 ms (0%) 436 ms (+22.24% 🔺) 548 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 118 ms (-17.08% 🔽) 128 ms
thirdweb/react (minimal + tree-shaking) 19.29 KB (+0.02% 🔺) 386 ms (+0.02% 🔺) 871 ms (+53.64% 🔺) 1.3 s

Copy link
Member

@jnsdls jnsdls left a comment

Choose a reason for hiding this comment

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

LGTM except for lint and test failures and the AI has some feedback for you, too

@codecov
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 94.59459% with 8 lines in your changes missing coverage. Please review.

Project coverage is 56.90%. Comparing base (0c1bb6c) to head (159ffbf).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/transaction/extract-error.ts 66.66% 4 Missing ⚠️
...irdweb/src/extensions/erc20/drops/read/canClaim.ts 94.23% 3 Missing ⚠️
...eb/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6234      +/-   ##
==========================================
+ Coverage   56.81%   56.90%   +0.09%     
==========================================
  Files        1163     1166       +3     
  Lines       64342    64475     +133     
  Branches     5213     5224      +11     
==========================================
+ Hits        36556    36692     +136     
+ Misses      27057    27056       -1     
+ Partials      729      727       -2     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 0c1bb6c
packages 55.12% <94.59%> (+0.11%) ⬆️

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

Files with missing lines Coverage Δ
...dweb/src/extensions/erc1155/drops/read/canClaim.ts 100.00% <100.00%> (ø)
...rdweb/src/extensions/erc721/drops/read/canClaim.ts 100.00% <100.00%> (ø)
...eb/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx 4.57% <0.00%> (+<0.01%) ⬆️
...irdweb/src/extensions/erc20/drops/read/canClaim.ts 94.23% <94.23%> (ø)
packages/thirdweb/src/transaction/extract-error.ts 88.88% <66.66%> (+5.25%) ⬆️

... and 6 files with indirect coverage changes

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 12, 2025

Merge activity

Fixes TOOL-3381

<!--

## 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 focuses on exposing the `canClaim` extension function for ERC20, ERC721, and ERC1155 drops, allowing for better claim verification and improving the overall functionality of the drops system.

### Detailed summary
- Added `canClaim` function to `erc20`, `erc721`, and `erc1155` extensions.
- Updated tests to include `canClaim` functionality.
- Modified JSON ABI files to include `verifyClaim` function.
- Adjusted gas values in tests.
- Enhanced error handling in `extract-error.ts`.

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

packages Playground Changes involving the Playground codebase. SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants