From 03dd28e9baafe6821bd3677601ef578fa4658707 Mon Sep 17 00:00:00 2001 From: Gas One Cent <86567384+gas1cent@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:05:06 +0400 Subject: [PATCH] docs: update module descriptions --- docs/src/content/modules/dispute.md | 6 +++--- docs/src/content/modules/finality.md | 2 +- docs/src/content/modules/request.md | 8 ++++---- docs/src/content/modules/resolution.md | 2 ++ docs/src/content/modules/response.md | 5 +++-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/src/content/modules/dispute.md b/docs/src/content/modules/dispute.md index a72f974a..7f0f5997 100644 --- a/docs/src/content/modules/dispute.md +++ b/docs/src/content/modules/dispute.md @@ -12,13 +12,13 @@ In Prophet, examples of Dispute modules include: ## Dispute Types -- Pre-dispute: This type of Dispute modules aims to settle disputes before they reach the Resolution module. `BondEscalationModule` is an example of a pre-dispute module. +- **Pre-dispute**: This type of Dispute modules aims to settle disputes before they reach the Resolution module. `BondEscalationModule` is an example of a pre-dispute module. -- Atomical dispute: This type of dispute relies on an external contract to atomically resolve the dispute as soon as it's started. In this case the Resolution module might not be needed at all. `CircuitResolverModule` and `RootVerificationModule` are examples of atomical dispute modules. +- **Atomical dispute**: This type of dispute relies on an external contract to atomically resolve the dispute as soon as it's started. In this case the Resolution module might not be needed at all. `CircuitResolverModule` and `RootVerificationModule` are examples of atomical dispute modules. ## Developing a Dispute Module -When developing a Dispute module, you should: +When developing a Dispute module, after inheriting the [`IDisputeModule`](/solidity/interfaces/core/modules/dispute/IDisputeModule.sol/interface.IDisputeModule.md) interface, you should: - Define the criteria for challengers to be able to initiate a dispute - Set the rules for the disputes, such as validations or deadlines diff --git a/docs/src/content/modules/finality.md b/docs/src/content/modules/finality.md index 3acbe1c5..66983805 100644 --- a/docs/src/content/modules/finality.md +++ b/docs/src/content/modules/finality.md @@ -10,4 +10,4 @@ Prophet's Finality modules: ## Creating a Finality Module -To build a Finality module, inherit from `IFinalityModule` and the `Module` abstract contract, create the `RequestParameters` struct and define the logic in the `finalizeRequest` function. Most importantly, make sure to handle the finalization with and without a response. +To build a Finality module, inherit from [`IFinalityModule`](/solidity/interfaces/core/modules/finality/IFinalityModule.sol/interface.IFinalityModule.md) and the `Module` abstract contract, create the `RequestParameters` struct and define the logic in the `finalizeRequest` function. Most importantly, make sure to handle the finalization with and without a response. diff --git a/docs/src/content/modules/request.md b/docs/src/content/modules/request.md index 7a377214..c94fe951 100644 --- a/docs/src/content/modules/request.md +++ b/docs/src/content/modules/request.md @@ -2,7 +2,7 @@ ## Introduction -All modules in the Prophet Framework are designed to handle specific parts of a request's lifecycle and the Request module is responsible for asking for the information and configuring a reward. This includes declaring the source for the response and running any necessary validations or actions specified in the `_afterSetupRequest` function. +All modules in the Prophet Framework are designed to handle specific parts of a request's lifecycle and the Request module is responsible for asking for the information and configuring a reward. This includes declaring the source for the response and running any necessary validations or actions specified in the `createRequest` function. Prophet's Request modules: - [ContractCallRequestModule](./request/contract_call_request_module.md) to request data from a smart contract @@ -11,9 +11,9 @@ Prophet's Request modules: ## Creating a Request Module -Creating a Request module is as simple as defining a contract that inherits from the `IRequestModule` interface and implements the necessary logic in the `_afterSetupRequest` and `finalizeRequest` hooks, as well as any custom logic. +Creating a Request module is as simple as following from the [`IRequestModule`](/solidity/interfaces/core/modules/request/IRequestModule.sol/interface.IRequestModule.md) interface and implementing the necessary logic in the `createRequest` and `finalizeRequest` hooks, as well as any custom logic. A good Request module should take care of the following: -- Declaring the data source for proposers to be able to answer the request -- Specifying the reward for proposing a valid answer +- Defining the `RequestParameters` struct with the necessary configuration for requests, such as the data source and the reward - Providing a way for the requester to withdraw the reward if no valid answer is proposed +- Securing the hooks with the `onlyOracle` modifier diff --git a/docs/src/content/modules/resolution.md b/docs/src/content/modules/resolution.md index 63d1822e..9b7b1918 100644 --- a/docs/src/content/modules/resolution.md +++ b/docs/src/content/modules/resolution.md @@ -10,3 +10,5 @@ In Prophet, examples of Resolution modules include: - [PrivateERC20ResolutionModule](./resolution/private_erc20_resolution_module.md) that allows users to vote on a dispute using ERC20 tokens following a commit/reveal pattern. - [BondEscalationResolutionModule](./resolution/bond_escalation_resolution_module.md) that follows a bond escalation-like process to resolve disputes. - [SequentialResolutionModule](./resolution/sequential_resolution_module.md) that leverages multiple resolution modules to obtain an answer. + +They all follow the [IResolutionModule](/solidity/interfaces/core/modules/resolution/IResolutionModule.sol/interface.IResolutionModule.md) interface. diff --git a/docs/src/content/modules/response.md b/docs/src/content/modules/response.md index e6fbb7c8..84840ce6 100644 --- a/docs/src/content/modules/response.md +++ b/docs/src/content/modules/response.md @@ -2,18 +2,19 @@ ## Introduction -The Response module is a vital part of any request that manages the requirements the requester has for the proposers, such as holding an NFT, being in a pre-defined list of addresses or providing a bond. +The Response module is a vital part of any request that manages the requirements the requester has for the proposers, such as holding an NFT, being in a pre-defined list of addresses or providing a bond, and pays out the rewards for accepted responses. Prophet's Response modules: - [BondedResponseModule](./response/bonded_response_module.md) that requires a proposer to post a bond first, which will be returned upon request finalization or slashed in case of a successful dispute. ## Creating a Response Module -To build a Response module, simply inherit from `IResponseModule` and the `Module` abstract contract, create the `RequestParameters` struct and define the logic for proposing, deleting and finalizing responses. +To build a Response module, simply inherit from [`IResponseModule`](/solidity/interfaces/core/modules/response/IResponseModule.sol/interface.IResponseModule.md) and the `Module` abstract contract, create the `RequestParameters` struct and define the logic for proposing, deleting and finalizing responses. A Response module should take care of the following: - Defining the criteria for proposers to be able to answer the request - Setting the rules for the responses, such as validations or deadlines - Handling the rewards for proposing a valid response +- Applying the `onlyOracle` modifier to the hooks to secure them While developing a Response module, keep in mind that the criteria that is too narrow might result in a lack of responses, while criteria that is too broad might result in a large number of invalid responses.