NFTBridge
60,000 USDC
View results
Submission Details
Severity: low
Invalid

Incorrect Packing Length Calculation at cairoStringPack in Cairo library

Hello Arkproject,

The calculation of packedLen includes 1 + dataLen + 1 + 1, which seems to be hardcoded without proper explanation or justification. This might lead to incorrect packing of the string, especially if the string length is at the boundary of CAIRO_STR_LEN or if there is an unexpected edge case.

The use of magic numbers such as 0x20 (32 bytes) and 31 (CAIRO_STR_LEN) can make the code harder to understand and maintain. It is better to define these as constants with descriptive names.

Updates

Lead Judging Commences

n0kto Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational / Gas

Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.