Skip to content
LogoLogo

Claim Rewards

Operators claim fees from Rewards.sol using the claimOperatorFees entrypoint for Vault Snapshot rewards. Find the up-to-date Rewards contract address on the Addresses page.

Check claimable rewards

Use the view functions on Rewards.sol to determine the range of rewards to claim:

  • rewardsLength(vault, network, token) returns the total number of reward distributions.
  • lastUnclaimedOperatorReward(account, vault, network, token) returns the index of your last unclaimed reward.

Claim operator fees (spec)

function claimOperatorFees(
    address recipient,
    address network,
    address token,
    address vault,
    uint256 lastUnclaimedRewards,
    uint256 firstRewardToClaim,
    uint256 rewardsToClaim,
    bytes calldata extraData
) public
ParameterDescription
recipientAddress that receives the claimed tokens
networkNetwork whose operator fees are being claimed
tokenERC20 reward token
vaultVault address
lastUnclaimedRewardsExpected current index from storage (reorg protection)
firstRewardToClaimOptional starting index for claiming
rewardsToClaimMax number of rewards to process
extraDataABI-encoded hints for NetworkRestakeDelegator; pass empty bytes if not needed

Example: calculate unclaimed reward and execute claim function

uint256 totalRewards = rewards.rewardsLength(vault, network, token);
uint256 lastClaimed = rewards.lastUnclaimedOperatorReward(operator, vault, network, token);
uint256 unclaimedCount = totalRewards - lastClaimed;
 
bytes memory extraData = abi.encode(operatorNetworkSharesHints, totalOperatorNetworkSharesHint);
rewards.claimOperatorFees(
    recipient,
    network,
    token,
    vault,
    lastClaimed,
    0,
    unclaimedCount,
    ""
);