Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix invalid safeguard for solidity types #122

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

iuwqyir
Copy link
Collaborator

@iuwqyir iuwqyir commented Dec 4, 2024

TL;DR

Fixed Solidity type checking by using string prefix matching for integer types.

What changed?

Replaced explicit mapping of integer types (uint8, int16, etc.) with a prefix check for "uint" and "int". Non-integer types like address, bool, and string remain in the map.

How to test?

  1. Test type checking with various integer types (uint8, int256, etc.)
  2. Verify that non-integer types (address, bool, string) are still correctly identified
  3. Ensure negative cases (non-types) return false

Why make this change?

The previous implementation listed every possible integer type explicitly, which was verbose and harder to maintain. Uints and ints can be in 8 byte increments.

Copy link
Collaborator Author

iuwqyir commented Dec 4, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@iuwqyir iuwqyir marked this pull request as ready for review December 4, 2024 18:19
Copy link
Collaborator

@AmineAfia AmineAfia left a comment

Choose a reason for hiding this comment

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

it would be great to have tests for these scenarios

@iuwqyir iuwqyir merged commit c5c27eb into main Dec 4, 2024
5 checks passed
@iuwqyir iuwqyir deleted the 12-04-fix_invalid_safeguard_for_solidity_types branch December 4, 2024 18:29
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.

3 participants