> For the complete documentation index, see [llms.txt](https://docs.sperax.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sperax.io/sperax-farms-protocol/technical-documents/smart-contracts/rewarder/rewarderfactory.md).

# 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. |
