Numeric constants are always detected as uint256
- Dominant language
- Python
- Stars
- 6.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
The Echidna printer in Slither fails to detect the correct type of number constants, for instance:
```solidity
contract C {
function f(int x) public returns (bool) {
if (x == 123)
return true;
return false;
}
}
```
Echidna should be detect `x`, at least, as an `int`, however:
```
INFO:Printers:{
"payable": {},
"timestamp": {},
"block_number": {},
"msg_sender": {},
"msg_gas": {},
"assert": {},
"constant_functions": {
"C": [
"f(int256)"
]
},
"constants_used": {
"C": {
"f(int256)": [
[
{
"value": "True",
"type": "bool"
}
],
[
{
"value": "False",
"type": "bool"
}
],
[
{
"value": "123",
"type": "uint256"
}
]
]
}
},
"constants_used_in_binary": {
"C": {
"f(int256)": {
"==": [
[
{
"value": "123",
"type": "uint256"
}
]
]
}
}
},
"functions_relations": {
"C": {
"f(int256)": {
"impacts": [],
"is_impacted_by": []
}
}
},
"constructors": {},
"have_external_calls": {},
"call_a_parameter": {},
"use_balance": {}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.