Skip to content

fix: normalize address case in maybeStore function#1106

Open
Kubudak90 wants to merge 1 commit into
compound-finance:mainfrom
Kubudak90:main
Open

fix: normalize address case in maybeStore function#1106
Kubudak90 wants to merge 1 commit into
compound-finance:mainfrom
Kubudak90:main

Conversation

@Kubudak90

Copy link
Copy Markdown

Summary

Fixes a case-sensitivity bug in the function in where addresses were compared without normalizing case.

Problem

The function was comparing addresses case-sensitively when checking against :

This could cause issues when:

  1. An address is stored with checksum casing (e.g., )
  2. The comparison against (which is lowercase ) fails due to case mismatch

Solution

Normalize both addresses to lowercase before comparison:

This ensures consistent behavior regardless of how the address was originally formatted.

Testing

  • The fix is consistent with existing address comparison patterns in the codebase (e.g., line 43 already uses for address comparison)
  • No breaking changes to the API or behavior
  • Only affects edge case where addresses have different checksum casing

Related

This follows the same defensive programming pattern used elsewhere in the codebase, such as in where addresses are normalized before comparison.

The maybeStore function in Spider.ts was comparing addresses case-sensitively
when checking against constants.AddressZero. This could cause issues when
addresses have different checksum casing (e.g., 0xA0b86... vs 0xa0b86...).

This fix normalizes both addresses to lowercase before comparison, ensuring
consistent behavior regardless of how the address was originally formatted.

Fixes potential bug where an address stored with checksum casing wouldn't
match against AddressZero, causing incorrect alias storage behavior.
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.

1 participant