Skip to content

Cleanup all remaining ERC-20 mentions in token-gating (files, enums, hooks, translation keys) #2434

Description

@coderabbitai

Summary

This issue tracks all remaining ERC-20 / ERC-721 naming references that were not fully cleaned up as part of #2267 (Refactor/dispute-kit-registry). The gate token is now NFT-only, so every identifier, file name, enum value, translation key, and UI string that still references ERC-20 or the combined ERC-20/ERC-721 terminology must be updated.

Full Scope

1. File rename

Current path Suggested new path
web/src/components/DisputeFeatures/Features/GatedErc20.tsx GatedNFT.tsx (or GatedErc721.tsx)

2. Enum value — web/src/dispute-kits/types.ts

  • Features.GatedErc20 = "gatedErc20"Features.GatedNFT = "gatedNFT" (or GatedErc721)
  • Update every reference to Features.GatedErc20 throughout the codebase (see below)

3. Component & symbol renames — web/src/components/DisputeFeatures/Features/GatedErc20.tsx

  • Component name GatedErc20GatedNFT
  • Default export on the last line
  • Import + FeatureUIs map entry in web/src/components/DisputeFeatures/Features/index.tsx (lines 15 and 53)

4. Hook & constant renames — web/src/hooks/useTokenAddressValidation.ts

  • ERC20_ERC721_ABIERC721_ABI / NFT_ABI
  • Exported hook useERC20ERC721ValidationuseNFTValidation (or useERC721Validation)
  • JSDoc on that hook: still says "valid ERC20 or ERC721 token" — update to "valid NFT (ERC-721)"
  • tokenType: "ERC-20 or ERC-721" (line 85) → tokenType: "NFT"
  • Update the caller in GatedErc20.tsx (line 46) once hook is renamed

5. Inline UI strings — web/src/components/DisputeFeatures/Features/GatedErc20.tsx

  • Line 52: "Validating ERC-20 or ERC-721 token...""Validating NFT..."
  • Line 54: "Valid ERC-20 or ERC-721 token""Valid NFT"

6. Translation key renames — all locale files (en, es, fr)

  • Key features.jurors_owning_erc20features.jurors_owning_nft
  • Update all call-sites that reference this translation key

7. Features.GatedErc20 references in other modules

File Lines
web/src/dispute-kits/disputeFeature.ts Lines 18, 59
web/src/dispute-kits/registry.ts Lines 65, 79

8. Test description string — web/src/dispute-kits/prepareArbitratorExtradata.test.ts

  • Line 37: it("encodes gated ERC20 dispute kit data", ...)it("encodes gated NFT dispute kit data", ...)

Context

Raised in PR #2267 by @kyrers who observed that an ERC-20 address still passes the balanceOf-based validation (since the ABI signature is identical for ERC-20 and ERC-721). @tractorss noted that a precise check via ERC-165 supportsInterface would tighten this but is out of scope, and that once the whitelist from #2246 is enforced the token-type validation may become redundant entirely.

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions