Module 0xd5044d9f4b80910ef7b8910a68d2ac257d14319fb9315ddce1ca5190878bc8ea::emission_manager

@title Emission Manager Module @author Aave @notice Implements the management of emissions for protocol rewards

use 0x1::event;
use 0x1::object;
use 0x1::option;
use 0x1::signer;
use 0x1::smart_table;
use 0xa888dd108ea636a234c973b8b72b9cadf0c7ae94d6f355c64dde9fdc275724ee::error_config;
use 0xd5044d9f4b80910ef7b8910a68d2ac257d14319fb9315ddce1ca5190878bc8ea::a_token_factory;
use 0xd5044d9f4b80910ef7b8910a68d2ac257d14319fb9315ddce1ca5190878bc8ea::rewards_controller;
use 0xd5044d9f4b80910ef7b8910a68d2ac257d14319fb9315ddce1ca5190878bc8ea::transfer_strategy;
use 0xd5044d9f4b80910ef7b8910a68d2ac257d14319fb9315ddce1ca5190878bc8ea::variable_debt_token_factory;

Resource EmissionManagerData

@notice Data structure for managing emissions @dev Stores emission admins and rewards controller information

#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
struct EmissionManagerData has key

Struct EmissionAdminUpdated

@notice Emitted when an emission admin is updated for a reward @param reward The address of the reward @param old_admin The address of the previous admin @param new_admin The address of the new admin

#[event]
struct EmissionAdminUpdated has drop, store

Constants

@notice Name for the emission manager object

const EMISSION_MANAGER_NAME: vector<u8> = [69, 77, 73, 83, 83, 73, 79, 78, 95, 77, 65, 78, 65, 71, 69, 82];

Function initialize

@notice Initializes the rewards controller @dev Only callable by the pool @param sender The signer account of the caller @param seed The seed for initializing the rewards controller

public entry fun initialize(sender: &signer, seed: vector<u8>)

Function configure_assets

@notice Configures assets for emissions @dev Configures multiple assets with their emission parameters @param account The signer account of the caller (must be emission admin for all rewards) @param emissions_per_second The emission rates per second for each asset @param max_emission_rates The maximum emission rates for each asset @param distribution_ends The distribution end timestamps for each asset @param assets The addresses of the assets to configure @param rewards The addresses of the rewards for each asset @param pull_rewards_transfer_strategies The transfer strategies for pulling rewards

public entry fun configure_assets(account: &signer, emissions_per_second: vector<u128>, max_emission_rates: vector<u128>, distribution_ends: vector<u32>, assets: vector<address>, rewards: vector<address>, pull_rewards_transfer_strategies: vector<object::Object<transfer_strategy::PullRewardsTransferStrategy>>)

Function set_pull_rewards_transfer_strategy

@notice Sets the pull rewards transfer strategy for a reward @dev Only callable by the emission admin for the reward @param caller The signer account of the caller @param reward The address of the reward @param pull_rewards_transfer_strategy The transfer strategy for pulling rewards

public entry fun set_pull_rewards_transfer_strategy(caller: &signer, reward: address, pull_rewards_transfer_strategy: object::Object<transfer_strategy::PullRewardsTransferStrategy>)

Function set_distribution_end

@notice Sets the distribution end timestamp for a reward on an asset @dev Only callable by the emission admin for the reward @param caller The signer account of the caller @param asset The address of the asset @param reward The address of the reward @param new_distribution_end The new distribution end timestamp

public entry fun set_distribution_end(caller: &signer, asset: address, reward: address, new_distribution_end: u32)

Function set_emission_per_second

@notice Sets the emission rate per second for rewards on an asset @dev Only callable by the emission admin for all rewards @param caller The signer account of the caller @param asset The address of the asset @param rewards The addresses of the rewards @param new_emissions_per_second The new emission rates per second

public entry fun set_emission_per_second(caller: &signer, asset: address, rewards: vector<address>, new_emissions_per_second: vector<u128>)

Function set_claimer

@notice Sets a claimer for a user @dev Only callable by the admin @param account The signer account of the caller @param user The address of the user @param claimer The address of the claimer

public entry fun set_claimer(account: &signer, user: address, claimer: address)

Function set_emission_admin

@notice Sets the emission admin for a reward @dev Only callable by the admin @param account The signer account of the caller @param reward The address of the reward @param new_admin The address of the new admin

public entry fun set_emission_admin(account: &signer, reward: address, new_admin: address)

Function set_rewards_controller

@notice Sets the rewards controller address @dev Only callable by the admin @param account The signer account of the caller @param rewards_controller The new rewards controller address (or None to unset)

public entry fun set_rewards_controller(account: &signer, rewards_controller: option::Option<address>)

Function emission_manager_address

@notice Gets the address of the emission manager @return The address of the emission manager object

#[view]
public fun emission_manager_address(): address

Function emission_manager_object

@notice Gets the emission manager object @return The emission manager object

#[view]
public fun emission_manager_object(): object::Object<emission_manager::EmissionManagerData>

Function get_rewards_controller

@notice Gets the rewards controller @return The address of the rewards controller (or None if not set)

#[view]
public fun get_rewards_controller(): option::Option<address>

Function get_emission_admin

@notice Gets the emission admin for a reward @param reward The address of the reward @return The address of the emission admin

#[view]
public fun get_emission_admin(reward: address): address