# LST Rewards Splitter Controller

The `LSTRewardsSplitterController` manages multiple `LSTRewardsSplitter` contracts.

## View Functions

### splitters

Returns the splitter corresponding to an account

```solidity
function splitters(address _account) external view returns (address)
```

#### Parameters

| Name    | Type    | Description        |
| ------- | ------- | ------------------ |
| account | address | address of account |

#### Return Values

| Name     | Type    | Description                                  |
| -------- | ------- | -------------------------------------------- |
| splitter | address | address of splitter corresponding to account |

### lst

Returns the min amount of new rewards required to split

```solidity
function lst() external view returns (address)
```

#### Return Values

| Name | Type    | Description    |
| ---- | ------- | -------------- |
| lst  | address | address of LST |

### rewardThreshold

Returns the address of the liquid staking token handled by this contract

```solidity
function rewardThreshold() external view returns (uint256)
```

#### Return Values

| Name            | Type    | Description      |
| --------------- | ------- | ---------------- |
| rewardThreshold | uint256 | reward threshold |

### getAccounts

Returns a list of all accounts that have splitters

```solidity
function getAccounts() external view returns (address[])
```

#### Return Values

| Name     | Type       | Description      |
| -------- | ---------- | ---------------- |
| accounts | address\[] | list of accounts |

### checkUpkeep

Returns whether a call should be made to performUpkeep to split new rewards

```solidity
function checkUpkeep(bytes) external view returns (bool, bytes)
```

#### Return Values

| Name         | Type  | Description                                             |
| ------------ | ----- | ------------------------------------------------------- |
| upkeepNeeded | bool  | true if performUpkeep should be called, false otherwise |
| performData  | bytes | abi encoded list of splitters to call                   |

## Write Functions

### onTokenTransfer

ERC677 implementation to receive an LST deposit

```solidity
function onTokenTransfer(address _sender, uint256 _value, bytes) external
```

#### Parameters

| Name     | Type    | Description       |
| -------- | ------- | ----------------- |
| \_sender | address | address of sender |
| \_value  | uint256 | value of transfer |

### withdraw

Withdraws tokens

```solidity
function withdraw(uint256 _amount) external
```

#### Parameters

| Name     | Type    | Description        |
| -------- | ------- | ------------------ |
| \_amount | uint256 | amount to withdraw |

### performUpkeep

Splits new rewards between receivers

```solidity
function performUpkeep(bytes _performData) external
```

#### Parameters

| Name          | Type  | Description                           |
| ------------- | ----- | ------------------------------------- |
| \_performData | bytes | abi encoded list of splitters to call |

### addSplitter

Deploys a new splitter

```solidity
function addSplitter(address _account, struct LSTRewardsSplitter.Fee[] _fees) external
```

#### Parameters

| Name      | Type                             | Description                               |
| --------- | -------------------------------- | ----------------------------------------- |
| \_account | address                          | address of account to deploy splitter for |
| \_fees    | struct LSTRewardsSplitter.Fee\[] | list of splitter fees                     |

### removeSplitter

Removes an account's splitter

```solidity
function removeSplitter(address _account) external
```

#### Parameters

| Name      | Type    | Description        |
| --------- | ------- | ------------------ |
| \_account | address | address of account |

### setRewardThreshold

Sets the min amount of new rewards required to split

```solidity
function setRewardThreshold(uint256 _rewardThreshold) external
```

#### Parameters

| Name              | Type    | Description                                 |
| ----------------- | ------- | ------------------------------------------- |
| \_rewardThreshold | uint256 | min amount of new rewards required to split |
