Skip to content

Commit

Permalink
docs: natspec
Browse files Browse the repository at this point in the history
  • Loading branch information
0xClandestine committed Jan 21, 2025
1 parent a16b00a commit c572efb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/contracts/core/RewardsCoordinatorStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ abstract contract RewardsCoordinatorStorage is IRewardsCoordinator {
uint8 internal constant PAUSED_REWARD_ALL_STAKERS_AND_OPERATORS = 4;
/// @dev Index for flag that pauses calling createOperatorDirectedAVSRewardsSubmission
uint8 internal constant PAUSED_OPERATOR_DIRECTED_AVS_REWARDS_SUBMISSION = 5;
/// @dev Index for flag that pauses calling setOperatorSetPerformanceRewardsSubmission
uint8 internal constant PAUSED_OPERATOR_DIRECTED_OPERATOR_SET_REWARDS_SUBMISSION = 6;
/// @dev Index for flag that pauses calling setOperatorAVSSplit
uint8 internal constant PAUSED_OPERATOR_AVS_SPLIT = 7;
uint8 internal constant PAUSED_OPERATOR_AVS_SPLIT = 6;
/// @dev Index for flag that pauses calling setOperatorPISplit
uint8 internal constant PAUSED_OPERATOR_PI_SPLIT = 8;
uint8 internal constant PAUSED_OPERATOR_PI_SPLIT = 7;
/// @dev Index for flag that pauses calling setOperatorSetSplit
uint8 internal constant PAUSED_OPERATOR_SET_OPERATOR_SPLIT = 9;
uint8 internal constant PAUSED_OPERATOR_SET_OPERATOR_SPLIT = 8;
/// @dev Index for flag that pauses calling setOperatorSetPerformanceRewardsSubmission
uint8 internal constant PAUSED_OPERATOR_DIRECTED_OPERATOR_SET_REWARDS_SUBMISSION = 9;

/// @dev Salt for the earner leaf, meant to distinguish from tokenLeaf since they have the same sized data
uint8 internal constant EARNER_LEAF_SALT = 0;
Expand Down
20 changes: 17 additions & 3 deletions src/contracts/interfaces/IRewardsCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ interface IRewardsCoordinatorEvents is IRewardsCoordinatorTypes {
);

/**
* @notice Emitted when an AVS creates a valid performance based `OperatorDirectedRewardsSubmission`
* @notice Emitted when an AVS creates a valid performance based `OperatorDirectedRewardsSubmission` for an operator set.
* @param caller The address calling `createOperatorDirectedOperatorSetRewardsSubmission`.
* @param operatorSet The operatorSet on behalf of which the performance rewards are being submitted.
* @param performanceRewardsSubmissionHash Keccak256 hash of (`avs`, `submissionNonce` and `performanceRewardsSubmission`).
Expand Down Expand Up @@ -457,8 +457,19 @@ interface IRewardsCoordinator is IRewardsCoordinatorErrors, IRewardsCoordinatorE
OperatorDirectedRewardsSubmission[] calldata operatorDirectedRewardsSubmissions
) external;

/// @notice operatorSet parallel of createAVSPerformanceRewardsSubmission
/// @dev sender must be the avs of the given operatorSet
/**
* @notice Creates a new operator-directed rewards submission for an operator set, to be split amongst the operators and
* set of stakers delegated to operators who are part of the operator set.
* @param operatorSet The operator set for which the rewards are being submitted
* @param performanceRewardsSubmissions The operator-directed rewards submissions being created
* @dev Expected to be called by the AVS that created the operator set
* @dev The duration of the `rewardsSubmission` cannot exceed `MAX_REWARDS_DURATION`
* @dev The tokens are sent to the `RewardsCoordinator` contract
* @dev The `RewardsCoordinator` contract needs a token approval of sum of all `operatorRewards` in the `performanceRewardsSubmissions`, before calling this function
* @dev Strategies must be in ascending order of addresses to check for duplicates
* @dev Operators must be in ascending order of addresses to check for duplicates
* @dev This function will revert if the `performanceRewardsSubmissions` is malformed
*/
function createOperatorDirectedOperatorSetRewardsSubmission(
OperatorSet calldata operatorSet,
OperatorDirectedRewardsSubmission[] calldata performanceRewardsSubmissions
Expand Down Expand Up @@ -571,6 +582,9 @@ interface IRewardsCoordinator is IRewardsCoordinatorErrors, IRewardsCoordinatorE
* @param operator The operator who is setting the split.
* @param operatorSet The operatorSet for which the split is being set by the operator.
* @param split The split for the operator for the specific operatorSet in bips.
* @dev Only callable by the operator
* @dev Split has to be between 0 and 10000 bips (inclusive)
* @dev The split will be activated after the activation delay
*/
function setOperatorSetSplit(address operator, OperatorSet calldata operatorSet, uint16 split) external;

Expand Down
12 changes: 6 additions & 6 deletions src/test/unit/RewardsCoordinatorUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ contract RewardsCoordinatorUnitTests is EigenLayerUnitTestSetup, IRewardsCoordin
/// @dev Index for flag that pauses calling createOperatorDirectedAVSRewardsSubmission
uint8 internal constant PAUSED_OPERATOR_DIRECTED_AVS_REWARDS_SUBMISSION = 5;

/// @dev Index for flag that pauses calling setOperatorSetPerformanceRewardsSubmission
uint8 internal constant PAUSED_OPERATOR_DIRECTED_OPERATOR_SET_REWARDS_SUBMISSION = 6;

/// @dev Index for flag that pauses calling setOperatorAVSSplit
uint8 internal constant PAUSED_OPERATOR_AVS_SPLIT = 7;
uint8 internal constant PAUSED_OPERATOR_AVS_SPLIT = 6;

/// @dev Index for flag that pauses calling setOperatorPISplit
uint8 internal constant PAUSED_OPERATOR_PI_SPLIT = 8;
uint8 internal constant PAUSED_OPERATOR_PI_SPLIT = 7;

/// @dev Index for flag that pauses calling setOperatorSetSplit
uint8 internal constant PAUSED_OPERATOR_SET_OPERATOR_SPLIT = 9;
uint8 internal constant PAUSED_OPERATOR_SET_OPERATOR_SPLIT = 8;

/// @dev Index for flag that pauses calling setOperatorSetPerformanceRewardsSubmission
uint8 internal constant PAUSED_OPERATOR_DIRECTED_OPERATOR_SET_REWARDS_SUBMISSION = 9;

// RewardsCoordinator entities
address rewardsUpdater = address(1000);
Expand Down

0 comments on commit c572efb

Please sign in to comment.