Skip to content

Commit

Permalink
chore: move unused modules (#79)
Browse files Browse the repository at this point in the history
* chore: move example modules contracts to separate folder

Include a small README in it.

* chore: move example contract interfaces to separate directory

* chore: update import filepaths

* chore: add warning in example modules

* chore: update import filepath in Deploy script

* Update solidity/contracts/examples/README.md

Co-authored-by: 0xJabberwock <[email protected]>

* chore: move MerkleLib and SparseMerkleTreeVerifier to examples/

* chore: update prophet-core dependency

---------

Co-authored-by: 0xJabberwock <[email protected]>
  • Loading branch information
xorsal and 0xJabberwock authored Nov 17, 2024
1 parent 022dfec commit d66609b
Show file tree
Hide file tree
Showing 45 changed files with 110 additions and 65 deletions.
3 changes: 3 additions & 0 deletions docs/src/content/modules/dispute/bonded_dispute_module.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Bonded Dispute Module

> [!CAUTION]
> The contracts included in the examples folder have not been thoroughly tested nor audited and are meant to be examples or source of inspiration for new modules. Do not use them in a production environment.
See [IBondedDisputeModule.sol](/solidity/interfaces/modules/dispute/IBondedDisputeModule.sol/interface.IBondedDisputeModule.md) for more details.

## 1. Introduction
Expand Down
3 changes: 3 additions & 0 deletions docs/src/content/modules/dispute/circuit_resolver_module.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Circuit Resolver Module

> [!CAUTION]
> The contracts included in the examples folder have not been thoroughly tested nor audited and are meant to be examples or source of inspiration for new modules. Do not use them in a production environment.
See [ICircuitResolverModule.sol](/solidity/interfaces/modules/dispute/ICircuitResolverModule.sol/interface.ICircuitResolverModule.md) for more details.

## 1. Introduction
Expand Down
3 changes: 3 additions & 0 deletions docs/src/content/modules/dispute/root_verification_module.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Root Verification Module

> [!CAUTION]
> The contracts included in the examples folder have not been thoroughly tested nor audited and are meant to be examples or source of inspiration for new modules. Do not use them in a production environment.
See [IRootVerificationModule.sol](/solidity/interfaces/modules/dispute/IRootVerificationModule.sol/interface.IRootVerificationModule.md) for more details.

## 1. Introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Multiple Callbacks Module

> [!CAUTION]
> The contracts included in the examples folder have not been thoroughly tested nor audited and are meant to be examples or source of inspiration for new modules. Do not use them in a production environment.
See [IMultipleCallbacksModule.sol](/solidity/interfaces/modules/finality/IMultipleCallbacksModule.sol/interface.IMultipleCallbacksModule.md) for more details.

## 1. Introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Contract Call Request Module

> [!CAUTION]
> The contracts included in the examples folder have not been thoroughly tested nor audited and are meant to be examples or source of inspiration for new modules. Do not use them in a production environment.
See [IContractCallRequestModule.sol](/solidity/interfaces/modules/request/IContractCallRequestModule.sol/interface.IContractCallRequestModule.md) for more details.

## 1. Introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Sparse Merkle Tree Request Module

> [!CAUTION]
> The contracts included in the examples folder have not been thoroughly tested nor audited and are meant to be examples or source of inspiration for new modules. Do not use them in a production environment.
See [ISparseMerkleTreeRequestModule.sol](/solidity/interfaces/modules/request/ISparseMerkleTreeRequestModule.sol/interface.ISparseMerkleTreeRequestModule.md) for more details.

## 1. Introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Bond Escalation Resolution Module

> [!CAUTION]
> The contracts included in the examples folder have not been thoroughly tested nor audited and are meant to be examples or source of inspiration for new modules. Do not use them in a production environment.
See [IBondEscalationResolutionModule.sol](/solidity/interfaces/modules/resolution/IBondEscalationResolutionModule.sol/interface.IBondEscalationResolutionModule.md) for more details.

## 1. Introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ERC20 Resolution Module

> [!CAUTION]
> The contracts included in the examples folder have not been thoroughly tested nor audited and are meant to be examples or source of inspiration for new modules. Do not use them in a production environment.
See [IERC20ResolutionModule.sol](/solidity/interfaces/modules/resolution/IERC20ResolutionModule.sol/interface.IERC20ResolutionModule.md) for more details.

## 1. Introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Private ERC20 Resolution Module

> [!CAUTION]
> The contracts included in the examples folder have not been thoroughly tested nor audited and are meant to be examples or source of inspiration for new modules. Do not use them in a production environment.
See [IPrivateERC20ResolutionModule.sol](/solidity/interfaces/modules/resolution/IPrivateERC20ResolutionModule.sol/interface.IPrivateERC20ResolutionModule.md) for more details.

## 1. Introduction
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"package.json": "sort-package-json"
},
"dependencies": {
"@defi-wonderland/prophet-core": "0.0.0-c80cc1e9",
"@defi-wonderland/prophet-core": "0.0.0-88db2d6f",
"@openzeppelin/contracts": "4.9.5",
"solmate": "https://github.com/transmissions11/solmate.git#bfc9c25865a274a7827fea5abf6e4fb64fc64e6c"
},
Expand Down
4 changes: 4 additions & 0 deletions solidity/contracts/examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
> [!CAUTION]
> Do not use the contracts in the example folder for production.
The contracts included in the examples folder have not been thoroughly tested nor audited. These are meant to be used as examples or inspiration for new modules. Do not use them in a production environment.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.19;
import {IModule, Module} from '@defi-wonderland/prophet-core/solidity/contracts/Module.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';

