🦥
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
  • Using CozyRouter to deposit assets
  • Deposit mechanics
  1. Developer Guides
  2. Manage a Rewards Manager

Deposit Rewards

To incentivize stakers, users can deposit rewards into a Rewards Manager.

Note: Deposited rewards cannot be withdrawn - they can only be dripped to and claimed by stakers.

Using CozyRouter to deposit assets

Using the CozyRouter is the preferable way to deposit reward assets. To deposit assets using the CozyRouter, integrators can use CozyRouter.depositRewardAssets:

/// @notice Deposits exactly `rewardAssetAmount_` of the reward pool's underlying tokens into the `rewardsManager_`.
/// The specified amount of assets are transferred from the caller to the `rewardsManager_`.
/// @dev This will revert if the router is not approved for at least `rewardAssetAmount_` of the reward pool's
/// underlying asset.
function depositRewardAssets(IRewardsManager rewardsManager_, uint16 rewardPoolId_, uint256 rewardAssetAmount_)
    external
    payable;

This method will:

  • Transfer the underlying reward assets from the msg.sender to the Rewards Manager.

  • Call RewardsManager.depositRewardAssetsWithoutTransfer.

Prior to calling this function, the user must have approved CozyRouter to a spend sufficient amount of their RewardsManager.rewardPools(rewardId).asset balance.

Deposit mechanics

On deposit, high-level the Rewards Manager does the following:

  • Check if the Rewards Manager is PAUSED. If so, revert.

  • Check the Rewards Manager's asset balance to determine if the total deposit amount was transferred. If not, revert.

  • Update the relevant reward pool's internal rewardPool.undrippedRewards value.

  • Emit a Deposited event.

PreviousManage a Rewards ManagerNextUpdate a Rewards Manager Configuration

Last updated 9 months ago

assumes that the assets to be deposited has already been transferred to the Rewards Manager. Any excess assets transferred will be kept by the Rewards Manager.

RewardsManager.depositRewardAssetsWithoutTransfer