🦥
Cozy Safety Module
  • User Guides
    • Introduction
    • User FAQs
  • Developer Guides
    • Creating a Safety Module
      • Define Safety Module Configuration
      • Deploy a Safety Module
    • Manage a Safety Module
      • Replacing Triggers
    • Safety Module Deposits
    • Safety Module Redemptions / Withdrawals
    • Safety Module States
    • Safety Module Fees
    • Safety Module Slashing
    • Shared Safety Module Functionality
    • Create a Rewards Manager
      • Define a Rewards Manager Configuration
      • Deploy a Rewards Manager
      • Reward Pool Drip Models
    • Manage a Rewards Manager
      • Deposit Rewards
      • Update a Rewards Manager Configuration
    • Stake into a Rewards Manager
      • Stake
      • Claim Rewards
      • Unstake
    • Rewards Manager Accounting
    • Rewards Manager States
    • Create a Trigger
      • UMA Trigger Factory
      • Chainlink Trigger Factory
      • Ownable Trigger Factory
    • Permissions and Authorization
    • Token Integration Guidelines
    • Contract Deployments Registry
    • Payout Vaults
  • FAQ
    • Security FAQ
Powered by GitBook
On this page
  1. Developer Guides
  2. Stake into a Rewards Manager

Claim Rewards

To claim rewards, a staker can call RewardsManager.claimRewards:

/// @notice Claim rewards for a specific stake pool and transfer rewards to `receiver_`.
/// @param stakePoolId_ The ID of the stake pool to claim rewards for.
/// @param receiver_ The address to transfer the claimed rewards to.
function claimRewards(uint16 stakePoolId_, address receiver_) external;

which transfers all of the msg.sender's accrued rewards to the receiver_ address.

Note that claiming rewards claims accrued rewards from all reward pools.

Claim rewards mechanics

On claiming rewards, we follow the following steps for each reward pool:

  • Drip from the reward pool since time may have passed since the last drip.

  • Compute and update the ClaimableRewardsData for the (stake pool, reward pool) pair.

  • Update the UserRewardsData for the (stake pool, reward pool) pair.

  • Transfer the user's accruedRewards from the reward pool to the receiver_.

  • Reset accruedRewards to 0.

  • Emit a ClaimedRewards event.

PreviousStakeNextUnstake

Last updated 9 months ago