Skip to content

Commit

Permalink
docs: add missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xorsal committed Dec 11, 2024
1 parent 3c856b9 commit f9f33fd
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions solidity/contracts/Module.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {IOracle} from '../interfaces/IOracle.sol';

import {Validator} from './Validator.sol';

/**
* @title Module
* @notice abstract contract implemented by all Modules
*/
abstract contract Module is Validator, IModule {
constructor(IOracle _oracle) Validator(_oracle) {}

Expand Down
4 changes: 4 additions & 0 deletions solidity/contracts/Oracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import {ValidatorLib} from '../libraries/ValidatorLib.sol';
import {OracleAccessController} from './access/OracleAccessController.sol';
import {OracleTypehash} from './utils/OracleTypehash.sol';

/**
* @title Oracle
* @notice Source of truth for applications built on top of Prophet
*/
contract Oracle is IOracle, OracleAccessController {
using ValidatorLib for *;

Expand Down
4 changes: 4 additions & 0 deletions solidity/contracts/access/CommonAccessController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ pragma solidity ^0.8.19;
import {IAccessController} from '../../interfaces/access/IAccessController.sol';
import {IAccessModule} from '../../interfaces/modules/access/IAccessModule.sol';

/**
* @title CommonAccessController
* @notice abstract contract implemented by AccessControllers
*/
abstract contract CommonAccessController is IAccessController {
/**
* @notice Check whether the caller is authorized for the given parameters.
Expand Down
4 changes: 4 additions & 0 deletions solidity/contracts/access/ModuleAccessController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {IModuleAccessController} from '../../interfaces/access/IModuleAccessCont
import {Module} from '../Module.sol';
import {CommonAccessController} from './CommonAccessController.sol';

/**
* @title ModuleAccessController
* @notice abstract contract to manage access control at the Modules level
*/
abstract contract ModuleAccessController is IModuleAccessController, CommonAccessController, Module {
constructor(IOracle _oracle) Module(_oracle) {}

Expand Down
4 changes: 4 additions & 0 deletions solidity/contracts/access/OracleAccessController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ pragma solidity ^0.8.19;
import {IOracleAccessController} from '../../interfaces/access/IOracleAccessController.sol';
import {CommonAccessController} from './CommonAccessController.sol';

/**
* @title OracleAccessController
* @notice abstract contract to manage access control at the Oracle level
*/
abstract contract OracleAccessController is IOracleAccessController, CommonAccessController {
/// @inheritdoc IOracleAccessController
mapping(address _user => mapping(address _accessModule => bool _approved)) public isAccessModuleApproved;
Expand Down
3 changes: 3 additions & 0 deletions solidity/contracts/utils/OracleTypehash.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

/**
* @title OracleTypehash
*/
library OracleTypehash {
bytes32 public constant CREATE_TYPEHASH =
keccak256('createRequest(Request _request,bytes32 _ipfsHash,AccessControl _accessControl');
Expand Down
4 changes: 4 additions & 0 deletions solidity/interfaces/modules/dispute/IDisputeModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ pragma solidity ^0.8.19;
import {IModule} from '../../IModule.sol';
import {IOracle} from '../../IOracle.sol';

/**
* @title DisputeModule
* @notice Common interface for all dispute modules
*/
interface IDisputeModule is IModule {
/*///////////////////////////////////////////////////////////////
EVENTS
Expand Down
4 changes: 4 additions & 0 deletions solidity/interfaces/modules/finality/IFinalityModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ pragma solidity ^0.8.19;

import {IModule} from '../../IModule.sol';

/**
* @title FinalityModule
* @notice Common interface for all finality modules
*/
interface IFinalityModule is IModule {}
4 changes: 4 additions & 0 deletions solidity/interfaces/modules/request/IRequestModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ pragma solidity ^0.8.19;

import {IModule} from '../../IModule.sol';

/**
* @title RequestModule
* @notice Common interface for all request modules
*/
interface IRequestModule is IModule {
/**
* @notice Called by the oracle when a request has been made
Expand Down
3 changes: 3 additions & 0 deletions solidity/libraries/ValidatorLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ pragma solidity ^0.8.19;

import {IOracle} from '../interfaces/IOracle.sol';

/**
* @title ValidatorLib
*/
library ValidatorLib {
/**
* @notice Thrown when the response provided does not match the request
Expand Down

0 comments on commit f9f33fd

Please sign in to comment.