@@ -56,15 +56,24 @@ contract OperatorRewarder is Ownable {
5656 /// @notice Error for invalid beneficiary address.
5757 error InvalidBeneficiary (address beneficiary );
5858
59+ /// @notice Error for beneficiary already set to the same address.
60+ error BeneficiaryAlreadySet (address beneficiary );
61+
5962 /// @notice Error for attempting to shutdown when already shutdown.
6063 error AlreadyShutdown ();
6164
6265 /// @notice Error for invalid basis points value.
6366 error InvalidBasisPoints (uint16 basisPoints );
6467
68+ /// @notice Error for fee already set to the same value.
69+ error FeeAlreadySet (uint16 basisPoints , uint16 feeBasisPoints );
70+
6571 /// @notice Error for basis points value greater than the maximum allowed.
6672 error MaxBasisPointsExceeded (uint16 basisPoints , uint16 maxBasisPoints );
6773
74+ /// @notice Error for max fee already set to the same value.
75+ error MaxFeeAlreadySet (uint16 basisPoints , uint16 maxFeeBasisPoints );
76+
6877 modifier onlyOperatorStaking () {
6978 require (msg .sender == address (operatorStaking ()), CallerNotOperatorStaking (msg .sender ));
7079 _;
@@ -281,9 +290,9 @@ contract OperatorRewarder is Ownable {
281290 * @param newBeneficiary The new beneficiary address.
282291 */
283292 function _transferBeneficiary (address newBeneficiary ) internal virtual {
284- if (newBeneficiary == address (0 )) {
285- revert InvalidBeneficiary ( address ( 0 ));
286- }
293+ require (newBeneficiary != address (0 ), InvalidBeneficiary ( address ( 0 )));
294+ require (newBeneficiary != _beneficiary, BeneficiaryAlreadySet (newBeneficiary ));
295+
287296 address oldBeneficiary = _beneficiary;
288297 _beneficiary = newBeneficiary;
289298 emit BeneficiaryTransferred (oldBeneficiary, newBeneficiary);
@@ -311,6 +320,7 @@ contract OperatorRewarder is Ownable {
311320 */
312321 function _setMaxfee (uint16 basisPoints ) internal virtual {
313322 require (basisPoints <= 10000 , InvalidBasisPoints (basisPoints));
323+ require (basisPoints != _maxfeeBasisPoints, MaxFeeAlreadySet (basisPoints, _maxfeeBasisPoints));
314324
315325 if (basisPoints < _feeBasisPoints) {
316326 _setFee (basisPoints);
@@ -327,6 +337,7 @@ contract OperatorRewarder is Ownable {
327337 */
328338 function _setFee (uint16 basisPoints ) internal virtual {
329339 require (basisPoints <= 10000 , InvalidBasisPoints (basisPoints));
340+ require (basisPoints != feeBasisPoints (), FeeAlreadySet (basisPoints, feeBasisPoints ()));
330341 require (basisPoints <= _maxfeeBasisPoints, MaxBasisPointsExceeded (basisPoints, _maxfeeBasisPoints));
331342
332343 _claimFee ();
0 commit comments