IncrementalNG

Git Source

Inherits: RNG

Author: JayBuidl jb@kleros.io

A Random Number Generator which returns a number incremented by 1 each time. Useful as a fallback method.

State Variables

number

uint256 public number;

Functions

constructor

constructor(uint256 _start);

requestRandomness

Request a random number.

function requestRandomness(uint256 _block) external override;

Parameters

NameTypeDescription
_blockuint256Block the random number is linked to.

receiveRandomness

Get the "random number" (which is always the same).

function receiveRandomness(uint256 _block) external override returns (uint256 randomNumber);

Parameters

NameTypeDescription
_blockuint256Block the random number is linked to.

Returns

NameTypeDescription
randomNumberuint256The random number or 0 if it is not ready or has not been requested.