Skip to content

Commit d3b8cc2

Browse files
committed
misc: review function visibility
1 parent e358d12 commit d3b8cc2

File tree

8 files changed

+48
-48
lines changed

8 files changed

+48
-48
lines changed

contracts/curation/Curation.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration {
348348
* @return Amount of token reserves in the curation pool
349349
*/
350350
function getCurationPoolTokens(bytes32 _subgraphDeploymentID)
351-
public
351+
external
352352
override
353353
view
354354
returns (uint256)
@@ -381,7 +381,7 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration {
381381
* @return Amount of signal that can be bought with tokens
382382
*/
383383
function _tokensToSignal(bytes32 _subgraphDeploymentID, uint256 _tokensIn)
384-
internal
384+
private
385385
view
386386
returns (uint256)
387387
{
@@ -450,7 +450,7 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration {
450450
* @dev Triggers an update of rewards due to a change in signal.
451451
* @param _subgraphDeploymentID Subgraph deployment updated
452452
*/
453-
function _updateRewards(bytes32 _subgraphDeploymentID) internal {
453+
function _updateRewards(bytes32 _subgraphDeploymentID) private {
454454
IRewardsManager rewardsManager = rewardsManager();
455455
if (address(rewardsManager) != address(0)) {
456456
rewardsManager.onSubgraphSignalUpdate(_subgraphDeploymentID);

contracts/discovery/GNS.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ contract GNS is GNSV1Storage, GraphUpgradeable, IGNS {
181181
* the name curators tokens while upgrading or deprecating and is configurable in parts per hundred.
182182
* @param _ownerTaxPercentage Owner tax percentage
183183
*/
184-
function _setOwnerTaxPercentage(uint32 _ownerTaxPercentage) internal {
184+
function _setOwnerTaxPercentage(uint32 _ownerTaxPercentage) private {
185185
require(_ownerTaxPercentage <= 100, "Owner tax must be 100 or less");
186186
ownerTaxPercentage = _ownerTaxPercentage;
187187
emit ParameterUpdated("ownerTaxPercentage");

contracts/discovery/ServiceRegistry.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ contract ServiceRegistry is Managed, IServiceRegistry {
7070
address _indexer,
7171
string calldata _url,
7272
string calldata _geohash
73-
) internal {
73+
) private {
7474
require(_isAuth(_indexer), "!auth");
7575
require(bytes(_url).length > 0, "Service must specify a URL");
7676

@@ -98,7 +98,7 @@ contract ServiceRegistry is Managed, IServiceRegistry {
9898
* @dev Unregister an indexer service
9999
* @param _indexer Address of the indexer
100100
*/
101-
function _unregister(address _indexer) internal {
101+
function _unregister(address _indexer) private {
102102
require(_isAuth(_indexer), "!auth");
103103
require(isRegistered(_indexer), "Service already unregistered");
104104

contracts/disputes/DisputeManager.sol

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ contract DisputeManager is Managed, IDisputeManager {
475475
uint256 _deposit,
476476
Attestation memory _attestation,
477477
bytes memory _attestationData
478-
) internal returns (bytes32) {
478+
) private returns (bytes32) {
479479
// Get the indexer that signed the attestation
480480
address indexer = getAttestationIndexer(_attestation);
481481

@@ -547,7 +547,7 @@ contract DisputeManager is Managed, IDisputeManager {
547547
address _fisherman,
548548
uint256 _deposit,
549549
address _allocationID
550-
) internal returns (bytes32) {
550+
) private returns (bytes32) {
551551
// Create a disputeID
552552
bytes32 disputeID = keccak256(abi.encodePacked(_allocationID));
553553

@@ -664,7 +664,7 @@ contract DisputeManager is Managed, IDisputeManager {
664664
* @param _dispute Dispute
665665
* @return True conflicting attestation dispute
666666
*/
667-
function _isDisputeInConflict(Dispute memory _dispute) internal pure returns (bool) {
667+
function _isDisputeInConflict(Dispute memory _dispute) private pure returns (bool) {
668668
return _dispute.relatedDisputeID != 0;
669669
}
670670

@@ -673,7 +673,7 @@ contract DisputeManager is Managed, IDisputeManager {
673673
* @param _dispute Dispute
674674
* @return True if resolved
675675
*/
676-
function _resolveDisputeInConflict(Dispute memory _dispute) internal returns (bool) {
676+
function _resolveDisputeInConflict(Dispute memory _dispute) private returns (bool) {
677677
if (_isDisputeInConflict(_dispute)) {
678678
bytes32 relatedDisputeID = _dispute.relatedDisputeID;
679679
delete disputes[relatedDisputeID];
@@ -686,7 +686,7 @@ contract DisputeManager is Managed, IDisputeManager {
686686
* @dev Pull deposit from submitter account.
687687
* @param _deposit Amount of tokens to deposit
688688
*/
689-
function _pullSubmitterDeposit(uint256 _deposit) internal {
689+
function _pullSubmitterDeposit(uint256 _deposit) private {
690690
// Ensure that fisherman has staked at least the minimum amount
691691
require(_deposit >= minimumDeposit, "Dispute deposit is under minimum required");
692692

@@ -704,7 +704,7 @@ contract DisputeManager is Managed, IDisputeManager {
704704
* @param _challenger Address of the challenger
705705
* @return Dispute reward tokens
706706
*/
707-
function _slashIndexer(address _indexer, address _challenger) internal returns (uint256) {
707+
function _slashIndexer(address _indexer, address _challenger) private returns (uint256) {
708708
// Have staking contract slash the indexer and reward the fisherman
709709
// Give the fisherman a reward equal to the fishermanRewardPercentage of slashed amount
710710
uint256 tokensToSlash = getTokensToSlash(_indexer);
@@ -722,7 +722,7 @@ contract DisputeManager is Managed, IDisputeManager {
722722
* @return Signer address
723723
*/
724724
function _recoverAttestationSigner(Attestation memory _attestation)
725-
internal
725+
private
726726
view
727727
returns (address)
728728
{
@@ -747,7 +747,7 @@ contract DisputeManager is Managed, IDisputeManager {
747747
* @dev Get the running network chain ID
748748
* @return The chain ID
749749
*/
750-
function _getChainID() internal pure returns (uint256) {
750+
function _getChainID() private pure returns (uint256) {
751751
uint256 id;
752752
assembly {
753753
id := chainid()
@@ -759,7 +759,7 @@ contract DisputeManager is Managed, IDisputeManager {
759759
* @dev Parse the bytes attestation into a struct from `_data`.
760760
* @return Attestation struct
761761
*/
762-
function _parseAttestation(bytes memory _data) internal pure returns (Attestation memory) {
762+
function _parseAttestation(bytes memory _data) private pure returns (Attestation memory) {
763763
// Check attestation data length
764764
require(_data.length == ATTESTATION_SIZE_BYTES, "Attestation must be 161 bytes long");
765765

@@ -782,7 +782,7 @@ contract DisputeManager is Managed, IDisputeManager {
782782
* @dev Parse a uint8 from `_bytes` starting at offset `_start`.
783783
* @return uint8 value
784784
*/
785-
function _toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
785+
function _toUint8(bytes memory _bytes, uint256 _start) private pure returns (uint8) {
786786
require(_bytes.length >= (_start + UINT8_BYTE_LENGTH), "Bytes: out of bounds");
787787
uint8 tempUint;
788788

@@ -797,7 +797,7 @@ contract DisputeManager is Managed, IDisputeManager {
797797
* @dev Parse a bytes32 from `_bytes` starting at offset `_start`.
798798
* @return bytes32 value
799799
*/
800-
function _toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {
800+
function _toBytes32(bytes memory _bytes, uint256 _start) private pure returns (bytes32) {
801801
require(_bytes.length >= (_start + BYTES32_BYTE_LENGTH), "Bytes: out of bounds");
802802
bytes32 tempBytes32;
803803

contracts/epochs/EpochManager.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ contract EpochManager is EpochManagerV1Storage, GraphUpgradeable, IEpochManager
8787
* @dev Return blockhash for a block.
8888
* @return BlockHash for `_block` number
8989
*/
90-
function blockHash(uint256 _block) public override view returns (bytes32) {
90+
function blockHash(uint256 _block) external override view returns (bytes32) {
9191
uint256 currentBlock = blockNum();
9292

9393
require(_block < currentBlock, "Can only retrieve past block hashes");
@@ -119,7 +119,7 @@ contract EpochManager is EpochManagerV1Storage, GraphUpgradeable, IEpochManager
119119
* @dev Return the number of blocks that passed since current epoch started.
120120
* @return Blocks that passed since start of epoch
121121
*/
122-
function currentEpochBlockSinceStart() public override view returns (uint256) {
122+
function currentEpochBlockSinceStart() external override view returns (uint256) {
123123
return blockNum() - currentEpochBlock();
124124
}
125125

@@ -128,7 +128,7 @@ contract EpochManager is EpochManagerV1Storage, GraphUpgradeable, IEpochManager
128128
* @param _epoch Epoch to use as since epoch value
129129
* @return Number of epochs and current epoch
130130
*/
131-
function epochsSince(uint256 _epoch) public override view returns (uint256) {
131+
function epochsSince(uint256 _epoch) external override view returns (uint256) {
132132
uint256 epoch = currentEpoch();
133133
return _epoch < epoch ? epoch.sub(_epoch) : 0;
134134
}

contracts/rewards/RewardsManager.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ contract RewardsManager is RewardsManagerV1Storage, GraphUpgradeable, IRewardsMa
6666
* To accommodate a high precision the issuance rate is expressed in wei.
6767
* @param _issuanceRate Issuance rate expressed in wei
6868
*/
69-
function setIssuanceRate(uint256 _issuanceRate) public override onlyGovernor {
69+
function setIssuanceRate(uint256 _issuanceRate) external override onlyGovernor {
7070
_setIssuanceRate(_issuanceRate);
7171
}
7272

@@ -133,7 +133,7 @@ contract RewardsManager is RewardsManagerV1Storage, GraphUpgradeable, IRewardsMa
133133
* @param _subgraphDeploymentID Subgraph deployment ID
134134
* @param _deny Whether to set the subgraph as denied for claiming rewards or not
135135
*/
136-
function _setDenied(bytes32 _subgraphDeploymentID, bool _deny) internal {
136+
function _setDenied(bytes32 _subgraphDeploymentID, bool _deny) private {
137137
uint256 sinceBlock = _deny ? block.number : 0;
138138
denylist[_subgraphDeploymentID] = sinceBlock;
139139
emit RewardsDenylistUpdated(_subgraphDeploymentID, sinceBlock);
@@ -272,7 +272,7 @@ contract RewardsManager is RewardsManagerV1Storage, GraphUpgradeable, IRewardsMa
272272
* @return Accumulated rewards for subgraph
273273
*/
274274
function onSubgraphSignalUpdate(bytes32 _subgraphDeploymentID)
275-
public
275+
external
276276
override
277277
returns (uint256)
278278
{
@@ -314,7 +314,7 @@ contract RewardsManager is RewardsManagerV1Storage, GraphUpgradeable, IRewardsMa
314314
* @param _allocationID Allocation
315315
* @return Rewards amount for an allocation
316316
*/
317-
function getRewards(address _allocationID) public override view returns (uint256) {
317+
function getRewards(address _allocationID) external override view returns (uint256) {
318318
IStaking.Allocation memory alloc = staking().getAllocation(_allocationID);
319319

320320
(uint256 accRewardsPerAllocatedToken, ) = getAccRewardsPerAllocatedToken(
@@ -339,7 +339,7 @@ contract RewardsManager is RewardsManagerV1Storage, GraphUpgradeable, IRewardsMa
339339
uint256 _tokens,
340340
uint256 _startAccRewardsPerAllocatedToken,
341341
uint256 _endAccRewardsPerAllocatedToken
342-
) internal pure returns (uint256) {
342+
) private pure returns (uint256) {
343343
uint256 newAccrued = _endAccRewardsPerAllocatedToken.sub(_startAccRewardsPerAllocatedToken);
344344
return newAccrued.mul(_tokens).div(TOKEN_DECIMALS);
345345
}
@@ -394,7 +394,7 @@ contract RewardsManager is RewardsManagerV1Storage, GraphUpgradeable, IRewardsMa
394394
uint256 x,
395395
uint256 n,
396396
uint256 base
397-
) internal pure returns (uint256 z) {
397+
) private pure returns (uint256 z) {
398398
assembly {
399399
switch x
400400
case 0 {

0 commit comments

Comments
 (0)