SCStudio
SCStudio copied to clipboard
number can be overflow when use "**"
in the following contract, the field "number" can be overflow when use function setnumber. And in the report, it doesn't find this issue
contract HelloWorld {
string name;
uint8 number;
constructor() public {
name = "Hello, World!";
}
function get() public view returns (string memory) {
return name;
}
function set(string memory n) public {
name = n;
}
function setnumber() public {
number = number ** 22;
}
}