Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

number can be overflow when use operator "++" #3

Open
longdacao opened this issue Feb 2, 2021 · 1 comment
Open

number can be overflow when use operator "++" #3

longdacao opened this issue Feb 2, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@longdacao
Copy link

longdacao commented Feb 2, 2021

in the following contract, the field "number" can be overflow to 0 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++;
    }
}
@longdacao
Copy link
Author

same issue with operator "--"

@longdacao longdacao reopened this Feb 3, 2021
@vita-dounai vita-dounai added the enhancement New feature or request label Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants