# Rewards Pool WSD

`RewardsPoolWSD` is similar to `RewardsPool` but it handles a single rebasing token minted by a `StakingPool` by wrapping the tokens when they’re received for distribution and unwrapping them when a user claims their rewards.

## View Functions

### token

Returns the address of the rewards token this pool distributes

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

#### Return Values

| Name  | Type    | Description              |
| ----- | ------- | ------------------------ |
| token | address | Address of rewards token |

### wsdToken

Returns the address of the wrapped version of the token this pool distributes

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

#### Return Values

| Name         | Type    | Description                      |
| ------------ | ------- | -------------------------------- |
| wrappedToken | address | Address of wrapped rewards token |

### withdrawableRewards

Returns an account's total unwrapped unclaimed rewards

```solidity
function withdrawableRewards(address _account) public view returns (uint256)
```

#### Parameters

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

#### Return Values

| Name    | Type    | Description                         |
| ------- | ------- | ----------------------------------- |
| rewards | uint256 | Total unclaimed rewards (unwrapped) |

### withdrawableRewardsWrapped

Returns an account's total wrapped unclaimed rewards

```solidity
function withdrawableRewardsWrapped(address _account) public view returns (uint256)
```

#### Parameters

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

#### Return Values

| Name    | Type    | Description                       |
| ------- | ------- | --------------------------------- |
| rewards | uint256 | Total unclaimed rewards (wrapped) |

## Write Functions

### withdraw

Withdraws the sender's unclaimed rewards

```solidity
function withdraw() external
```

### withdraw

Withdraws an account's unclaimed rewards

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

#### Parameters

| Name      | Type    | Description             |
| --------- | ------- | ----------------------- |
| \_account | address | Account to withdraw for |

### onTokenTransfer

ERC677 implementation that receives rewards and distributes them

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

### distributeRewards

Distributes new rewards that have been deposited

```solidity
function distributeRewards() public
```

### updateReward

Updates an account's principal reward balance

```solidity
function updateReward(address _account) public
```

#### Parameters

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


---

# 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.stake.link/rewards-pool-contracts/rewardspoolwsd.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.
