WitnetRandomnesscontract internally uses an instance of the low-level
WitnetRequestRandomnessformarly explained, this contract implements also the whole request/resolution asynchronous flow involved in the resolution of a data request in the context of the Witnet side-chain.
WitnetRandomnessyou just need to:
WitnetRandomnesscontract is not owned, so anyone is actually allowed to either request new randomness (i.e.
randomize()), or get previously solved randomness from storage (i.e.
randomize() payable), even if other previous randomness requests (either coming from you, or other apps) were still pending to be solved.
Clonable, which means that you, or your contract, may cheaply create your own cloned copy as a means to gain ownership of the self-contained
WitnetRequestRandomnesscontract. Only the owner of a cloned copy will be allowed to change the witnessing parameters of the low-level Randomness Request.
WitnetRandomnesscontract provides the
random(uint32 _range, uint256 _nonce, uint256 _block)and
random(uint32 _range, uint256 _nonce, bytes32 _seed)helper functions.
WitnetRandomnesscontract guarantees that the received randomness is the one requested for a given block number, or the subsequent randomness request posted after the given block if there was none posted back then, or if the ones posted after that got reverted for whatever reason at the Witnet side-chain level.