Skip to content

Commit

Permalink
docs: finalize natspec
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Migone <[email protected]>
  • Loading branch information
tmigone committed Jun 3, 2024
1 parent 1aef94b commit 2733112
Show file tree
Hide file tree
Showing 18 changed files with 944 additions and 142 deletions.
21 changes: 11 additions & 10 deletions packages/horizon/contracts/data-service/GraphDirectory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,36 @@ import { ICuration } from "@graphprotocol/contracts/contracts/curation/ICuration
abstract contract GraphDirectory {
// -- Graph Horizon contracts --

/// @dev The Graph Token contract address
/// @notice The Graph Token contract address
IGraphToken private immutable GRAPH_TOKEN;

/// @dev The Horizon Staking contract address
/// @notice The Horizon Staking contract address
IHorizonStaking private immutable GRAPH_STAKING;

/// @dev The Graph Payments contract address
/// @notice The Graph Payments contract address
IGraphPayments private immutable GRAPH_PAYMENTS;

/// @dev The Payments Escrow contract address
/// @notice The Payments Escrow contract address
IPaymentsEscrow private immutable GRAPH_PAYMENTS_ESCROW;

// -- Graph periphery contracts --

/// @dev The Graph Controller contract address
/// @notice The Graph Controller contract address
IController private immutable GRAPH_CONTROLLER;

/// @dev The Epoch Manager contract address
/// @notice The Epoch Manager contract address
IEpochManager private immutable GRAPH_EPOCH_MANAGER;

/// @dev The Rewards Manager contract address
/// @notice The Rewards Manager contract address
IRewardsManager private immutable GRAPH_REWARDS_MANAGER;

/// @dev The Token Gateway contract address
/// @notice The Token Gateway contract address
ITokenGateway private immutable GRAPH_TOKEN_GATEWAY;

/// @dev The Bridge Escrow contract address
/// @notice The Bridge Escrow contract address
IBridgeEscrow private immutable GRAPH_BRIDGE_ESCROW;

/// @dev The Graph Proxy Admin contract address
/// @notice The Graph Proxy Admin contract address
IGraphProxyAdmin private immutable GRAPH_PROXY_ADMIN;

// -- Legacy Graph contracts --
Expand Down Expand Up @@ -104,6 +104,7 @@ abstract contract GraphDirectory {
* - `controller` cannot be zero address
*
* Emits a {GraphDirectoryInitialized} event
*
* @param controller The address of the Graph Controller contract.
*/
constructor(address controller) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ interface IDataService {
* @dev Before registering, the service provider must have created a provision in the
* Graph Horizon staking contract with parameters that are compatible with the data service.
*
* Verifies the provision parameters and marks it as accepted it in the Graph Horizon
* staking contract using {_acceptProvision}.
* Verifies provision parameters and rejects registration in the event they are not valid.
*
* Emits a {ServiceProviderRegistered} event.
*
Expand All @@ -82,10 +81,9 @@ interface IDataService {
function register(address serviceProvider, bytes calldata data) external;

/**
* @notice Accepts the provision of a service provider in the {Graph Horizon staking
* @notice Accepts staged parameters in the provision of a service provider in the {Graph Horizon staking
* contract}.
* @dev Provides a way for the data service to revalidate and reaccept a provision that
* had a parameter change. Should call {_acceptProvision}.
* @dev Provides a way for the data service to validate and accept provision parameter changes. Call {_acceptProvision}.
*
* Emits a {ProvisionAccepted} event.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,42 @@ abstract contract ProvisionManager is Initializable, GraphDirectory, ProvisionMa
_;
}

/**
* @notice External getter for the thawing period range
* @return Minimum thawing period allowed
* @return Maximum thawing period allowed
*/
function getThawingPeriodRange() external view returns (uint64, uint64) {
return _getThawingPeriodRange();
}

/**
* @notice External getter for the verifier cut range
* @return Minimum verifier cut allowed
* @return Maximum verifier cut allowed
*/
function getVerifierCutRange() external view returns (uint32, uint32) {
return _getVerifierCutRange();
}

/**
* @notice External getter for the provision tokens range
* @return Minimum provision tokens allowed
* @return Maximum provision tokens allowed
*/
function getProvisionTokensRange() external view returns (uint256, uint256) {
return _getProvisionTokensRange();
}

/**
* @notice External getter for the delegation ratio range
* @return Minimum delegation ratio allowed
* @return Maximum delegation ratio allowed
*/
function getDelegationRatioRange() external view returns (uint32, uint32) {
return _getDelegationRatioRange();
}

/**
* @notice Initializes the contract and any parent contracts.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,9 @@ interface IHorizonStakingMain {
* the provider has provisioned stake, and up to the amount of tokens they have provisioned.
* If the service provider's stake is not enough, the associated delegation pool might be slashed
* depending on the value of the global delegation slashing flag.
*
* Part of the slashed tokens are sent to the `verifierDestination` as a reward.
*
* @dev Requirements:
* - `tokens` must be less than or equal to the amount of tokens provisioned by the service provider.
* - `tokensVerifier` must be less than the provision's tokens times the provision's maximum verifier cut.
Expand Down
Loading

0 comments on commit 2733112

Please sign in to comment.