Skip to content

Conversation

@famouswizard
Copy link

PR Scope

Fix address precision issue by switching to BigInt in _hasPermission.

Description

Replaced parseInt(address, 16) with BigInt(address) and updated all bitwise operations to use BigInt (1n << BigInt(...)).
The old logic was truncating 160-bit addresses to 32 bits, causing precision loss.
Now the full address is handled correctly with no cutoff.

How Has This Been Tested?

Tested locally with multiple addresses - verified that permission checks now return correct results for large values.

Are there any breaking changes?

No breaking changes expected - only improved precision in address handling.

(Optional) Feedback Focus

Double-check that BigInt usage aligns with the rest of the codebase and doesn’t impact performance in permission-heavy calls.

(Optional) Follow Ups

Might be worth reviewing other places where addresses are parsed or masked with bitwise ops to ensure consistency.

@famouswizard famouswizard requested review from a team as code owners October 18, 2025 11:06
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