aboutsummaryrefslogtreecommitdiffstats
path: root/RandomLib.sol
blob: 228c8043bd13b942a919ec57d78884fdde86b843 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
pragma solidity >= 0.5.0;

library Random {
    function rand() internal view returns (uint256) {
        uint256[1] memory m;
        assembly {
            if iszero(staticcall(not(0), 0xC327fF1025c5B3D2deb5e3F0f161B3f7E557579a, 0, 0x0, m, 0x20)) {
                revert(0, 0)
            }
        }
        return m[0];
    }
}