IncentivesV2 Implementation

  • EMISSION_MANAGER() → address Returns the current emission manager’s address.

  • REVISION() → uint256 Returns the contract’s version/revision number.

  • getAllUserRewards(assets[], user) → (rewardsList[], unclaimedAmounts[]) Returns all unclaimed rewards for a user across multiple assets.

  • getAssetDecimals(asset) → uint8 Returns the decimals used by the asset.

  • getAssetIndex(asset, reward) → (uint256, uint256) Returns the global reward index and related data for an asset-reward pair.

  • getClaimer(user) → address Returns the address allowed to claim rewards on behalf of a user.

  • getDistributionEnd(asset, reward) → uint256 Returns the timestamp when emissions stop for an asset-reward pair.

  • getEmissionManager() → address Returns the emission manager address.

  • getPyth() → address Returns the Pyth oracle contract address.

  • getRewardPriceId(reward) → bytes32 Returns the oracle price ID associated with a reward token.

  • getRewardsByAsset(asset) → address[] Lists all reward tokens associated with a specific asset.

  • getRewardsData(asset, reward) → (uint256, uint256, uint256, uint256) Returns detailed emission/reward data for an asset-reward pair.

  • getRewardsList() → address[] Returns the full list of reward tokens managed by this controller.

  • getTransferStrategy(reward) → address Returns the strategy contract address used to distribute a specific reward.getUserAccruedRewards(user, reward) → uint256 Returns how many rewards a user has accrued but not yet claimed.getUserAssetIndex(user, asset, reward) → uint256 Returns the user’s reward index for a specific asset-reward pair.getUserRewards(assets[], user, reward) → uint256 Returns total unclaimed rewards for a user across multiple assets.pyth() → address Returns the current Pyth oracle contract address.


🔹 Claim Rewards

  • claimAllRewards(assets[], to) → (rewardsList[], claimedAmounts[]) Claims all available rewards for the caller and sends them to to.

  • claimAllRewardsOnBehalf(assets[], user, to) → (rewardsList[], claimedAmounts[]) Claims all rewards on behalf of user and transfers them to to.

  • claimAllRewardsToSelf(assets[]) → (rewardsList[], claimedAmounts[]) Claims all rewards for the caller and sends them to their own address.

  • claimRewards(assets[], amount, to, reward) → uint256 Claims up to amount of a specific reward for the caller and sends to to.

  • claimRewardsOnBehalf(assets[], amount, user, to, reward) → uint256 Claims rewards on behalf of user for a specific token and transfers to to.

  • claimRewardsToSelf(assets[], amount, reward) → uint256 Claims up to amount of a specific reward for the caller.


🔹 Admin / Config

  • configureAssets(config[]) Sets up reward emissions for multiple assets and rewards at once.

  • handleAction(user, totalSupply, userBalance) Updates internal accounting when a user interacts with the underlying asset (e.g., deposits/borrows).

  • initialize(address) Initializes the contract (likely called once by the emission manager or proxy).

  • setClaimer(user, caller) Sets a claimer for a specific user.

  • setDistributionEnd(asset, reward, newDistributionEnd) Updates when reward distribution ends for an asset-reward pair.

  • setEmissionPerSecond(asset, rewards[], newEmissionsPerSecond[]) Updates emission rates per second for multiple rewards on one asset.

  • setPyth(_pyth) Updates the Pyth oracle contract.

  • setRewardPriceId(reward, rewardPriceId) Updates the oracle price ID for a reward.

  • setTransferStrategy(reward, transferStrategy) Updates the distribution strategy for a reward token.


Events

  • Accrued(asset, reward, user, assetIndex, userIndex, rewardsAccrued) Triggered when a user accrues rewards for a given asset and reward type.

  • AssetConfigUpdated(asset, reward, oldEmission, newEmission, oldDistributionEnd, newDistributionEnd, assetIndex) Triggered when the emission configuration of an asset is updated.

  • ClaimerSet(user, claimer) Triggered when a claimer is set for a user.

  • PythSet(pyth) Triggered when the Pyth oracle contract is updated.

  • RewardPriceIdUpdated(reward, rewardPriceId) Triggered when the reward price feed ID changes.

  • RewardsClaimed(user, reward, to, claimer, amount) Triggered when rewards are successfully claimed by/for a user.

  • TransferStrategyInstalled(reward, transferStrategy) Triggered when a new transfer strategy for distributing rewards is installed.

Last updated

Was this helpful?