Skip to content

Conversation

@RogerPodacter
Copy link
Member

@RogerPodacter RogerPodacter commented Nov 12, 2025

  • Modified the address validation method in Erc721EthscriptionsCollectionParser to be case-insensitive for Ethereum addresses.
  • Updated the description in the NameRegistry contract to clarify the purpose of the Ethscriptions name and allowed characters.
  • Enhanced metadata attributes to include the length of the name, improving the representation of domain characteristics.

Note

Makes Ethereum address validation case-insensitive and revises NameRegistry token/collection metadata (description and attributes).

  • Parser (app/models/erc721_ethscriptions_collection_parser.rb):
    • Address validation validate_address now accepts mixed-case hex via case-insensitive regex (/i), still normalizing to lowercase.
  • Contracts (contracts/src/NameRegistry.sol):
    • Token metadata (tokenURI):
      • Update description to "An Ethscriptions name".
      • Replace Name attribute with numeric Length attribute (display_type: number).
    • Collection metadata (contractURI):
      • Update description to specify allowed characters and max length.

Written by Cursor Bugbot for commit 423fd7c. This will update automatically on new commits. Configure here.

- Modified the address validation method in `Erc721EthscriptionsCollectionParser` to be case-insensitive for Ethereum addresses.
- Updated the description in the `NameRegistry` contract to clarify the purpose of the Ethscriptions name and allowed characters.
- Enhanced metadata attributes to include the length of the name, improving the representation of domain characteristics.
Copy link

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 updates the address validation and metadata descriptions in the Name Registry system. The changes make address validation case-insensitive and improve the clarity of metadata descriptions to better reflect the system's purpose.

  • Modified address validation in the Ruby parser to accept both lowercase and uppercase hex characters
  • Updated metadata descriptions to clarify the Ethscriptions name system and its character constraints
  • Changed token metadata attributes from displaying the name to displaying the name length as a numeric property

Reviewed Changes

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

File Description
contracts/src/NameRegistry.sol Updated token and contract metadata descriptions to clarify allowed characters and name constraints; changed attributes from displaying name to length
app/models/erc721_ethscriptions_collection_parser.rb Made address validation case-insensitive by adding the i flag to the regex pattern
Comments suppressed due to low confidence (2)

app/models/erc721_ethscriptions_collection_parser.rb:505

  • The validate_bytes32 method should also use case-insensitive matching (add /i flag) to be consistent with the updated validate_address method, as Ethereum hex strings can have uppercase characters (e.g., in EIP-55 checksummed addresses or other hex data).
  def validate_bytes32(value, field_name)
    unless value.is_a?(String) && value.match?(/\A0x[0-9a-f]{64}\z/)
      raise ValidationError, "Invalid bytes32 for #{field_name}: #{value}"
    end

app/models/erc721_ethscriptions_collection_parser.rb:530

  • The validate_bytes32_array method should also use case-insensitive matching (add /i flag) to be consistent with the updated validate_address method and the suggested fix for validate_bytes32.
      unless item.is_a?(String) && item.match?(/\A0x[0-9a-f]{64}\z/)
        raise ValidationError, "Invalid bytes32 in array: #{item}"
      end

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


def validate_address(value, field_name)
unless value.is_a?(String) && value.match?(/\A0x[0-9a-f]{40}\z/)
unless value.is_a?(String) && value.match?(/\A0x[0-9a-f]{40}\z/i)
Copy link

Choose a reason for hiding this comment

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

Bug: Inconsistent Case Sensitivity Bypasses Validation

The validate_address method now accepts case-insensitive addresses via the /i regex flag, but the zero address check on line 515 uses a case-sensitive string comparison. This allows uppercase or mixed-case variants of the zero address (like 0x0000000000000000000000000000000000000000 with capital letters) to bypass the zero address validation, even though they represent the same address. The check needs to compare the downcased value or normalize before comparing.

Fix in Cursor Fix in Web

@RogerPodacter RogerPodacter merged commit f4d16ea into evm-backend-demo Nov 12, 2025
8 checks passed
@RogerPodacter RogerPodacter deleted the fix_collections branch November 12, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants