|
| 1 | +// SPDX-License-Identifier: agpl-3.0 |
| 2 | +pragma solidity 0.8.10; |
| 3 | + |
| 4 | +import {IEACAggregatorProxy} from '../../misc/interfaces/IEACAggregatorProxy.sol'; |
| 5 | +import {RewardsDataTypes} from '../libraries/RewardsDataTypes.sol'; |
| 6 | +import {ITransferStrategyBase} from './ITransferStrategyBase.sol'; |
| 7 | +import {IRewardsController} from './IRewardsController.sol'; |
| 8 | + |
| 9 | +/** |
| 10 | + * @title IEmissionManager |
| 11 | + * @author Aave |
| 12 | + * @notice Defines the basic interface for the Emission Manager |
| 13 | + */ |
| 14 | +interface IEmissionManager { |
| 15 | + /** |
| 16 | + * @dev Emitted when the admin of a reward emission is updated. |
| 17 | + * @param reward The address of the rewarding token |
| 18 | + * @param oldAdmin The address of the old emission admin |
| 19 | + * @param newAdmin The address of the new emission admin |
| 20 | + */ |
| 21 | + event EmissionAdminUpdated( |
| 22 | + address indexed reward, |
| 23 | + address indexed oldAdmin, |
| 24 | + address indexed newAdmin |
| 25 | + ); |
| 26 | + |
| 27 | + /** |
| 28 | + * @dev Configure assets to incentivize with an emission of rewards per second until the end of distribution. |
| 29 | + * @dev Only callable by the emission admin of the given rewards |
| 30 | + * @param config The assets configuration input, the list of structs contains the following fields: |
| 31 | + * uint104 emissionPerSecond: The emission per second following rewards unit decimals. |
| 32 | + * uint256 totalSupply: The total supply of the asset to incentivize |
| 33 | + * uint40 distributionEnd: The end of the distribution of the incentives for an asset |
| 34 | + * address asset: The asset address to incentivize |
| 35 | + * address reward: The reward token address |
| 36 | + * ITransferStrategy transferStrategy: The TransferStrategy address with the install hook and claim logic. |
| 37 | + * IEACAggregatorProxy rewardOracle: The Price Oracle of a reward to visualize the incentives at the UI Frontend. |
| 38 | + * Must follow Chainlink Aggregator IEACAggregatorProxy interface to be compatible. |
| 39 | + */ |
| 40 | + function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external; |
| 41 | + |
| 42 | + /** |
| 43 | + * @dev Sets a TransferStrategy logic contract that determines the logic of the rewards transfer |
| 44 | + * @dev Only callable by the emission admin of the given reward |
| 45 | + * @param reward The address of the reward token |
| 46 | + * @param transferStrategy The address of the TransferStrategy logic contract |
| 47 | + */ |
| 48 | + function setTransferStrategy(address reward, ITransferStrategyBase transferStrategy) external; |
| 49 | + |
| 50 | + /** |
| 51 | + * @dev Sets an Aave Oracle contract to enforce rewards with a source of value. |
| 52 | + * @dev Only callable by the emission admin of the given reward |
| 53 | + * @notice At the moment of reward configuration, the Incentives Controller performs |
| 54 | + * a check to see if the reward asset oracle is compatible with IEACAggregator proxy. |
| 55 | + * This check is enforced for integrators to be able to show incentives at |
| 56 | + * the current Aave UI without the need to setup an external price registry |
| 57 | + * @param reward The address of the reward to set the price aggregator |
| 58 | + * @param rewardOracle The address of price aggregator that follows IEACAggregatorProxy interface |
| 59 | + */ |
| 60 | + function setRewardOracle(address reward, IEACAggregatorProxy rewardOracle) external; |
| 61 | + |
| 62 | + /** |
| 63 | + * @dev Sets the end date for the distribution |
| 64 | + * @dev Only callable by the emission admin of the given reward |
| 65 | + * @param asset The asset to incentivize |
| 66 | + * @param reward The reward token that incentives the asset |
| 67 | + * @param newDistributionEnd The end date of the incentivization, in unix time format |
| 68 | + **/ |
| 69 | + function setDistributionEnd( |
| 70 | + address asset, |
| 71 | + address reward, |
| 72 | + uint32 newDistributionEnd |
| 73 | + ) external; |
| 74 | + |
| 75 | + /** |
| 76 | + * @dev Sets the emission per second of a set of reward distributions |
| 77 | + * @param asset The asset is being incentivized |
| 78 | + * @param rewards List of reward addresses are being distributed |
| 79 | + * @param newEmissionsPerSecond List of new reward emissions per second |
| 80 | + */ |
| 81 | + function setEmissionPerSecond( |
| 82 | + address asset, |
| 83 | + address[] calldata rewards, |
| 84 | + uint88[] calldata newEmissionsPerSecond |
| 85 | + ) external; |
| 86 | + |
| 87 | + /** |
| 88 | + * @dev Whitelists an address to claim the rewards on behalf of another address |
| 89 | + * @dev Only callable by the owner of the EmissionManager |
| 90 | + * @param user The address of the user |
| 91 | + * @param claimer The address of the claimer |
| 92 | + */ |
| 93 | + function setClaimer(address user, address claimer) external; |
| 94 | + |
| 95 | + /** |
| 96 | + * @dev Updates the address of the emission manager |
| 97 | + * @dev Only callable by the owner of the EmissionManager |
| 98 | + * @param emissionManager The address of the new EmissionManager |
| 99 | + */ |
| 100 | + function setEmissionManager(address emissionManager) external; |
| 101 | + |
| 102 | + /** |
| 103 | + * @dev Updates the admin of the reward emission |
| 104 | + * @dev Only callable by the owner of the EmissionManager |
| 105 | + * @param reward The address of the reward token |
| 106 | + * @param admin The address of the new admin of the emission |
| 107 | + */ |
| 108 | + function setEmissionAdmin(address reward, address admin) external; |
| 109 | + |
| 110 | + /** |
| 111 | + * @dev Updates the address of the rewards controller |
| 112 | + * @dev Only callable by the owner of the EmissionManager |
| 113 | + * @param controller the address of the RewardsController contract |
| 114 | + */ |
| 115 | + function setRewardsController(address controller) external; |
| 116 | + |
| 117 | + /** |
| 118 | + * @dev Returns the rewards controller address |
| 119 | + * @return The address of the RewardsController contract |
| 120 | + */ |
| 121 | + function getRewardsController() external view returns (IRewardsController); |
| 122 | + |
| 123 | + /** |
| 124 | + * @dev Returns the admin of the given reward emission |
| 125 | + * @param reward The address of the reward token |
| 126 | + * @return The address of the emission admin |
| 127 | + */ |
| 128 | + function getEmissionAdmin(address reward) external view returns (address); |
| 129 | +} |
0 commit comments