Skip to content

[Feature] Hexadecimal input values (0xff) rejected while other compilers accept #29205

@chamitro

Description

@chamitro

🐛 Bug Report

Hexadecimal input values (e.g., 0xfffield) are rejected by Leo, while Circom, Noir, and Cairo all accept them and correctly interpret them as their decimal equivalent (255).

Steps to Reproduce

Code snippet to reproduce

program mutadiff_test.aleo {
    transition main(public a: field) -> field {
        return a + 1field;
    }
}
# Decimal — works
leo run main 255field
# Output: 256field ✓

# Hex — rejected!
leo run main 0xfffield
# Error

Stack trace & error message

Leo rejects the hex input with a parsing error.

Expected Behavior

Accept 0xff as decimal 255, consistent with Circom, Noir, and Cairo.

Cross-compiler comparison:

Input Circom Noir Cairo Leo
0xff Accepts (255) Accepts (255) Accepts (255) Rejects
0xFF Accepts (255) Accepts (255) Accepts (255) Rejects

Leo is the only compiler among the 4 tested that rejects hexadecimal inputs.

Your Environment

  • Leo Version: 3.5.0
  • Rust Version: 1.93.0
  • Computer OS: Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    🖥️ CLIAnything related to the Leo CLI.🚀 featureA new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions