@@ -33,26 +33,31 @@ contract KeepRandomBeaconOperatorStatistics {
3333 }
3434
3535
36- /**
37- * @dev Gets all indices in the provided group for a member.
38- */
36+ /// @notice Gets all indices in the provided group for a member.
37+ /// If the given operator is not a member, returns an empty array.
3938 function getGroupMemberIndices (
4039 bytes memory groupPubKey ,
41- address member
40+ address operator
4241 ) public view returns (uint256 [] memory indices ) {
43- uint256 count = countGroupMembership (groupPubKey, member );
42+ uint256 count = countGroupMembership (groupPubKey, operator );
4443 address [] memory members = operatorContract.getGroupMembers (groupPubKey);
4544
4645 indices = new uint256 [](count);
4746 uint256 counter = 0 ;
4847 for (uint i = 0 ; i < members.length ; i++ ) {
49- if (members[i] == member ) {
48+ if (members[i] == operator ) {
5049 indices[counter] = i;
5150 counter++ ;
5251 }
5352 }
5453 }
5554
55+ /// @notice Get the amount of group rewards
56+ /// allocated to the given operator in the given group.
57+ /// The rewards may or may not be withdrawable.
58+ /// @param operator Address of the operator.
59+ /// @param groupIndex Index of the group.
60+ /// @return The total allocated rewards.
5661 function awaitingRewards (
5762 address operator ,
5863 uint256 groupIndex
@@ -68,6 +73,12 @@ contract KeepRandomBeaconOperatorStatistics {
6873 return memberRewards.mul (memberCount);
6974 }
7075
76+ /// @notice Get the amount of group rewards
77+ /// withdrawable by the given operator in the given group.
78+ /// The group must be stale for any group rewards to be withdrawn.
79+ /// @param operator Address of the operator.
80+ /// @param groupIndex Index of the group.
81+ /// @return The total withdrawable rewards.
7182 function withdrawableRewards (
7283 address operator ,
7384 uint256 groupIndex
0 commit comments