|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity ^0.8.12; |
| 3 | + |
| 4 | +import {IStrategy} from "eigenlayer-contracts/src/contracts/interfaces/IStrategy.sol"; |
| 5 | + |
| 6 | +struct StrategyParams { |
| 7 | + IStrategy strategy; // The strategy contract reference |
| 8 | + uint96 multiplier; // The multiplier applied to the strategy |
| 9 | +} |
| 10 | + |
| 11 | +struct Quorum { |
| 12 | + StrategyParams[] strategies; // An array of strategy parameters to define the quorum |
| 13 | +} |
| 14 | + |
| 15 | +interface ECDSAStakeRegistryEventsAndErrors { |
| 16 | + /// @notice Emitted when the system registers an operator |
| 17 | + /// @param _operator The address of the registered operator |
| 18 | + /// @param _avs The address of the associated AVS |
| 19 | + event OperatorRegistered(address indexed _operator, address indexed _avs); |
| 20 | + |
| 21 | + /// @notice Emitted when the system deregisters an operator |
| 22 | + /// @param _operator The address of the deregistered operator |
| 23 | + /// @param _avs The address of the associated AVS |
| 24 | + event OperatorDeregistered(address indexed _operator, address indexed _avs); |
| 25 | + |
| 26 | + /// @notice Emitted when the system updates the quorum |
| 27 | + /// @param _old The previous quorum configuration |
| 28 | + /// @param _new The new quorum configuration |
| 29 | + event QuorumUpdated(Quorum _old, Quorum _new); |
| 30 | + |
| 31 | + /// @notice Emitted when the weight to join the operator set updates |
| 32 | + /// @param _old The previous minimum weight |
| 33 | + /// @param _new The new minimumWeight |
| 34 | + event MinimumWeightUpdated(uint256 _old, uint256 _new); |
| 35 | + |
| 36 | + /// @notice Emitted when the weight required to be an operator changes |
| 37 | + /// @param oldMinimumWeight The previous weight |
| 38 | + /// @param newMinimumWeight The updated weight |
| 39 | + event UpdateMinimumWeight(uint256 oldMinimumWeight, uint256 newMinimumWeight); |
| 40 | + |
| 41 | + /// @notice Emitted when the system updates an operator's weight |
| 42 | + /// @param _operator The address of the operator updated |
| 43 | + /// @param oldWeight The operator's weight before the update |
| 44 | + /// @param newWeight The operator's weight after the update |
| 45 | + event OperatorWeightUpdated(address indexed _operator, uint256 oldWeight, uint256 newWeight); |
| 46 | + |
| 47 | + /// @notice Emitted when the system updates the total weight |
| 48 | + /// @param oldTotalWeight The total weight before the update |
| 49 | + /// @param newTotalWeight The total weight after the update |
| 50 | + event TotalWeightUpdated(uint256 oldTotalWeight, uint256 newTotalWeight); |
| 51 | + |
| 52 | + /// @notice Emits when setting a new threshold weight. |
| 53 | + event ThresholdWeightUpdated(uint256 _thresholdWeight); |
| 54 | + |
| 55 | + /// @notice Indicates when the lengths of the signers array and signatures array do not match. |
| 56 | + error LengthMismatch(); |
| 57 | + |
| 58 | + /// @notice Indicates encountering an invalid length for the signers or signatures array. |
| 59 | + error InvalidLength(); |
| 60 | + |
| 61 | + /// @notice Indicates encountering an invalid signature. |
| 62 | + error InvalidSignature(); |
| 63 | + |
| 64 | + /// @notice Thrown when the threshold update is greater than BPS |
| 65 | + error InvalidThreshold(); |
| 66 | + |
| 67 | + /// @notice Thrown when missing operators in an update |
| 68 | + error MustUpdateAllOperators(); |
| 69 | + |
| 70 | + /// @notice Indicates operator weights were out of sync and the signed weight exceed the total |
| 71 | + error InvalidSignedWeight(); |
| 72 | + |
| 73 | + /// @notice Indicates the total signed stake fails to meet the required threshold. |
| 74 | + error InsufficientSignedStake(); |
| 75 | + |
| 76 | + /// @notice Indicates an individual signer's weight fails to meet the required threshold. |
| 77 | + error InsufficientWeight(); |
| 78 | + |
| 79 | + /// @notice Indicates the quorum is invalid |
| 80 | + error InvalidQuorum(); |
| 81 | + |
| 82 | + /// @notice Indicates the system finds a list of items unsorted |
| 83 | + error NotSorted(); |
| 84 | + |
| 85 | + /// @notice Thrown when registering an already registered operator |
| 86 | + error OperatorAlreadyRegistered(); |
| 87 | + |
| 88 | + /// @notice Thrown when de-registering or updating the stake for an unregisted operator |
| 89 | + error OperatorNotRegistered(); |
| 90 | +} |
0 commit comments