Skip to content

chore: Apply remaining freedback from PR#195#201

Open
Y3drk wants to merge 8 commits intomainfrom
y3drk/chore/apply-remaining-freedback-from-pr195
Open

chore: Apply remaining freedback from PR#195#201
Y3drk wants to merge 8 commits intomainfrom
y3drk/chore/apply-remaining-freedback-from-pr195

Conversation

@Y3drk
Copy link
Copy Markdown
Member

@Y3drk Y3drk commented Apr 30, 2026

Lite PR → Apply remaining freedback from PR#195

Summary


Why


Testing

  • Ran typecheck, lint, and test commands locally to ensure that the migration didn't break anything, and later confirmed that in our CI workflow
  • Verified that the UI didn't break/change using a local and Vercel preview

Notes for Reviewer (Optional)


Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.

@Y3drk Y3drk self-assigned this Apr 30, 2026
Copilot AI review requested due to automatic review settings April 30, 2026 14:05
@Y3drk Y3drk added ensawards ENSAwards related javascript Pull requests that update javascript code labels Apr 30, 2026
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ensawards.org Ready Ready Preview, Comment May 5, 2026 10:48am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Warning

Rate limit exceeded

@Y3drk has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 34 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3bb043ba-3113-4fc8-bb6d-162af9fe5777

📥 Commits

Reviewing files that changed from the base of the PR and between 81c9d29 and 06ef437.

📒 Files selected for processing (4)
  • ensawards.org/data/protocols/contracts-types.ts
  • ensawards.org/src/components/atoms/badges/ContractBadge.tsx
  • ensawards.org/src/components/atoms/cards/ContractCard.astro
  • ensawards.org/src/components/ens-advocates/details-page-components/FetchAndDisplayAdvocateProfile.tsx
📝 Walkthrough

Walkthrough

The PR migrates ENS name/address types and values across the codebase: NameInterpretedName, raw ENS strings → asInterpretedName(...), and address types to NormalizedAddress. It also standardizes timestamps and USDC mock values using parseTimestamp and parseUsdc, and updates related UI prop typings and small UI render adjustments.

Changes

InterpretedName & NormalizedAddress Migration

