@@ -14,6 +14,7 @@ import {ProfileLib} from "./libraries/ProfileLib.sol";
1414import {IdentityLib} from "./libraries/IdentityLib.sol " ;
1515import {EpochStorage} from "./storage/EpochStorage.sol " ;
1616import {RandomSamplingStorage} from "./storage/RandomSamplingStorage.sol " ;
17+ import {ParametersStorage} from "./storage/ParametersStorage.sol " ;
1718
1819contract StakingKPI is INamed , IVersioned , ContractStatus , IInitializable {
1920 string private constant _NAME = "StakingKPI " ;
@@ -26,6 +27,7 @@ contract StakingKPI is INamed, IVersioned, ContractStatus, IInitializable {
2627 DelegatorsInfo public delegatorsInfo;
2728 RandomSamplingStorage public randomSamplingStorage;
2829 EpochStorage public epochStorage;
30+ ParametersStorage public parametersStorage;
2931
3032 /**
3133 * @dev Initializes the StakingKPI contract with the Hub address for access control
@@ -51,6 +53,7 @@ contract StakingKPI is INamed, IVersioned, ContractStatus, IInitializable {
5153 delegatorsInfo = DelegatorsInfo (hub.getContractAddress ("DelegatorsInfo " ));
5254 randomSamplingStorage = RandomSamplingStorage (hub.getContractAddress ("RandomSamplingStorage " ));
5355 epochStorage = EpochStorage (hub.getContractAddress ("EpochStorageV8 " ));
56+ parametersStorage = ParametersStorage (hub.getContractAddress ("ParametersStorage " ));
5457 }
5558
5659 /**
@@ -176,7 +179,9 @@ contract StakingKPI is INamed, IVersioned, ContractStatus, IInitializable {
176179 uint256 totalNodeRewards = (epocRewardsPool * nodeScore18) / allNodesScore18;
177180
178181 uint256 feePercentageForEpoch = profileStorage.getLatestOperatorFeePercentage (identityId);
179- uint96 operatorFeeAmount = uint96 ((totalNodeRewards * feePercentageForEpoch) / 10_000 );
182+ uint96 operatorFeeAmount = uint96 (
183+ (totalNodeRewards * feePercentageForEpoch) / parametersStorage.maxOperatorFee ()
184+ );
180185
181186 return totalNodeRewards - operatorFeeAmount;
182187 }
0 commit comments