IRng
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
Name | Type | Description |
---|---|---|
rngRequestId | uint32 | The RNG request id |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The 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
Name | Type | Description |
---|---|---|
rngRequestId | uint32 | The RNG request id |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | True if the random number is available, false otherwise |
isRequestFailed
Returns whether the RNG request failed
function isRequestFailed(uint32 rngRequestId) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
rngRequestId | uint32 | The RNG request id |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | True if the request failed, false otherwise |
randomNumber
Returns the random number for a given request
function randomNumber(uint32 rngRequestId) external returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
rngRequestId | uint32 | The RNG request id |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The random number |