|
| 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 | +/// @title IEmissionsControllerTypes |
| 11 | +/// @notice Types for the IEmissionsController contract. |
| 12 | +interface IEmissionsControllerTypes { |
| 13 | + /// @notice Distribution types as defined in the ELIP. |
| 14 | + /// @dev Ref: "Distribution Submission types may include: createRewardsForAllEarners, createOperatorSetTotalStakeRewardsSubmission, createOperatorSetUniqueStakeRewardsSubmission, EigenDA Distribution, Manual Distribution." |
| 15 | + enum DistributionType { |
| 16 | + RewardsForAllEarners, |
| 17 | + OperatorSetTotalStake, |
| 18 | + OperatorSetUniqueStake, |
| 19 | + EigenDA, |
| 20 | + Manual |
| 21 | + } |
| 22 | + |
| 23 | + /// @notice A Distribution structure containing weight, type and strategies. |
| 24 | + /// @dev Ref: "A Distribution consists of N fields: Weight, Distribution-type, Strategies and Multipliers." |
| 25 | + struct Distribution { |
| 26 | + uint256 weight; |
| 27 | + DistributionType distributionType; |
| 28 | + bytes strategiesAndMultipliers; |
| 29 | + } |
| 30 | + |
| 31 | + /// @notice Configuration for the EmissionsController. |
| 32 | + /// @dev Ref: "The amount of EIGEN minted weekly (inflation rate) is set by governance..." |
| 33 | + struct EmissionsConfiguration { |
| 34 | + uint256 inflationRate; |
| 35 | + uint256 startTime; |
| 36 | + uint256 cooldownSeconds; |
| 37 | + } |
| 38 | +} |
| 39 | + |
| 40 | +/// @title IEmissionsControllerEvents |
| 41 | +/// @notice Events for the IEmissionsController contract. |
| 42 | +interface IEmissionsControllerEvents is IEmissionsControllerTypes { |
| 43 | + /// @notice Emitted when a distribution is updated. |
| 44 | + event DistributionUpdated(uint256 indexed index, Distribution distribution); |
| 45 | + |
| 46 | + /// @notice Emitted when a distribution is added. |
| 47 | + event DistributionAdded(uint256 indexed index, Distribution distribution); |
| 48 | + |
| 49 | + /// @notice Emitted when a distribution is removed. |
| 50 | + event DistributionRemoved(uint256 indexed index); |
| 51 | + |
| 52 | + /// @notice Emitted when the Incentive Council address is updated. |
| 53 | + event IncentiveCouncilUpdated(address indexed newCouncil); |
| 54 | + |
| 55 | + /// @notice Emitted when the inflation rate is updated. |
| 56 | + event InflationRateUpdated(uint256 newRate); |
| 57 | +} |
| 58 | + |
| 59 | +/// @title IEmissionsController |
| 60 | +/// @notice Interface for the EmissionsController contract, which acts as the upgraded ActionGenerator. |
| 61 | +/// @dev Ref: "This proposal requires upgrades to the TokenHopper and Action Generator contracts." |
| 62 | +interface IEmissionsController is IEmissionsControllerErrors, IEmissionsControllerEvents { |
| 63 | + /// @notice Initializes the contract. |
| 64 | + function initialize( |
| 65 | + address incentiveCouncil, |
| 66 | + uint256 inflationRate, |
| 67 | + uint256 startTime, |
| 68 | + uint256 cooldownSeconds |
| 69 | + ) external; |
| 70 | + |
| 71 | + /// ----------------------------------------------------------------------- |
| 72 | + /// Permissionless Trigger |
| 73 | + /// ----------------------------------------------------------------------- |
| 74 | + |
| 75 | + /// @notice Triggers the weekly emissions. |
| 76 | + /// @dev Ref: "The ActionGenerator today is a contract ... that is triggered by the Hopper. When triggered, it mints new EIGEN tokens..." |
| 77 | + /// @dev Permissionless function that can be called by anyone when `canPress()` returns true. |
| 78 | + function pressButton() external; |
| 79 | + |
| 80 | + /// @notice Checks if the emissions can be triggered. |
| 81 | + /// @return True if the cooldown has passed and the system is ready. |
| 82 | + function canPress() external view returns (bool); |
| 83 | + |
| 84 | + /// ----------------------------------------------------------------------- |
| 85 | + /// Protocol Council Functions |
| 86 | + /// ----------------------------------------------------------------------- |
| 87 | + |
| 88 | + /// @notice Sets the Incentive Council address. |
| 89 | + /// @dev Only the Protocol Council can call this function. |
| 90 | + /// @dev Ref: "Protocol Council Functions: Set Incentive Council multisig address that can interface with the ActionGenerator..." |
| 91 | + /// @param incentiveCouncil The new Incentive Council address. |
| 92 | + function setIncentiveCouncil(address incentiveCouncil) external; |
| 93 | + |
| 94 | + /// @notice Sets the inflation rate (EIGEN minted per week). |
| 95 | + /// @dev Only the Protocol Council can call this function. |
| 96 | + /// @dev Ref: "Protocol Council Functions: Modification of the top level token emission as a proportion of supply annually... on a timelock" |
| 97 | + /// @param inflationRate The new inflation rate. |
| 98 | + function setInflationRate(uint256 inflationRate) external; |
| 99 | + |
| 100 | + /// ----------------------------------------------------------------------- |
| 101 | + /// Incentive Council Functions |
| 102 | + /// ----------------------------------------------------------------------- |
| 103 | + |
| 104 | + /// @notice Adds a new distribution. |
| 105 | + /// @dev Only the Incentive Council can call this function. |
| 106 | + /// @dev Ref: "Incentive Council Functions: addDistribution(weight{int}, distribution-type{see below}, strategiesAndMultipliers())" |
| 107 | + /// @param weight The weight of the distribution. |
| 108 | + /// @param distributionType The type of distribution. |
| 109 | + /// @param strategiesAndMultipliers Encoded strategies and multipliers. |
| 110 | + function addDistribution( |
| 111 | + uint256 weight, |
| 112 | + DistributionType distributionType, |
| 113 | + bytes calldata strategiesAndMultipliers |
| 114 | + ) external; |
| 115 | + |
| 116 | + /// @notice Updates an existing distribution. |
| 117 | + /// @dev Only the Incentive Council can call this function. |
| 118 | + /// @dev Ref: "Incentive Council Functions: updateDistribution(index)" |
| 119 | + /// @param index The index of the distribution to update. |
| 120 | + /// @param weight The new weight of the distribution. |
| 121 | + /// @param distributionType The new type of distribution. |
| 122 | + /// @param strategiesAndMultipliers The new encoded strategies and multipliers. |
| 123 | + function updateDistribution( |
| 124 | + uint256 index, |
| 125 | + uint256 weight, |
| 126 | + DistributionType distributionType, |
| 127 | + bytes calldata strategiesAndMultipliers |
| 128 | + ) external; |
| 129 | + |
| 130 | + /// @notice Removes a distribution. |
| 131 | + /// @dev Only the Incentive Council can call this function. |
| 132 | + /// @dev Ref: Implied by "updateDistribution" and general management of distributions. |
| 133 | + /// @param index The index of the distribution to remove. |
| 134 | + function removeDistribution(uint256 index) external; |
| 135 | + |
| 136 | + /// ----------------------------------------------------------------------- |
| 137 | + /// View |
| 138 | + /// ----------------------------------------------------------------------- |
| 139 | + |
| 140 | + /// @notice Returns a distribution by index. |
| 141 | + /// @param index The index of the distribution. |
| 142 | + /// @return The Distribution struct at the given index. |
| 143 | + function getDistribution(uint256 index) external view returns (Distribution memory); |
| 144 | + |
| 145 | + /// @notice Returns all distributions. |
| 146 | + /// @return An append-only array of Distribution structs. |
| 147 | + function getDistributions() external view returns (Distribution[] memory); |
| 148 | + |
| 149 | + /// @notice Returns the current Incentive Council address. |
| 150 | + /// @return The Incentive Council address. |
| 151 | + function getIncentiveCouncil() external view returns (address); |
| 152 | + |
| 153 | + /// @notice Returns the current configuration. |
| 154 | + /// @return The EmissionsConfiguration struct. |
| 155 | + function getEmissionsConfiguration() external view returns (EmissionsConfiguration memory); |
| 156 | +} |
0 commit comments