@@ -137,6 +137,8 @@ contract SortitionPool is SortitionTree, Rewards, Ownable, IReceiveApproval {
137137 }
138138 }
139139
140+ /// @notice Set the given operators as ineligible for rewards.
141+ /// The operators can restore their eligibility at the given time.
140142 function setRewardIneligibility (uint32 [] calldata operators , uint256 until )
141143 public
142144 onlyOwner
@@ -145,12 +147,40 @@ contract SortitionPool is SortitionTree, Rewards, Ownable, IReceiveApproval {
145147 emit IneligibleForRewards (operators, until);
146148 }
147149
150+ /// @notice Restores reward eligibility for the operator.
148151 function restoreRewardEligibility (address operator ) public {
149152 uint32 id = getOperatorID (operator);
150153 Rewards.restoreEligibility (id);
151154 emit RewardEligibilityRestored (operator, id);
152155 }
153156
157+ /// @notice Returns whether the operator is eligible for rewards or not.
158+ function isEligibleForRewards (address operator ) public view returns (bool ) {
159+ uint32 id = getOperatorID (operator);
160+ return Rewards.isEligibleForRewards (id);
161+ }
162+
163+ /// @notice Returns the time the operator's reward eligibility can be restored.
164+ function rewardsEligibilityRestorableAt (address operator )
165+ public
166+ view
167+ returns (uint256 )
168+ {
169+ uint32 id = getOperatorID (operator);
170+ return Rewards.rewardsEligibilityRestorableAt (id);
171+ }
172+
173+ /// @notice Returns whether the operator is able to restore their eligibility
174+ /// for rewards right away.
175+ function canRestoreRewardEligibility (address operator )
176+ public
177+ view
178+ returns (bool )
179+ {
180+ uint32 id = getOperatorID (operator);
181+ return Rewards.canRestoreRewardEligibility (id);
182+ }
183+
154184 /// @notice Returns the amount of rewards withdrawable for the given operator.
155185 function getAvailableRewards (address operator ) public view returns (uint96 ) {
156186 uint32 id = getOperatorID (operator);
0 commit comments