Skip to content

Commit 6822ceb

Browse files
committed
docs: natspec
1 parent 8fd0e3a commit 6822ceb

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

src/contracts/core/RewardsCoordinatorStorage.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ abstract contract RewardsCoordinatorStorage is IRewardsCoordinator {
2727
uint8 internal constant PAUSED_REWARD_ALL_STAKERS_AND_OPERATORS = 4;
2828
/// @dev Index for flag that pauses calling createOperatorDirectedAVSRewardsSubmission
2929
uint8 internal constant PAUSED_OPERATOR_DIRECTED_AVS_REWARDS_SUBMISSION = 5;
30-
/// @dev Index for flag that pauses calling setOperatorSetPerformanceRewardsSubmission
31-
uint8 internal constant PAUSED_OPERATOR_DIRECTED_OPERATOR_SET_REWARDS_SUBMISSION = 6;
3230
/// @dev Index for flag that pauses calling setOperatorAVSSplit
33-
uint8 internal constant PAUSED_OPERATOR_AVS_SPLIT = 7;
31+
uint8 internal constant PAUSED_OPERATOR_AVS_SPLIT = 6;
3432
/// @dev Index for flag that pauses calling setOperatorPISplit
35-
uint8 internal constant PAUSED_OPERATOR_PI_SPLIT = 8;
33+
uint8 internal constant PAUSED_OPERATOR_PI_SPLIT = 7;
3634
/// @dev Index for flag that pauses calling setOperatorSetSplit
37-
uint8 internal constant PAUSED_OPERATOR_SET_OPERATOR_SPLIT = 9;
35+
uint8 internal constant PAUSED_OPERATOR_SET_OPERATOR_SPLIT = 8;
36+
/// @dev Index for flag that pauses calling setOperatorSetPerformanceRewardsSubmission
37+
uint8 internal constant PAUSED_OPERATOR_DIRECTED_OPERATOR_SET_REWARDS_SUBMISSION = 9;
3838

3939
/// @dev Salt for the earner leaf, meant to distinguish from tokenLeaf since they have the same sized data
4040
uint8 internal constant EARNER_LEAF_SALT = 0;

src/contracts/interfaces/IRewardsCoordinator.sol

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ interface IRewardsCoordinatorEvents is IRewardsCoordinatorTypes {
281281
);
282282

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

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

src/test/unit/RewardsCoordinatorUnit.t.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ contract RewardsCoordinatorUnitTests is EigenLayerUnitTestSetup, IRewardsCoordin
8383
/// @dev Index for flag that pauses calling createOperatorDirectedAVSRewardsSubmission
8484
uint8 internal constant PAUSED_OPERATOR_DIRECTED_AVS_REWARDS_SUBMISSION = 5;
8585

86-
/// @dev Index for flag that pauses calling setOperatorSetPerformanceRewardsSubmission
87-
uint8 internal constant PAUSED_OPERATOR_DIRECTED_OPERATOR_SET_REWARDS_SUBMISSION = 6;
88-
8986
/// @dev Index for flag that pauses calling setOperatorAVSSplit
90-
uint8 internal constant PAUSED_OPERATOR_AVS_SPLIT = 7;
87+
uint8 internal constant PAUSED_OPERATOR_AVS_SPLIT = 6;
9188

9289
/// @dev Index for flag that pauses calling setOperatorPISplit
93-
uint8 internal constant PAUSED_OPERATOR_PI_SPLIT = 8;
90+
uint8 internal constant PAUSED_OPERATOR_PI_SPLIT = 7;
9491

9592
/// @dev Index for flag that pauses calling setOperatorSetSplit
96-
uint8 internal constant PAUSED_OPERATOR_SET_OPERATOR_SPLIT = 9;
93+
uint8 internal constant PAUSED_OPERATOR_SET_OPERATOR_SPLIT = 8;
94+
95+
/// @dev Index for flag that pauses calling setOperatorSetPerformanceRewardsSubmission
96+
uint8 internal constant PAUSED_OPERATOR_DIRECTED_OPERATOR_SET_REWARDS_SUBMISSION = 9;
9797

9898
// RewardsCoordinator entities
9999
address rewardsUpdater = address(1000);

0 commit comments

Comments
 (0)