Perelyn-sama / yul_by_example

Code examples in Yul

Home Page:https://yul-by-example.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unchecked math.

0xfps opened this issue · comments

commented

How deadly is an unchecked math? Since every math in the assembly{} block is unchecked, what could go wrong?
See here.

    uint256 a = type(uint256).max;
    uint256 b = type(uint256).max / 2;

    assembly {
        let sum := add(a, b)
    }

    // What could go wrong 👀?