# BasicRandcastConsumerBase

`BasicRandcastConsumerBase` contract provides:

* A set of virtual callback functions that the consumer contract can override. These functions are called by the Adapter contract when the randomness request is fulfilled. The consumer contract can override the below functions to implement the subsequent logic on how to utilize the randomness results in their DApp or Web3 game, specifically:&#x20;
  * override `_fulfillRandomness` for requesting `Randomness`
  * override `_fulfillRandomWords` for requesting `RandomWords`
  * override `_fulfillShuffledArray` for requesting `Shuffling`
* A nonce recorder keeps track of the number of random requests that the consumer contract has initiated through a specific subscription. This can be useful for debugging. Please do not try to control the nonce as it will not affect the behavior of the Adapter, i.e., randomness result.
* `A _rawRequestRandomness` function to call the Adapter contract to request randomness. The consumer contract can define its own interface to request randomness, where this function should be called. The user can set:
  * `subId` to specify which subscription to use.
  * `seed` to specify the seed of the randomness (this won't decide the randomness result but will help prevent other parties from maliciously predicting it).
  * `requestConfirmations` to specify the number of blocks required between the randomness request and the randomness fulfillment.
  * `callbackGasLimit` to specify the gas limit you want for the callback function.
  * `callbackMaxGasPrice` to specify the maximum amount of gas you are willing to spend on the callback request.

***Note**:  To learn more about the implementation, please refer to the complete* [*source code*](https://github.com/ARPA-Network/Randcast-User-Contract/blob/main/contracts/user/BasicRandcastConsumerBase.sol) *of the smart contract.*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.arpanetwork.io/randcast/using-the-sdk/basicrandcastconsumerbase.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
