|
| 1 | +// SPDX-License-Identifier: BUSL-1.1 |
| 2 | +pragma solidity >=0.5.0; |
| 3 | + |
| 4 | +/// @title IEmissionsControllerErrors |
| 5 | +/// @notice Errors for the IEmissionsController contract. |
| 6 | +interface IEmissionsControllerErrors { |
| 7 | + // TODO: Define with implementation. |
| 8 | + |
| 9 | + } |
| 10 | + |
| 11 | +/// @title IEmissionsControllerTypes |
| 12 | +/// @notice Types for the IEmissionsController contract. |
| 13 | +interface IEmissionsControllerTypes { |
| 14 | + /// @notice Distribution types as defined in the ELIP. |
| 15 | + /// @dev Ref: "Distribution Submission types may include: createRewardsForAllEarners, createOperatorSetTotalStakeRewardsSubmission, createOperatorSetUniqueStakeRewardsSubmission, EigenDA Distribution, Manual Distribution." |
| 16 | + enum DistributionType { |
| 17 | + RewardsForAllEarners, |
| 18 | + OperatorSetTotalStake, |
| 19 | + OperatorSetUniqueStake, |
| 20 | + EigenDA, |
| 21 | + Manual |
| 22 | + } |
| 23 | + |
| 24 | + /// @notice A Distribution structure containing weight, type and strategies. |
| 25 | + /// @dev Ref: "A Distribution consists of N fields: Weight, Distribution-type, Strategies and Multipliers." |
| 26 | + struct Distribution { |
| 27 | + /// The bips denominated weight of the distribution. |
| 28 | + uint256 weight; |
| 29 | + /// The type of distribution. |
| 30 | + DistributionType distributionType; |
| 31 | + /// The encoded rewards submission (either `RewardsSubmission` or `OperatorDirectedRewardsSubmission`). |
| 32 | + bytes encodedRewardsSubmission; |
| 33 | + } |
| 34 | +} |
| 35 | + |
| 36 | +/// @title IEmissionsControllerEvents |
| 37 | +/// @notice Events for the IEmissionsController contract. |
| 38 | +interface IEmissionsControllerEvents is IEmissionsControllerTypes { |
| 39 | + /// @notice Emitted when a distribution is updated. |
| 40 | + /// @param distributionId The id of the distribution. |
| 41 | + /// @param distribution The distribution. |
| 42 | + event DistributionUpdated(uint256 indexed distributionId, Distribution distribution); |
| 43 | + |
| 44 | + /// @notice Emitted when a distribution is added. |
| 45 | + /// @param distributionId The id of the distribution. |
| 46 | + /// @param distribution The distribution. |
| 47 | + event DistributionAdded(uint256 indexed distributionId, Distribution distribution); |
| 48 | + |
| 49 | + /// @notice Emitted when a distribution is removed. |
| 50 | + /// @param distributionId The id of the distribution. |
| 51 | + event DistributionRemoved(uint256 indexed distributionId); |
| 52 | + |
| 53 | + /// @notice Emitted when the Incentive Council address is updated. |
| 54 | + /// @param incentiveCouncil The new Incentive Council address. |
| 55 | + event IncentiveCouncilUpdated(address indexed incentiveCouncil); |
| 56 | + |
| 57 | + /// @notice Emitted when the inflation rate is updated. |
| 58 | + /// @param inflationRate The new inflation rate. |
| 59 | + event InflationRateUpdated(uint256 indexed inflationRate); |
| 60 | +} |
| 61 | + |
| 62 | +/// @title IEmissionsController |
| 63 | +/// @notice Interface for the EmissionsController contract, which acts as the upgraded ActionGenerator. |
| 64 | +/// @dev Ref: "This proposal requires upgrades to the TokenHopper and Action Generator contracts." |
| 65 | +interface IEmissionsController is IEmissionsControllerErrors, IEmissionsControllerEvents { |
| 66 | + /// ----------------------------------------------------------------------- |
| 67 | + /// Constants |
| 68 | + /// ----------------------------------------------------------------------- |
| 69 | + /// @notice The rate of inflation for emissions. |
| 70 | + /// @dev Immutable/constant variable that requires an upgrade to modify. |
| 71 | + function EMISSIONS_INFLATION_RATE() external view returns (uint256); |
| 72 | + |
| 73 | + /// @notice The start time of the emissions. |
| 74 | + /// @dev Immutable/constant variable that requires an upgrade to modify. |
| 75 | + function EMISSIONS_START_TIME() external view returns (uint256); |
| 76 | + |
| 77 | + /// @notice The cooldown seconds of the emissions. |
| 78 | + /// @dev Immutable/constant variable that requires an upgrade to modify. |
| 79 | + function EMISSIONS_COOLDOWN_SECONDS() external view returns (uint256); |
| 80 | + |
| 81 | + /// ----------------------------------------------------------------------- |
| 82 | + /// Initialization Functions |
| 83 | + /// ----------------------------------------------------------------------- |
| 84 | + |
| 85 | + /// @notice Initializes the contract. |
| 86 | + /// @param incentiveCouncil The initial Incentive Council address. |
| 87 | + function initialize( |
| 88 | + address incentiveCouncil |
| 89 | + ) external; |
| 90 | + |
| 91 | + /// ----------------------------------------------------------------------- |
| 92 | + /// Permissionless Trigger |
| 93 | + /// ----------------------------------------------------------------------- |
| 94 | + |
| 95 | + /// @notice Triggers the weekly emissions. |
| 96 | + /// @dev Try/catch is used to prevent a single reverting rewards submission from halting emissions. |
| 97 | + /// @dev Pagination is used to prevent out-of-gas errors; multiple calls may be needed to process all submissions. |
| 98 | + /// @dev Ref: "The ActionGenerator today is a contract ... that is triggered by the Hopper. When triggered, it mints new EIGEN tokens..." |
| 99 | + /// @dev Permissionless function that can be called by anyone when `isButtonPressable()` returns true. |
| 100 | + function pressButton() external; |
| 101 | + |
| 102 | + /// ----------------------------------------------------------------------- |
| 103 | + /// Protocol Council Functions |
| 104 | + /// ----------------------------------------------------------------------- |
| 105 | + |
| 106 | + /// @notice Sets the Incentive Council address. |
| 107 | + /// @dev Only the Protocol Council can call this function. |
| 108 | + /// @dev Ref: "Protocol Council Functions: Set Incentive Council multisig address that can interface with the ActionGenerator..." |
| 109 | + /// @param incentiveCouncil The new Incentive Council address. |
| 110 | + function setIncentiveCouncil( |
| 111 | + address incentiveCouncil |
| 112 | + ) external; |
| 113 | + |
| 114 | + /// ----------------------------------------------------------------------- |
| 115 | + /// Incentive Council Functions |
| 116 | + /// ----------------------------------------------------------------------- |
| 117 | + |
| 118 | + /// @notice Adds a new distribution. |
| 119 | + /// @dev Only the Incentive Council can call this function. |
| 120 | + /// @dev Ref: "Incentive Council Functions: addDistribution(weight{int}, distribution-type{see below}, strategiesAndMultipliers())" |
| 121 | + /// @param distribution The distribution to add. |
| 122 | + /// @return distributionId The id of the added distribution. |
| 123 | + function addDistribution( |
| 124 | + Distribution calldata distribution |
| 125 | + ) external returns (uint256 distributionId); |
| 126 | + |
| 127 | + /// @notice Updates an existing distribution. |
| 128 | + /// @dev Only the Incentive Council can call this function. |
| 129 | + /// @dev Ref: "Incentive Council Functions: updateDistribution(distributionId)" |
| 130 | + /// @param distributionId The id of the distribution to update. |
| 131 | + /// @param distribution The new distribution. |
| 132 | + function updateDistribution( |
| 133 | + uint256 distributionId, |
| 134 | + Distribution calldata distribution |
| 135 | + ) external; |
| 136 | + |
| 137 | + /// @notice Cancels a distribution. |
| 138 | + /// @dev The distribution remains in storage, but is marked as cancelled. |
| 139 | + /// @dev Only the Incentive Council can call this function. |
| 140 | + /// @dev Ref: Implied by "updateDistribution" and general management of distributions. |
| 141 | + /// @param distributionId The id of the distribution to remove. |
| 142 | + function removeDistribution( |
| 143 | + uint256 distributionId |
| 144 | + ) external; |
| 145 | + |
| 146 | + /// ----------------------------------------------------------------------- |
| 147 | + /// View |
| 148 | + /// ----------------------------------------------------------------------- |
| 149 | + |
| 150 | + /// @notice Checks if the emissions can be triggered. |
| 151 | + /// @return True if the cooldown has passed and the system is ready. |
| 152 | + function isButtonPressable() external view returns (bool); |
| 153 | + |
| 154 | + /// @notice Returns the next button press time. |
| 155 | + /// @return The next button press time. |
| 156 | + function nextButtonPressTime() external view returns (uint256); |
| 157 | + |
| 158 | + /// @notice Returns the last button press time. |
| 159 | + /// @return The last button press time. |
| 160 | + function lastButtonPressTime() external view returns (uint256); |
| 161 | + |
| 162 | + /// @notice Returns a distribution by index. |
| 163 | + /// @param distributionId The id of the distribution. |
| 164 | + /// @return The Distribution struct at the given index. |
| 165 | + function getDistribution( |
| 166 | + uint256 distributionId |
| 167 | + ) external view returns (Distribution memory); |
| 168 | + |
| 169 | + /// @notice Returns all distributions. |
| 170 | + /// @return An append-only array of Distribution structs. |
| 171 | + function getDistributions() external view returns (Distribution[] memory); |
| 172 | + |
| 173 | + /// @notice Returns the current Incentive Council address. |
| 174 | + /// @return The Incentive Council address. |
| 175 | + function getIncentiveCouncil() external view returns (address); |
| 176 | +} |
0 commit comments