Skip to content

fix: normalize address keys to lowercase in relations config#1107

Open
Kubudak90 wants to merge 2 commits into
compound-finance:mainfrom
Kubudak90:fix-address-case-sensitivity
Open

fix: normalize address keys to lowercase in relations config#1107
Kubudak90 wants to merge 2 commits into
compound-finance:mainfrom
Kubudak90:fix-address-case-sensitivity

Conversation

@Kubudak90

Copy link
Copy Markdown

Fixes #765. Spider.ts expects address keys in relations.ts to be lowercase, but users may provide checksummed addresses. This change normalizes all address keys to lowercase in getRelationConfig() to ensure case-insensitive matching.

The fix uses ethers.utils.isAddress() to detect address keys and converts them to lowercase while preserving non-address keys (like contract names).

Kubudak90 added 2 commits April 7, 2026 01:59
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.
Fixes compound-finance#765. Spider.ts expects address keys in relations.ts to be lowercase,
but users may provide checksummed addresses. This change normalizes all
address keys to lowercase in getRelationConfig() to ensure case-insensitive
matching.

The fix uses ethers.utils.isAddress() to detect address keys and converts
them to lowercase while preserving non-address keys (like contract names).
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.

Addresses in relations.ts should be case-insensitive

1 participant