However, you will then need to add logic within your smart contract as to await for an answer from the Witnet side-chain and handle corner-case revert situations at the Witnet level, before feeding your favourite Pseudo Random Number Generator (PRNG) algorithm with the 32-byte random seed provided by the Witnet oracle.
Now, depending on the lifespan of your smart contract, you can actually compose your randomness data request following two different approaches:
1. First, if your contract needs a source of randomness for just once in its lifetime, you may just hardcode the Witnet data request bytecode with a predefined set of witnessing parameters, as shown in this code example.
2. As a second approach, if you expect to repeatedly request for randomness an undetermined number of times, you may opt for using a pre-deployed copy of the
WitnetRequestRandomnesscontract that will enable you, or your smart contract, to eventually change the witnessing parameters of your request.