# RewardsV2Interface

> Primary interface for managing all protocol rewards.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

Source: https://dev.flare.network/network/solidity-reference/RewardsV2Interface

Primary interface for managing all protocol rewards. This is a long-term support (LTS) interface, designed to ensure continuity even as underlying contracts evolve or protocols migrate to new versions.

Sourced from `RewardsV2Interface.sol` on [GitHub](https://github.com/flare-foundation/flare-smart-contracts-v2/blob/main/contracts/userInterfaces/LTS/RewardsV2Interface.sol).

## Functions[​](#functions "Direct link to Functions")

### active[​](#active "Direct link to active")

Indicates if the contract is active - claims are enabled.

```
function active() external view returns (    bool);
```

### claim[​](#claim "Direct link to claim")

Claim rewards for `_rewardOwner` and transfer them to `_recipient`. It can be called by reward owner or its authorized executor.

```
function claim(    address _rewardOwner,    address payable _recipient,    uint24 _rewardEpochId,    bool _wrap,    struct RewardsV2Interface.RewardClaimWithProof[] _proofs) external returns (    uint256 _rewardAmountWei);
```

#### Parameters[​](#parameters "Direct link to Parameters")

-   `_rewardOwner`: Address of the reward owner.
-   `_recipient`: Address of the reward recipient.
-   `_rewardEpochId`: Id of the reward epoch up to which the rewards are claimed.
-   `_wrap`: Indicates if the reward should be wrapped (deposited) to the WNat contract.
-   `_proofs`: Array of reward claims with merkle proofs.

#### Returns[​](#returns "Direct link to Returns")

-   `_rewardAmountWei`: Amount of rewarded native tokens (wei).

### getNextClaimableRewardEpochId[​](#getnextclaimablerewardepochid "Direct link to getNextClaimableRewardEpochId")

Returns the next claimable reward epoch for a reward owner.

```
function getNextClaimableRewardEpochId(    address _rewardOwner) external view returns (    uint256);
```

#### Parameters[​](#parameters-1 "Direct link to Parameters")

-   `_rewardOwner`: Address of the reward owner to query.

### getRewardEpochIdsWithClaimableRewards[​](#getrewardepochidswithclaimablerewards "Direct link to getRewardEpochIdsWithClaimableRewards")

Returns the start and the end of the reward epoch range for which the reward is claimable.

```
function getRewardEpochIdsWithClaimableRewards() external view returns (    uint24 _startEpochId,    uint24 _endEpochId);
```

#### Returns[​](#returns-1 "Direct link to Returns")

-   `_startEpochId`: The oldest epoch id that allows reward claiming.
-   `_endEpochId`: The newest epoch id that allows reward claiming.

### getStateOfRewards[​](#getstateofrewards "Direct link to getStateOfRewards")

Returns the state of rewards for a given address for all unclaimed reward epochs with claimable rewards.

```
function getStateOfRewards(    address _rewardOwner) external view returns (    struct RewardsV2Interface.RewardState[][] _rewardStates);
```

#### Parameters[​](#parameters-2 "Direct link to Parameters")

-   `_rewardOwner`: Address of the reward owner.

#### Returns[​](#returns-2 "Direct link to Returns")

-   `_rewardStates`: Array of reward states.

## Structures[​](#structures "Direct link to Structures")

### RewardClaim[​](#rewardclaim "Direct link to RewardClaim")

Struct used in Merkle tree for storing reward claims.

```
struct RewardClaim {  uint24 rewardEpochId;  bytes20 beneficiary;  uint120 amount;  enum RewardsV2Interface.ClaimType claimType;}
```

### RewardClaimWithProof[​](#rewardclaimwithproof "Direct link to RewardClaimWithProof")

Struct used for claiming rewards with Merkle proof.

```
struct RewardClaimWithProof {  bytes32[] merkleProof;  struct RewardsV2Interface.RewardClaim body;}
```

### RewardState[​](#rewardstate "Direct link to RewardState")

Struct used for returning state of rewards.

```
struct RewardState {  uint24 rewardEpochId;  bytes20 beneficiary;  uint120 amount;  enum RewardsV2Interface.ClaimType claimType;  bool initialised;}
```

## Enums[​](#enums "Direct link to Enums")

### ClaimType[​](#claimtype "Direct link to ClaimType")

Claim type enum.

```
enum ClaimType {  DIRECT,  FEE,  WNAT,  MIRROR,  CCHAIN}
```
