Skip to content

Commit

Permalink
docs: review natspec and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent committed Nov 11, 2023
1 parent 8103280 commit 5ed7651
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ The `SparseMerkleTreeRequestModule` is a contract that allows a user to request

### Key Methods

- `decodeRequestData(bytes calldata _data)`: This function decodes the request data for a given request ID. It returns a RequestParameters struct that contains the parameters for the request.
- `finalizeRequest(bytes32 _requestId, address _finalizer)`: This function is called by the Oracle to finalize the request. It either pays the proposer for the response or releases the requester's bond if no response was submitted.
- `decodeRequestData`: This function decodes the request data for a given request ID. It returns a RequestParameters struct that contains the parameters for the request.
- `finalizeRequest`: This function is called by the Oracle to finalize the request. It either pays the proposer for the response or releases the requester's bond if no response was submitted.

### Request Parameters

Expand All @@ -28,5 +28,5 @@ The `SparseMerkleTreeRequestModule` uses a Merkle tree to calculate the root fro

## 4. Gotchas

- The module is supposed to be paired with the root verification module.
- The module is supposed to be paired with [`RootVerificationModule`](../dispute/root_verification_module.md).
- The verifier contract must follow the `ITreeVerifier` interface, otherwise the proposers won't be able to calculate the correct response.
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,27 @@ interface ISparseMerkleTreeRequestModule is IRequestModule {

/**
* @notice Returns the decoded data for a request
* @param _data The encoded request parameters
* @return _params The struct containing the parameters for the request
*
* @param _data The encoded request parameters
* @return _params The struct containing the parameters for the request
*/
function decodeRequestData(bytes calldata _data) external view returns (RequestParameters memory _params);

/// @inheritdoc IRequestModule
/**
* @notice Executes pre-request logic, bonding the requester's funds
*
* @param _requestId The id of the request
* @param _data The encoded request parameters
* @param _requester The user who triggered the request
*/
function createRequest(bytes32 _requestId, bytes calldata _data, address _requester) external;

/**
* @notice Finalizes the request by paying the proposer for the response or releasing the requester's bond if no response was submitted
*
* @param _request The request that is being finalized
* @param _response The final response
* @param _finalizer The user who triggered the finalization
* @param _request The request that is being finalized
* @param _response The final response
* @param _finalizer The user who triggered the finalization
*/
function finalizeRequest(
IOracle.Request calldata _request,
Expand Down

0 comments on commit 5ed7651

Please sign in to comment.