Skip to content

Commit

Permalink
docs: update module descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent committed Dec 7, 2023
1 parent 1e25f2d commit 03dd28e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docs/src/content/modules/dispute.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/modules/finality.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
8 changes: 4 additions & 4 deletions docs/src/content/modules/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 2 additions & 0 deletions docs/src/content/modules/resolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
5 changes: 3 additions & 2 deletions docs/src/content/modules/response.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 03dd28e

Please sign in to comment.