diff --git a/packages/horizon/contracts/data-service/utilities/ProvisionManager.sol b/packages/horizon/contracts/data-service/utilities/ProvisionManager.sol index 8608fd2fa..b5c905ad5 100644 --- a/packages/horizon/contracts/data-service/utilities/ProvisionManager.sol +++ b/packages/horizon/contracts/data-service/utilities/ProvisionManager.sol @@ -25,11 +25,11 @@ abstract contract ProvisionManager is Initializable, GraphDirectory, ProvisionMa // Constants uint32 private constant DEFAULT_MIN_VERIFIER_CUT = type(uint32).min; - uint32 private constant DEFAULT_MAX_VERIFIER_CUT = uint32(PPMMath.MAX_PPM); + uint32 internal constant DEFAULT_MAX_VERIFIER_CUT = uint32(PPMMath.MAX_PPM); uint64 private constant DEFAULT_MIN_THAWING_PERIOD = type(uint64).min; - uint64 private constant DEFAULT_MAX_THAWING_PERIOD = type(uint64).max; + uint64 internal constant DEFAULT_MAX_THAWING_PERIOD = type(uint64).max; uint256 private constant DEFAULT_MIN_PROVISION_TOKENS = type(uint256).min; - uint256 private constant DEFAULT_MAX_PROVISION_TOKENS = type(uint256).max; + uint256 internal constant DEFAULT_MAX_PROVISION_TOKENS = type(uint256).max; /** * @notice Emitted when the provision tokens range is set. diff --git a/packages/subgraph-service/contracts/SubgraphService.sol b/packages/subgraph-service/contracts/SubgraphService.sol index 5023e6160..909aa7750 100644 --- a/packages/subgraph-service/contracts/SubgraphService.sol +++ b/packages/subgraph-service/contracts/SubgraphService.sol @@ -21,9 +21,14 @@ import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol" import { Allocation } from "./libraries/Allocation.sol"; import { LegacyAllocation } from "./libraries/LegacyAllocation.sol"; +import { ProvisionManager } from "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol"; + + + contract SubgraphService is Initializable, OwnableUpgradeable, + ProvisionManager, DataService, DataServicePausableUpgradeable, DataServiceFees, @@ -359,7 +364,7 @@ contract SubgraphService is * @notice See {ISubgraphService.setMinimumProvisionTokens} */ function setMinimumProvisionTokens(uint256 minimumProvisionTokens) external override onlyOwner { - _setProvisionTokensRange(minimumProvisionTokens, type(uint256).max); + _setProvisionTokensRange(minimumProvisionTokens, DEFAULT_MAX_PROVISION_TOKENS); } /** @@ -473,7 +478,7 @@ contract SubgraphService is */ function _getThawingPeriodRange() internal view override returns (uint64 min, uint64 max) { uint64 disputePeriod = _disputeManager().getDisputePeriod(); - return (disputePeriod, type(uint64).max); + return (disputePeriod, DEFAULT_MAX_THAWING_PERIOD); } /** @@ -483,7 +488,7 @@ contract SubgraphService is */ function _getVerifierCutRange() internal view override returns (uint32 min, uint32 max) { uint32 verifierCut = _disputeManager().getVerifierCut(); - return (verifierCut, uint32(PPMMath.MAX_PPM)); + return (verifierCut, DEFAULT_MAX_VERIFIER_CUT); } /**