import {IBondedDisputeModule} from '../../../interfaces/modules/dispute/IBondedDisputeModule.sol';
import {IBondedDisputeModule} from '../../../../interfaces/examples/modules/dispute/IBondedDisputeModule.sol';

contract BondedDisputeModule is Module, IBondedDisputeModule {
constructor(IOracle _oracle) Module(_oracle) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
pragma solidity ^0.8.19;

import {IModule, Module} from '@defi-wonderland/prophet-core/solidity/contracts/Module.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';

import {IProphetVerifier} from '../../../interfaces/IProphetVerifier.sol';
import {ICircuitResolverModule} from '../../../interfaces/modules/dispute/ICircuitResolverModule.sol';

import {ModuleAccessController} from
'@defi-wonderland/prophet-core/solidity/contracts/access/ModuleAccessController.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';

import {IProphetVerifier} from '../../../../interfaces/IProphetVerifier.sol';
import {ICircuitResolverModule} from '../../../../interfaces/examples/modules/dispute/ICircuitResolverModule.sol';

contract CircuitResolverModule is ModuleAccessController, ICircuitResolverModule {
/// @notice Keeps track of the correct responses to requests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ pragma solidity ^0.8.19;
import {IModule, Module} from '@defi-wonderland/prophet-core/solidity/contracts/Module.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';

import {IRootVerificationModule} from '../../../interfaces/modules/dispute/IRootVerificationModule.sol';
import {IRootVerificationModule} from '../../../../interfaces/examples/modules/dispute/IRootVerificationModule.sol';

import {MerkleLib} from '../../libraries/MerkleLib.sol';
import {ModuleAccessController} from
'@defi-wonderland/prophet-core/solidity/contracts/access/ModuleAccessController.sol';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pragma solidity ^0.8.19;
import {IModule, Module} from '@defi-wonderland/prophet-core/solidity/contracts/Module.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';

import {IProphetCallback} from '../../../interfaces/IProphetCallback.sol';
import {IMultipleCallbacksModule} from '../../../interfaces/modules/finality/IMultipleCallbacksModule.sol';
import {IProphetCallback} from '../../../../interfaces/IProphetCallback.sol';
import {IMultipleCallbacksModule} from '../../../../interfaces/examples/modules/finality/IMultipleCallbacksModule.sol';

contract MultipleCallbacksModule is Module, IMultipleCallbacksModule {
constructor(IOracle _oracle) Module(_oracle) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ pragma solidity ^0.8.19;
import {IModule, Module} from '@defi-wonderland/prophet-core/solidity/contracts/Module.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';

import {IContractCallRequestModule} from '../../../interfaces/modules/request/IContractCallRequestModule.sol';
import {IContractCallRequestModule} from
'../../../../interfaces/examples/modules/request/IContractCallRequestModule.sol';

contract ContractCallRequestModule is Module, IContractCallRequestModule {
constructor(IOracle _oracle) Module(_oracle) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ pragma solidity ^0.8.19;
import {IModule, Module} from '@defi-wonderland/prophet-core/solidity/contracts/Module.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';

import {ISparseMerkleTreeRequestModule} from '../../../interfaces/modules/request/ISparseMerkleTreeRequestModule.sol';
import {ISparseMerkleTreeRequestModule} from
'../../../../interfaces/examples/modules/request/ISparseMerkleTreeRequestModule.sol';

contract SparseMerkleTreeRequestModule is Module, ISparseMerkleTreeRequestModule {
constructor(IOracle _oracle) Module(_oracle) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ import {IResolutionModule} from
'@defi-wonderland/prophet-core/solidity/interfaces/modules/resolution/IResolutionModule.sol';

import {IBondEscalationResolutionModule} from
'../../../interfaces/modules/resolution/IBondEscalationResolutionModule.sol';
'../../../../interfaces/examples/modules/resolution/IBondEscalationResolutionModule.sol';

import {ModuleAccessController} from
'@defi-wonderland/prophet-core/solidity/contracts/access/ModuleAccessController.sol';

import {ModuleTypehash} from '../../utils/ModuleTypehash.sol';
import {ModuleTypehash} from '../../../utils/ModuleTypehash.sol';

contract BondEscalationResolutionModule is ModuleAccessController, IBondEscalationResolutionModule {
using SafeERC20 for IERC20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {EnumerableSet} from '@openzeppelin/contracts/utils/structs/EnumerableSet
import {IModule, Module} from '@defi-wonderland/prophet-core/solidity/contracts/Module.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';

import {IERC20ResolutionModule} from '../../../interfaces/modules/resolution/IERC20ResolutionModule.sol';
import {IERC20ResolutionModule} from '../../../../interfaces/examples/modules/resolution/IERC20ResolutionModule.sol';

import {ModuleTypehash} from '../../utils/ModuleTypehash.sol';
import {ModuleTypehash} from '../../../utils/ModuleTypehash.sol';
import {ModuleAccessController} from
'@defi-wonderland/prophet-core/solidity/contracts/access/ModuleAccessController.sol';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import {EnumerableSet} from '@openzeppelin/contracts/utils/structs/EnumerableSet.sol';

import {ModuleTypehash} from '../../utils/ModuleTypehash.sol';
import {ModuleTypehash} from '../../../utils/ModuleTypehash.sol';
import {IModule, Module} from '@defi-wonderland/prophet-core/solidity/contracts/Module.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';

import {IPrivateERC20ResolutionModule} from '../../../interfaces/modules/resolution/IPrivateERC20ResolutionModule.sol';
import {IPrivateERC20ResolutionModule} from
'../../../../interfaces/examples/modules/resolution/IPrivateERC20ResolutionModule.sol';
import {ModuleAccessController} from
'@defi-wonderland/prophet-core/solidity/contracts/access/ModuleAccessController.sol';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

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

import {MerkleLib} from '../libraries/MerkleLib.sol';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle
import {IDisputeModule} from '@defi-wonderland/prophet-core/solidity/interfaces/modules/dispute/IDisputeModule.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

import {IAccountingExtension} from '../../extensions/IAccountingExtension.sol';
import {IAccountingExtension} from '../../../extensions/IAccountingExtension.sol';

/*
* @title BondedDisputeModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle
import {IDisputeModule} from '@defi-wonderland/prophet-core/solidity/interfaces/modules/dispute/IDisputeModule.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

import {IAccountingExtension} from '../../extensions/IAccountingExtension.sol';
import {IAccountingExtension} from '../../../extensions/IAccountingExtension.sol';

/**
* @title CircuitResolverModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle
import {IDisputeModule} from '@defi-wonderland/prophet-core/solidity/interfaces/modules/dispute/IDisputeModule.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

import {ITreeVerifier} from '../../ITreeVerifier.sol';
import {IAccountingExtension} from '../../extensions/IAccountingExtension.sol';
import {ITreeVerifier} from '../../../ITreeVerifier.sol';
import {IAccountingExtension} from '../../../extensions/IAccountingExtension.sol';

/*
* @title RootVerificationModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle
import {IRequestModule} from '@defi-wonderland/prophet-core/solidity/interfaces/modules/request/IRequestModule.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

import {IAccountingExtension} from '../../../interfaces/extensions/IAccountingExtension.sol';
import {IAccountingExtension} from '../../../../interfaces/extensions/IAccountingExtension.sol';

/**
* @title ContractCallRequestModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle
import {IRequestModule} from '@defi-wonderland/prophet-core/solidity/interfaces/modules/request/IRequestModule.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

import {ITreeVerifier} from '../../../interfaces/ITreeVerifier.sol';
import {IAccountingExtension} from '../../../interfaces/extensions/IAccountingExtension.sol';
import {ITreeVerifier} from '../../../../interfaces/ITreeVerifier.sol';
import {IAccountingExtension} from '../../../../interfaces/extensions/IAccountingExtension.sol';

/*
* @title SparseMerkleTreeRequestModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {IResolutionModule} from
'@defi-wonderland/prophet-core/solidity/interfaces/modules/resolution/IResolutionModule.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

import {IBondEscalationAccounting} from '../../extensions/IBondEscalationAccounting.sol';
import {IBondEscalationAccounting} from '../../../extensions/IBondEscalationAccounting.sol';

/**
* @title BondEscalationResolutionModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {IResolutionModule} from
'@defi-wonderland/prophet-core/solidity/interfaces/modules/resolution/IResolutionModule.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

import {IAccountingExtension} from '../../extensions/IAccountingExtension.sol';
import {IAccountingExtension} from '../../../extensions/IAccountingExtension.sol';

/**
* @title ERC20ResolutionModule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {IAccountingExtension} from '../../extensions/IAccountingExtension.sol';
import {IAccountingExtension} from '../../../extensions/IAccountingExtension.sol';

import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';
import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/access/IAccessController.sol';
Expand Down
21 changes: 12 additions & 9 deletions solidity/scripts/Deploy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@ import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle
import {IResolutionModule} from
'@defi-wonderland/prophet-core/solidity/interfaces/modules/resolution/IResolutionModule.sol';

import {BondedDisputeModule} from '../contracts/examples/modules/dispute/BondedDisputeModule.sol';
import {BondEscalationModule} from '../contracts/modules/dispute/BondEscalationModule.sol';
import {BondedDisputeModule} from '../contracts/modules/dispute/BondedDisputeModule.sol';

import {CircuitResolverModule} from '../contracts/modules/dispute/CircuitResolverModule.sol';
import {RootVerificationModule} from '../contracts/modules/dispute/RootVerificationModule.sol';
import {CircuitResolverModule} from '../contracts/examples/modules/dispute/CircuitResolverModule.sol';
import {RootVerificationModule} from '../contracts/examples/modules/dispute/RootVerificationModule.sol';

import {MultipleCallbacksModule} from '../contracts/examples/modules/finality/MultipleCallbacksModule.sol';
import {ContractCallRequestModule} from '../contracts/examples/modules/request/ContractCallRequestModule.sol';
import {CallbackModule} from '../contracts/modules/finality/CallbackModule.sol';
import {MultipleCallbacksModule} from '../contracts/modules/finality/MultipleCallbacksModule.sol';
import {ContractCallRequestModule} from '../contracts/modules/request/ContractCallRequestModule.sol';
import {HttpRequestModule} from '../contracts/modules/request/HttpRequestModule.sol';

import {SparseMerkleTreeRequestModule} from '../contracts/modules/request/SparseMerkleTreeRequestModule.sol';
import {SparseMerkleTreeRequestModule} from '../contracts/examples/modules/request/SparseMerkleTreeRequestModule.sol';

import {BondEscalationResolutionModule} from
'../contracts/examples/modules/resolution/BondEscalationResolutionModule.sol';
import {ERC20ResolutionModule} from '../contracts/examples/modules/resolution/ERC20ResolutionModule.sol';
import {PrivateERC20ResolutionModule} from '../contracts/examples/modules/resolution/PrivateERC20ResolutionModule.sol';
import {ArbitratorModule} from '../contracts/modules/resolution/ArbitratorModule.sol';
import {BondEscalationResolutionModule} from '../contracts/modules/resolution/BondEscalationResolutionModule.sol';
import {ERC20ResolutionModule} from '../contracts/modules/resolution/ERC20ResolutionModule.sol';
import {PrivateERC20ResolutionModule} from '../contracts/modules/resolution/PrivateERC20ResolutionModule.sol';
import {BondedResponseModule} from '../contracts/modules/response/BondedResponseModule.sol';

import {AccountingExtension} from '../contracts/extensions/AccountingExtension.sol';
Expand Down
2 changes: 1 addition & 1 deletion solidity/test/integration/ContractCallRequest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.19;
import {
ContractCallRequestModule,
IContractCallRequestModule
} from '../../contracts/modules/request/ContractCallRequestModule.sol';
} from '../../contracts/examples/modules/request/ContractCallRequestModule.sol';
import {MockCallee} from '../mocks/MockCallee.sol';
import './IntegrationBase.sol';

Expand Down
Loading

0 comments on commit d66609b

Please sign in to comment.