Skip to main content

IRng

Git Source

This is a simple interface to allow DrawManager to interact with a Random Number Generator

Functions

requestedAtBlock

Returns the block number at which an rng request was made

function requestedAtBlock(uint32 rngRequestId) external returns (uint256);

Parameters

NameTypeDescription
rngRequestIduint32The RNG request id

Returns

NameTypeDescription
<none>uint256The block number at which the request was made

isRequestComplete

Returns whether the RNG request is complete and the random number is available

function isRequestComplete(uint32 rngRequestId) external view returns (bool);

Parameters

NameTypeDescription
rngRequestIduint32The RNG request id

Returns

NameTypeDescription
<none>boolTrue if the random number is available, false otherwise

isRequestFailed

Returns whether the RNG request failed

function isRequestFailed(uint32 rngRequestId) external view returns (bool);

Parameters

NameTypeDescription
rngRequestIduint32The RNG request id

Returns

NameTypeDescription
<none>boolTrue if the request failed, false otherwise

randomNumber

Returns the random number for a given request

function randomNumber(uint32 rngRequestId) external returns (uint256);

Parameters

NameTypeDescription
rngRequestIduint32The RNG request id

Returns

NameTypeDescription
<none>uint256The random number