Bug Report
Cairo version: 2.16.1 (scarb 2.16.1)
Current behavior:
Hexadecimal input arguments (e.g., 0xff, 0xFF) are silently accepted and parsed as their decimal equivalent (255). While this is useful, the behavior is inconsistent across ZK compilers and not documented.
Expected behavior:
This behavior should be documented. If hex inputs are intentionally supported, document it as a feature. If not, reject with a clear error.
Steps to reproduce:
#[executable]
fn main(a: felt252) -> felt252 {
a + 1
}
scarb execute --arguments="0xff" --print-program-output
# Output: 256 (0xff = 255, 255+1 = 256)
scarb execute --arguments="0xFF" --print-program-output
# Output: 256 (case-insensitive)
scarb execute --arguments="0x100" --print-program-output
# Output: 257 (0x100 = 256)
Related code:
#[executable]
fn main(a: felt252) -> felt252 {
a + 1
}
Other information:
| Input |
Circom |
Noir |
Cairo |
Leo |
| 0xff |
Accepts (255) |
Accepts (255) |
❌ Accepts (255) |
Rejects |
| 0xFF |
Accepts (255) |
Accepts (255) |
❌ Accepts (255) |
Rejects |
Cairo, Circom, and Noir accept hex inputs. Leo rejects them. The inconsistency across compilers should at minimum be documented.
Bug Report
Cairo version: 2.16.1 (scarb 2.16.1)
Current behavior:
Hexadecimal input arguments (e.g.,
0xff,0xFF) are silently accepted and parsed as their decimal equivalent (255). While this is useful, the behavior is inconsistent across ZK compilers and not documented.Expected behavior:
This behavior should be documented. If hex inputs are intentionally supported, document it as a feature. If not, reject with a clear error.
Steps to reproduce:
Related code:
Other information:
Cairo, Circom, and Noir accept hex inputs. Leo rejects them. The inconsistency across compilers should at minimum be documented.