# RewarderFactory

[Git Source](https://github.com/Sperax/Demeter-Protocol/blob/cc93b9106874316d6dd016cdace652e2ca4ef8e1/contracts/rewarder/RewarderFactory.sol)

**Inherits:** IRewarderFactory, Ownable

**Author:** Sperax Foundation.

This contract deploys new rewarders and keeps track of them.

## State Variables

### oracle

```solidity
address public oracle;
```

### rewarderImplementation

```solidity
address public rewarderImplementation;
```

## Functions

### constructor

Constructor.

```solidity
constructor(address _oracle) Ownable(msg.sender);
```

**Parameters**

| Name      | Type      | Description                                 |
| --------- | --------- | ------------------------------------------- |
| `_oracle` | `address` | Address of the master price oracle of USDs. |

### deployRewarder

Function to deploy new rewarder.

```solidity
function deployRewarder(address _rwdToken) external returns (address rewarder);
```

**Parameters**

| Name        | Type      | Description                                                           |
| ----------- | --------- | --------------------------------------------------------------------- |
| `_rwdToken` | `address` | Address of the reward token for which the rewarder is to be deployed. |

**Returns**

| Name       | Type      | Description         |
| ---------- | --------- | ------------------- |
| `rewarder` | `address` | Rewarder's address. |

### updateRewarderImplementation

Update rewarder implementation's address

```solidity
function updateRewarderImplementation(address _newRewarderImplementation) external onlyOwner;
```

**Parameters**

| Name                         | Type      | Description                 |
| ---------------------------- | --------- | --------------------------- |
| `_newRewarderImplementation` | `address` | New Rewarder Implementation |

### updateOracle

Function to update the oracle's address.

```solidity
function updateOracle(address _newOracle) public onlyOwner;
```

**Parameters**

| Name         | Type      | Description                |
| ------------ | --------- | -------------------------- |
| `_newOracle` | `address` | Address of the new oracle. |

### \_validateNonZeroAddr

Validate address.

```solidity
function _validateNonZeroAddr(address _addr) private pure;
```

**Parameters**

| Name    | Type      | Description              |
| ------- | --------- | ------------------------ |
| `_addr` | `address` | Address to be validated. |


---

# 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.sperax.io/sperax-farms-protocol/technical-documents/smart-contracts/rewarder/rewarderfactory.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.