Layer / File(s) Summary
Type definitions
ensawards.org/data/apps/types.ts, ensawards.org/data/protocols/types.ts, ensawards.org/data/protocols/contracts-types.ts, ensawards.org/src/components/atoms/cards/quoteCard/types.ts
Replace Name imports/uses with InterpretedName; update socials.ens and name typed fields accordingly.
Data shape / fixtures
ensawards.org/data/apps/*, ensawards.org/data/protocols/*/index.ts, ensawards.org/data/protocols/*/contracts.ts, ensawards.org/src/components/mocks/*, ensawards.org/src/contract-pipelines/contractsTestData.ts, ensawards.org/src/pages/advocate/index.astro
Wrap previously plain ENS string literals with asInterpretedName("...") across apps, protocols, contract cached identities, mock data, and example advocates.
Core helpers / utils
ensawards.org/src/utils/resolution.ts, ensawards.org/src/utils/index.ts
Change function/type signatures to return/accept NormalizedAddress where appropriate (e.g., resolveEthAddress), update JSDoc and casts to NormalizedAddress.
Component prop typings
ensawards.org/src/components/.../FetchAndDisplayAdvocateProfileWithName.tsx, ensawards.org/src/components/atoms/badges/ContractBadge.tsx, ensawards.org/src/components/atoms/SmartContractMetadata.tsx, various advocate/referrer components
Update props/interfaces to use InterpretedName and NormalizedAddress; remove name prop from SmartContractMetadata.
UI rendering / wiring
ensawards.org/src/components/atoms/cards/ContractCard.astro, ensawards.org/src/components/atoms/cards/quoteCard/index.astro, ensawards.org/src/components/atoms/badges/ContractBadge.tsx, ensawards.org/src/components/ens-advocates/..., ensawards.org/src/components/referral-awards-program/ReferralLinkForm.tsx
Render ENS names via NameDisplay, pass undefined vs interpreted names to badges conditionally, normalize addresses for routing (toNormalizedAddress), and add try/catch when interpreting names from network data.
Mocks, timestamps & amounts
ensawards.org/src/components/mocks/*, ensawards.org/src/components/referral-awards-program/referrals/utils.test.ts, ensawards.org/src/components/mocks/referrers-leaderboard/data.tsx
Replace numeric Unix timestamps with parseTimestamp("..."); replace USDC object literals with parseUsdc("..."); switch mock name constructions to asInterpretedName(...).
Tests & messages
ensawards.org/data/apps/index.test.ts, ensawards.org/data/protocols/index.test.ts, ensawards.org/data/protocols/contracts.test.ts
Adjust test expectation messages and primary-name comparison to reinterpret names (reinterpretName(asInterpretedName(...))) where applicable.
Documentation
CONTRIBUTING.md
Update TypeScript examples in docs to show ens?: InterpretedName instead of ens?: Name.

Sequence Diagram(s)

(omitted — changes are primarily type/data migrations and UI typing updates without a new multi-component sequential control flow)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • namehash/ensawards#160 — Adds the same app/protocol entries (e.g., Blockscout / Arbitrum) that are now migrated to InterpretedName here.
  • namehash/ensawards#175 — Related migration work on SSV Network protocol files that this PR also updates to use asInterpretedName.
  • namehash/ensawards#186 — Introduces walletchan-wallet app data which this PR converts from plain ENS strings to asInterpretedName(...).

Poem

🐰 Hopping through code with a nibble and grin,

I wrap ENS names so they’re tidy and thin,
Interpreted and typed, not plain text today,
Normalized addresses lead the right way,
A happy rabbit hops off — type-safe, hooray!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: Apply remaining freedback from PR#195' is directly related to the changeset—it describes applying remaining feedback from a prior PR, which matches the documented objectives and description.
Description check ✅ Passed The description is related to the changeset, explaining that it applies remaining feedback from PR#195, fixes mobile layout, and created follow-up issues. It clearly conveys the changeset's intent and context.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch y3drk/chore/apply-remaining-freedback-from-pr195

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…rk/chore/apply-remaining-freedback-from-pr195
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR applies remaining follow-ups from PR #195 by aligning name/address typing with enssdk (InterpretedName / NormalizedAddress), updating mocks/tests to use SDK parsers (parseUsdc, parseTimestamp), and making a small mobile layout fix to the referral link form.

Changes:

  • Migrate various Name-typed fields and literals to InterpretedName using asInterpretedName(...) across UI + data files.
  • Update mocks/tests to use parseUsdc(...) and parseTimestamp(...) for consistent currency/timestamp modeling.
  • Fix referral link form mobile sizing and do small naming cleanups for EnsNode provider options.

Reviewed changes

Copilot reviewed 53 out of 53 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ensawards.org/src/utils/resolution.ts Updates resolveEthAddress typing/docs to NormalizedAddress.
ensawards.org/src/pages/advocate/index.astro Switches example advocate names to InterpretedName via asInterpretedName.
ensawards.org/src/contract-pipelines/contractsTestData.ts Converts contract test ENS names to asInterpretedName.
ensawards.org/src/components/referral-awards-program/referrals/utils.test.ts Uses parseTimestamp and asInterpretedName in referral qualification tests.
ensawards.org/src/components/referral-awards-program/ReferralLinkForm.tsx Refactors name normalization variables + adjusts max width for mobile layout.
ensawards.org/src/components/mocks/referrers-leaderboard/data.tsx Uses parseUsdc for award pool/money fields + renames mock admin action vars.
ensawards.org/src/components/mocks/referrers-leaderboard/MockDisplayReferrerLeaderboardPage.tsx Renames provider options variable for clarity/consistency.
ensawards.org/src/components/mocks/referral-program-editions/data.ts Uses parseUsdc for mock edition rule amounts.
ensawards.org/src/components/mocks/referral-live-feed/data.ts Uses asInterpretedName for mock registrar action names.
ensawards.org/src/components/ens-advocates/details-page-components/advocate-profile/FetchAndDisplayAdvocateProfileWithName.tsx Updates prop type from Name to InterpretedName.
ensawards.org/src/components/ens-advocates/details-page-components/FetchAndDisplayAdvocateReferrals.tsx Aligns Address type import to enssdk (not viem).
ensawards.org/src/components/ens-advocates/details-page-components/FetchAndDisplayAdvocateProfile.tsx Wraps usePrimaryName result with asInterpretedName for downstream typing.
ensawards.org/src/components/ens-advocates/AdvocateSearchForm.tsx Aligns Address type import to enssdk (keeps viem validation).
ensawards.org/src/components/atoms/cards/quoteCard/types.ts Updates quote author name type to InterpretedName.
ensawards.org/src/components/atoms/cards/quoteCard/data.ts Converts static quote author names to asInterpretedName.
ensawards.org/src/components/atoms/cards/ContributorsCard.tsx Renames provider options variable for consistency.
ensawards.org/src/components/atoms/cards/ContractCard.astro Avoids passing name when unnamed; removes unused name prop from metadata component usage.
ensawards.org/src/components/atoms/badges/ContractBadge.tsx Updates name prop type to InterpretedName and adjusts helper signature formatting.
ensawards.org/src/components/atoms/SmartContractMetadata.tsx Removes unused name prop and DRYs repeated “Learn more” link into a component.
ensawards.org/data/protocols/uniswap-defi/index.ts Converts protocol socials.ens to asInterpretedName.
ensawards.org/data/protocols/uniswap-dao/index.ts Converts protocol socials.ens to asInterpretedName.
ensawards.org/data/protocols/uniswap-dao/contracts.ts Converts cached contract name values to asInterpretedName.
ensawards.org/data/protocols/types.ts Updates protocol socials.ens type to InterpretedName.
ensawards.org/data/protocols/taiko-defi/index.ts Converts protocol socials.ens to asInterpretedName.
ensawards.org/data/protocols/taiko-defi/contracts.ts Converts cached contract name values to asInterpretedName.
ensawards.org/data/protocols/taiko-dao/index.ts Converts protocol socials.ens to asInterpretedName.
ensawards.org/data/protocols/taiko-dao/contracts.ts Converts cached contract name values to asInterpretedName.
ensawards.org/data/protocols/ssvnetwork-dao/index.ts Converts protocol socials.ens to asInterpretedName.
ensawards.org/data/protocols/ssvnetwork-dao/contracts.ts Converts cached contract name values to asInterpretedName.
ensawards.org/data/protocols/nouns-dao/index.ts Converts protocol socials.ens to asInterpretedName.
ensawards.org/data/protocols/nouns-dao/contracts.ts Converts cached contract name values to asInterpretedName.
ensawards.org/data/protocols/liquity-defi/index.ts Converts protocol socials.ens to asInterpretedName.
ensawards.org/data/protocols/liquity-defi/contracts.ts Converts cached contract name values to asInterpretedName.
ensawards.org/data/protocols/index.test.ts Improves failure message for invalid interpreted names.
ensawards.org/data/protocols/giveth-defi/index.ts Converts protocol socials.ens to asInterpretedName.
ensawards.org/data/protocols/giveth-defi/contracts.ts Converts cached contract name values to asInterpretedName.
ensawards.org/data/protocols/ens-dao/index.ts Converts protocol socials.ens to asInterpretedName.
ensawards.org/data/protocols/ens-dao/contracts.ts Converts cached contract name values to asInterpretedName.
ensawards.org/data/protocols/cork-defi/index.ts Converts protocol socials.ens to asInterpretedName.
ensawards.org/data/protocols/cork-defi/contracts.ts Converts cached contract name values to asInterpretedName.
ensawards.org/data/protocols/contracts.test.ts Adds clarifying comments + improves invalid name error message.
ensawards.org/data/protocols/contracts-types.ts Updates contract identity name fields to InterpretedName.
ensawards.org/data/protocols/arbitrum-dao/index.ts Converts protocol socials.ens to asInterpretedName.
ensawards.org/data/protocols/aave-dao/index.ts Converts protocol socials.ens to asInterpretedName.
ensawards.org/data/apps/walletchan-wallet/index.ts Converts app socials.ens to asInterpretedName.
ensawards.org/data/apps/types.ts Updates app socials.ens type to InterpretedName.
ensawards.org/data/apps/rainbow-wallet/index.ts Converts app socials.ens to asInterpretedName.
ensawards.org/data/apps/metamask-wallet/index.ts Converts app socials.ens to asInterpretedName.
ensawards.org/data/apps/index.test.ts Improves failure message for invalid interpreted names.
ensawards.org/data/apps/etherscan-explorer/index.ts Converts app socials.ens to asInterpretedName.
ensawards.org/data/apps/coinbase-wallet/index.ts Converts app socials.ens to asInterpretedName.
ensawards.org/data/apps/blockscout-explorer/index.ts Converts app socials.ens to asInterpretedName.
CONTRIBUTING.md Updates documentation snippets to reflect InterpretedName in socials.ens.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ensawards.org/src/utils/resolution.ts
Comment thread ensawards.org/src/components/referral-awards-program/ReferralLinkForm.tsx Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ensawards.org/src/components/ens-advocates/AdvocateSearchForm.tsx (1)

52-64: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use a real disabled state for the empty form.

aria-disabled alone doesn't stop interaction here, so the submit button can still be focused and activated when the field is empty. Add the native disabled state so the affordance matches the behavior.

♿ Proposed fix
         <button
           type="submit"
+          disabled={rawInputAddress.length === 0}
           aria-disabled={rawInputAddress.length === 0}
           className={cn(
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ensawards.org/src/components/ens-advocates/AdvocateSearchForm.tsx` around
lines 52 - 64, The submit button in AdvocateSearchForm.tsx uses aria-disabled
but remains interactive; change the button to use the native disabled attribute
when rawInputAddress.length === 0 (e.g., add disabled={rawInputAddress.length
=== 0}), keep aria-disabled if you want the ARIA state but ensure the
CSS/variants reflect the disabled state (adjust shadcnButtonVariants or
className to show disabled cursor/opacity when disabled) so the button is truly
non-interactive and visually disabled.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@ensawards.org/src/components/ens-advocates/AdvocateSearchForm.tsx`:
- Around line 52-64: The submit button in AdvocateSearchForm.tsx uses
aria-disabled but remains interactive; change the button to use the native
disabled attribute when rawInputAddress.length === 0 (e.g., add
disabled={rawInputAddress.length === 0}), keep aria-disabled if you want the
ARIA state but ensure the CSS/variants reflect the disabled state (adjust
shadcnButtonVariants or className to show disabled cursor/opacity when disabled)
so the button is truly non-interactive and visually disabled.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c610166c-0d0f-44b2-86af-4ae37162f808

📥 Commits

Reviewing files that changed from the base of the PR and between 80b9c80 and 79877b0.

📒 Files selected for processing (53)
  • CONTRIBUTING.md
  • ensawards.org/data/apps/blockscout-explorer/index.ts
  • ensawards.org/data/apps/coinbase-wallet/index.ts
  • ensawards.org/data/apps/etherscan-explorer/index.ts
  • ensawards.org/data/apps/index.test.ts
  • ensawards.org/data/apps/metamask-wallet/index.ts
  • ensawards.org/data/apps/rainbow-wallet/index.ts
  • ensawards.org/data/apps/types.ts
  • ensawards.org/data/apps/walletchan-wallet/index.ts
  • ensawards.org/data/protocols/aave-dao/index.ts
  • ensawards.org/data/protocols/arbitrum-dao/index.ts
  • ensawards.org/data/protocols/contracts-types.ts
  • ensawards.org/data/protocols/contracts.test.ts
  • ensawards.org/data/protocols/cork-defi/contracts.ts
  • ensawards.org/data/protocols/cork-defi/index.ts
  • ensawards.org/data/protocols/ens-dao/contracts.ts
  • ensawards.org/data/protocols/ens-dao/index.ts
  • ensawards.org/data/protocols/giveth-defi/contracts.ts
  • ensawards.org/data/protocols/giveth-defi/index.ts
  • ensawards.org/data/protocols/index.test.ts
  • ensawards.org/data/protocols/liquity-defi/contracts.ts
  • ensawards.org/data/protocols/liquity-defi/index.ts
  • ensawards.org/data/protocols/nouns-dao/contracts.ts
  • ensawards.org/data/protocols/nouns-dao/index.ts
  • ensawards.org/data/protocols/ssvnetwork-dao/contracts.ts
  • ensawards.org/data/protocols/ssvnetwork-dao/index.ts
  • ensawards.org/data/protocols/taiko-dao/contracts.ts
  • ensawards.org/data/protocols/taiko-dao/index.ts
  • ensawards.org/data/protocols/taiko-defi/contracts.ts
  • ensawards.org/data/protocols/taiko-defi/index.ts
  • ensawards.org/data/protocols/types.ts
  • ensawards.org/data/protocols/uniswap-dao/contracts.ts
  • ensawards.org/data/protocols/uniswap-dao/index.ts
  • ensawards.org/data/protocols/uniswap-defi/index.ts
  • ensawards.org/src/components/atoms/SmartContractMetadata.tsx
  • ensawards.org/src/components/atoms/badges/ContractBadge.tsx
  • ensawards.org/src/components/atoms/cards/ContractCard.astro
  • ensawards.org/src/components/atoms/cards/ContributorsCard.tsx
  • ensawards.org/src/components/atoms/cards/quoteCard/data.ts
  • ensawards.org/src/components/atoms/cards/quoteCard/types.ts
  • ensawards.org/src/components/ens-advocates/AdvocateSearchForm.tsx
  • ensawards.org/src/components/ens-advocates/details-page-components/FetchAndDisplayAdvocateProfile.tsx
  • ensawards.org/src/components/ens-advocates/details-page-components/FetchAndDisplayAdvocateReferrals.tsx
  • ensawards.org/src/components/ens-advocates/details-page-components/advocate-profile/FetchAndDisplayAdvocateProfileWithName.tsx
  • ensawards.org/src/components/mocks/referral-live-feed/data.ts
  • ensawards.org/src/components/mocks/referral-program-editions/data.ts
  • ensawards.org/src/components/mocks/referrers-leaderboard/MockDisplayReferrerLeaderboardPage.tsx
  • ensawards.org/src/components/mocks/referrers-leaderboard/data.tsx
  • ensawards.org/src/components/referral-awards-program/ReferralLinkForm.tsx
  • ensawards.org/src/components/referral-awards-program/referrals/utils.test.ts
  • ensawards.org/src/contract-pipelines/contractsTestData.ts
  • ensawards.org/src/pages/advocate/index.astro
  • ensawards.org/src/utils/resolution.ts

Comment thread ensawards.org/src/components/mocks/referral-live-feed/data.ts Outdated
@Y3drk Y3drk marked this pull request as ready for review April 30, 2026 14:29
@Y3drk Y3drk requested a review from a team as a code owner April 30, 2026 14:29
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 30, 2026

Greptile Summary

This PR applies the remaining feedback from PR#195, systematically migrating NameInterpretedName and AddressNormalizedAddress throughout the codebase, replacing raw string/bigint literals with typed constructor calls (asInterpretedName, toNormalizedAddress, parseTimestamp, parseUsdc), and fixing a mobile overflow issue in ReferralLinkForm.

  • Type tightening across ~60 files: All Name fields in data, component props, and utilities are now InterpretedName; all Address types in component interfaces and utilities are now NormalizedAddress, enforcing stricter type constraints at every API boundary.
  • Utility adoption: Raw string casts like \"name.eth\" as InterpretedName are replaced by validated asInterpretedName(\"name.eth\") calls; raw number timestamps and raw bigint USDC amounts are replaced by parseTimestamp() and parseUsdc() helpers, eliminating silent miscalculations.
  • ReferralLinkForm mobile fix: min-w-1/2 max-w-[600px] replaced with max-w-[calc(100vw-40px)] sm:max-w-[600px] to prevent the form from overflowing the viewport on narrow screens.

Confidence Score: 5/5

This PR is safe to merge — all changes are mechanical type tightening, utility-constructor adoption, and a well-bounded mobile layout fix with no new logic paths that could regress.

Every changed file applies one of three well-understood transformations: replacing bare literals with validated constructors, narrowing type aliases, or extracting duplicated JSX. No new async paths, state machines, or data-flow branches are introduced, and CI passes.

No files require special attention — the changes are uniform and low-risk across all 60 files.

Important Files Changed

Filename Overview
ensawards.org/src/components/referral-awards-program/ReferralLinkForm.tsx Mobile overflow fix (max-w-[calc(100vw-40px)]) and address normalization via toNormalizedAddress before buildEnsReferralUrl; clean changes.
ensawards.org/data/protocols/contracts.test.ts Primary name test now checks for null before comparing and uses reinterpretName(asInterpretedName(name)) for consistent interpretation; also adds a follow-up issue link for the address typecast.
ensawards.org/src/components/atoms/cards/ContractCard.astro Applies beautifyName before breakLongWords to fix the previously identified display issue; uses NameDisplay for the desktop name link and correctly threads name prop into ContractBadge.
ensawards.org/src/components/atoms/badges/ContractBadge.tsx Name prop promoted to InterpretedName; runtime invariant guards added for ForwardNamed/PrimaryNamed; NameDisplay used in tooltip content.
ensawards.org/src/components/atoms/SmartContractMetadata.tsx Removes unused name prop, extracts repeated anchor markup into a LearnMoreLink component, and fixes the import path.
ensawards.org/src/components/ens-advocates/details-page-components/FetchAndDisplayAdvocateProfile.tsx Adds try/catch around asInterpretedName + reinterpretName to gracefully handle non-interpretable primary names with a descriptive ErrorInfo display, addressing prior review feedback.
ensawards.org/src/components/mocks/referral-live-feed/data.ts Replaces raw timestamp numbers and string casts with parseTimestamp/asInterpretedName; also renames the mock label prefix from camelCase to kebab-case to ensure ENSIP-15 validity.
ensawards.org/src/components/mocks/referrers-leaderboard/data.tsx All raw USDC bigints replaced with parseUsdc(), timestamps with parseTimestamp(), and local variable names simplified.
ensawards.org/src/pages/advocate/index.astro EXAMPLE_ADVOCATES entries now use asInterpretedName and toNormalizedAddress constructors; NameDisplay used for rendering the example advocate link labels.
ensawards.org/src/utils/resolution.ts Return type narrowed from Address to NormalizedAddress, with a follow-up issue link added next to the typecast.

Reviews (5): Last reviewed commit: "Apply ai assistant's suggestions, pt.4" | Re-trigger Greptile

Comment thread ensawards.org/src/components/mocks/referrers-leaderboard/data.tsx
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 53 out of 53 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ensawards.org/src/components/mocks/referrers-leaderboard/data.tsx
Copy link
Copy Markdown
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@Y3drk Thanks for this! Great to see the updates. There's a few more opportunities for refinement here. Thanks 👍

Comment thread ensawards.org/src/components/atoms/badges/ContractBadge.tsx Outdated
) => {
switch (resolutionStatus) {
case ContractResolutionStatusIds.ForwardNamed:
return (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I note the following line of code below:

{ensName} successfully resolves to this contract, but this contract does not have an{" "}

We should avoid ever directly taking ENS names and displaying them in UIs as strings without processing that converts them into "beautified" display form. The best practice for this is implemented inside one of our namehash-ui components if I remember correctly? I think we have a UI component such as "DisplayName" or something like that?

Please apply this idea to all the relevant places 👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Applied the idea in:

  • ContractBadge
  • QuoteCard (@/components/atoms/cards/quoteCard/index.astro)
  • ContractCard
  • Advocate Details search page (currently not publicly linked/advertised)

Comment thread ensawards.org/src/components/ens-advocates/AdvocateSearchForm.tsx Outdated
@@ -1,6 +1,7 @@
import type { ReferralProgramEditionSummary } from "@namehash/ens-referrals";
import { type Address } from "enssdk";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please review any use of Address anywhere across the code in ENSAwards. Unless there's a special situation all of these should become NormalizedAddress. Please review each case and ensure our logic is correct. Thanks.

Note that all addresses returned by ENSNode APIs are guaranteed to always be NormalizedAddress.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changed from using Address to NormalizedAddress in:

  • AdvocateSearchForm
  • Shared sub-components of ReferrerCard
  • Components related to fetching & displaying the Advocate details page
  • RegistrarActionsList
  • getEnsAdvocateDetailsRelativePath helper function

Plus, adjusted the ReferralLinkForm component to always use normalized addresses when building the referral link.

Comment thread ensawards.org/src/components/referral-awards-program/ReferralLinkForm.tsx Outdated
Comment thread ensawards.org/src/contract-pipelines/contractsTestData.ts Outdated
{
name: "vitalik.eth",
name: asInterpretedName("vitalik.eth"),
ethAddress: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I expect data contributors are going to mess up making these addresses to be NormalizedAddress in many cases and it's difficult for our eyes to manually catch the case that some hex digits are uppercase.

I note here how some of the hex digits here are uppercase and therefore it's not appropriate to call this a NormalizedAddress.

I would also note how there's technical reasons in Ponder for why Matt didn't make NormalizedAddress as strictly implemented as InterpretedName is from a type-system perspective (with type branding, etc..).

Perhaps we should revisit this? Matt is very busy now and we shouldn't distract him with these questions for now, but I suggest sometime next week to raise this question with him and see what he thinks. I believe we need to implement the same formalities around NormalizedAddress as we implemented for InterpretedName and that we need utility functions such as asNormalizedAddress which would then guarantee the value returned is a NormalizedAddress.

This would then also allow us to remove the unit tests in ENSAwards that complain if a user's raw input address is not all in lowercase. I think maybe you defined some tests like this? But note how it's easy to miss the need to do this because for example the hardcoded address here is in mixed case, not all lowercase (normalized form).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@lightwalker-eth

  • For now, in this specific component, I simply use the toNormalizedAddress helper function.
  • And yes, we have unit tests in place that check whether all addresses in data are normalized. At the same time, as you said, it's easy to miss any potential mistakes in user-facing examples like here.

Also created a follow-up issue to log the need to discuss that → namehash/ensnode#2053

// or the name is not a valid ENS interpreted name,
// display a UI based just on the address
if (data.name === null) return <AdvocateProfileWithoutName address={address} />;
if (data.name === null || !isInterpretedName(data.name))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should change our strategy here.

ENSNode guarantees that all names it returns in its APIs are a valid InterpretedName. However it should be noted that it's not proper for an ENSNode client such as ENSAwards to then just assume it's correct to type the name values it receives as an InterpretedName and be done with it. No, the problem with this is that InterpretedName depends on ens-normalize, and ens-normalize can change across time. The version of ens-normalize on the server can be different than the version of ens-normalize on the server and this can cause errors to be thrown on clients if they mistakingly make this assumption.

The complete solution to this is that whenever an ENSNode client receives an InterpretedName in an API response from ENSNode, it should call reinterpretName (I think this is what the utility function is called, please check in enssdk) on that value. This will solve for the edge case that the client and server have different versions of ens-normalize.

If any questions please let me know 👍

Copy link
Copy Markdown
Member Author

@Y3drk Y3drk May 5, 2026

Choose a reason for hiding this comment

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

@lightwalker-eth

Refactored this and other similar use case in ensawards.org/data/protocols/contracts.test.ts according to the new strategy guidelines.

I am completely sure that this approach is necessary in those two places (direct use of our api/resolve/primary-name endpoint).

I am not sure about the places where we use our other API endpoints (useRegistrarActions or useResolvedIdentity) to simply display the name on the UI and not perform any additional actions on it. Appreciate your advice regarding such cases, and please let me know if I misunderstood something.

Comment thread ensawards.org/src/components/atoms/cards/ContractCard.astro
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a 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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ensawards.org/src/components/atoms/badges/ContractBadge.tsx`:
- Around line 36-38: The current early return checks name === undefined before
resolutionStatus, causing unresolved identities without a name to show the
"unnamed" tooltip; update the logic in ContractBadge (where name,
resolutionStatus, unnamedContractContent, and unresolvedContractContent are
used) to check resolutionStatus === 'Unresolved' (or the equivalent unresolved
enum/value) first and return unresolvedContractContent for that case, and only
if not unresolved then fall back to the name === undefined check to return
unnamedContractContent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9d3c53ec-d89f-4f3f-af71-bd8eff888407

📥 Commits

Reviewing files that changed from the base of the PR and between 79877b0 and 81c9d29.

📒 Files selected for processing (20)
  • ensawards.org/data/protocols/contracts.test.ts
  • ensawards.org/data/shared/test-utils.ts
  • ensawards.org/src/components/atoms/badges/ContractBadge.tsx
  • ensawards.org/src/components/atoms/cards/ContractCard.astro
  • ensawards.org/src/components/atoms/cards/quoteCard/index.astro
  • ensawards.org/src/components/atoms/cards/referrerCard/shared.tsx
  • ensawards.org/src/components/ens-advocates/AdvocateSearchForm.tsx
  • ensawards.org/src/components/ens-advocates/EnsAdvocateDetailsPageProvider.tsx
  • ensawards.org/src/components/ens-advocates/details-page-components/FetchAndDisplayAdvocateProfile.tsx
  • ensawards.org/src/components/ens-advocates/details-page-components/FetchAndDisplayAdvocateReferrals.tsx
  • ensawards.org/src/components/ens-advocates/details-page-components/advocate-profile/AdvocateProfileWithoutName.tsx
  • ensawards.org/src/components/ens-advocates/details-page-components/advocate-profile/FetchAndDisplayAdvocateProfileWithName.tsx
  • ensawards.org/src/components/mocks/referral-live-feed/data.ts
  • ensawards.org/src/components/mocks/referral-program-editions/data.ts
  • ensawards.org/src/components/mocks/referrers-leaderboard/data.tsx
  • ensawards.org/src/components/referral-awards-program/ReferralLinkForm.tsx
  • ensawards.org/src/components/referral-awards-program/referrals/RegistrarActionsList.tsx
  • ensawards.org/src/contract-pipelines/contractsTestData.ts
  • ensawards.org/src/pages/advocate/index.astro
  • ensawards.org/src/utils/index.ts

Comment thread ensawards.org/src/components/atoms/badges/ContractBadge.tsx Outdated
Copilot AI review requested due to automatic review settings May 5, 2026 10:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 60 out of 60 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ensawards.org/data/protocols/contracts-types.ts
Comment thread ensawards.org/data/protocols/contracts-types.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ensawards ENSAwards related javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants