-
Notifications
You must be signed in to change notification settings - Fork 619
[SDK] Update NATIVE_TOKEN_ADDRESS to checksummed address #7416
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
Conversation
Changed the NATIVE_TOKEN_ADDRESS constant to use the checksummed version as some services might have checks for it.
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
|
Caution Review failedThe pull request is closed. WalkthroughThe constant Changes
Suggested labels
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/thirdweb/src/constants/addresses.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.@(ts|tsx)`: Accept a typed 'props' object and export a named function (e.g., export function MyComponent()). Combine class names via 'cn', expose 'className' prop if useful. ...
**/*.@(ts|tsx): Accept a typed 'props' object and export a named function (e.g., export function MyComponent()).
Combine class names via 'cn', expose 'className' prop if useful.
Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
Local state or effects live inside; data fetching happens in hooks.
Merge class names with 'cn' from '@/lib/utils' to keep conditional logic readable.
Stick to design-tokens: background ('bg-card'), borders ('border-border'), muted text ('text-muted-foreground') etc.
Use the 'container' class with a 'max-w-7xl' cap for page width consistency.
Spacing utilities ('px-', 'py-', 'gap-*') are preferred over custom margins.
Responsive helpers follow mobile-first ('max-sm', 'md', 'lg', 'xl').
Never hard-code colors – always go through Tailwind variables.
Tailwind CSS is the styling system – avoid inline styles or CSS modules.
Prefix files with 'import "server-only";' so they never end up in the client bundle (for server-only code).
packages/thirdweb/src/constants/addresses.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
packages/thirdweb/src/constants/addresses.ts (2)
5-5: Verify the checksummed address format is standard.Please confirm that this specific checksummed format for the native token sentinel address is the standard used across the ecosystem.
What is the correct checksummed format for the Ethereum native token sentinel address 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee?
4-5: ```shell
#!/usr/bin/env bashDescription: Correctly search for all usages of NATIVE_TOKEN_ADDRESS and related patterns using globs
echo "=== Searching for NATIVE_TOKEN_ADDRESS usage ==="
rg -g '.ts' -g '.tsx' -n -A3 -B1 "NATIVE_TOKEN_ADDRESS"echo -e "\n=== Searching for hardcoded lowercase version of the native address ==="
rg -g '.ts' -g '.tsx' -n "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"echo -e "\n=== Searching for direct string comparisons with the constant ==="
rg -g '.ts' -g '.tsx' -n -E "(===\sNATIVE_TOKEN_ADDRESS|NATIVE_TOKEN_ADDRESS\s===)"echo -e "\n=== Searching for toLowerCase or toUpperCase operations around the constant ==="
rg -g '.ts' -g '.tsx' -n -C2 "(NATIVE_TOKEN_ADDRESS.*.toLowerCase|.toLowerCase.NATIVE_TOKEN_ADDRESS|NATIVE_TOKEN_ADDRESS..toUpperCase|.toUpperCase.*NATIVE_TOKEN_ADDRESS)"</details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
|
Some users might have equality checks somewhere, probably shouldn't do this on second thought |
Changed the NATIVE_TOKEN_ADDRESS constant to use the checksummed version as some services might have checks for it.
PR-Codex overview
This PR updates the
NATIVE_TOKEN_ADDRESSconstant to a new address format and modifies theisNativeTokenAddressfunction to usegetAddressfor comparison, ensuring address normalization.Detailed summary
NATIVE_TOKEN_ADDRESSfrom"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"to"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE".isNativeTokenAddressto usegetAddressfor both the inputaddressandNATIVE_TOKEN_ADDRESSfor case-insensitive comparison.Summary by CodeRabbit