Skip to content

Commit

Permalink
refactor: remove ModuleAccessController (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent authored Nov 14, 2024
1 parent a76c5a0 commit 022dfec
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 110 deletions.
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-0e46031c",
"@defi-wonderland/prophet-core": "0.0.0-c80cc1e9",
"@openzeppelin/contracts": "4.9.5",
"solmate": "https://github.com/transmissions11/solmate.git#bfc9c25865a274a7827fea5abf6e4fb64fc64e6c"
},
Expand Down
51 changes: 0 additions & 51 deletions solidity/contracts/modules/access/ModuleAccessController.sol

This file was deleted.

3 changes: 2 additions & 1 deletion solidity/contracts/modules/dispute/BondEscalationModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {FixedPointMathLib} from 'solmate/src/utils/FixedPointMathLib.sol';

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

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

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

Expand Down
3 changes: 2 additions & 1 deletion solidity/contracts/modules/dispute/CircuitResolverModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle
import {IProphetVerifier} from '../../../interfaces/IProphetVerifier.sol';
import {ICircuitResolverModule} from '../../../interfaces/modules/dispute/ICircuitResolverModule.sol';

import {ModuleAccessController} from '../access/ModuleAccessController.sol';
import {ModuleAccessController} from
'@defi-wonderland/prophet-core/solidity/contracts/access/ModuleAccessController.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 @@ -6,7 +6,8 @@ import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle

import {IRootVerificationModule} from '../../../interfaces/modules/dispute/IRootVerificationModule.sol';
import {MerkleLib} from '../../libraries/MerkleLib.sol';
import {ModuleAccessController} from '../access/ModuleAccessController.sol';
import {ModuleAccessController} from
'@defi-wonderland/prophet-core/solidity/contracts/access/ModuleAccessController.sol';

contract RootVerificationModule is ModuleAccessController, IRootVerificationModule {
using MerkleLib for MerkleLib.Tree;
Expand Down
4 changes: 3 additions & 1 deletion solidity/contracts/modules/resolution/ArbitratorModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
pragma solidity ^0.8.19;

import {IModule, Module} from '@defi-wonderland/prophet-core/solidity/contracts/Module.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 {IArbitrator} from '../../../interfaces/IArbitrator.sol';
import {IArbitratorModule} from '../../../interfaces/modules/resolution/IArbitratorModule.sol';
import {ModuleAccessController} from '../access/ModuleAccessController.sol';

contract ArbitratorModule is ModuleAccessController, IArbitratorModule {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {IResolutionModule} from

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle
import {IERC20ResolutionModule} from '../../../interfaces/modules/resolution/IERC20ResolutionModule.sol';

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

contract ERC20ResolutionModule is ModuleAccessController, IERC20ResolutionModule {
using SafeERC20 for IERC20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {IModule, Module} from '@defi-wonderland/prophet-core/solidity/contracts/
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';

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

contract PrivateERC20ResolutionModule is ModuleAccessController, IPrivateERC20ResolutionModule {
using SafeERC20 for IERC20;
Expand Down
2 changes: 1 addition & 1 deletion solidity/interfaces/IArbitrator.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

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

Check warning on line 5 in solidity/interfaces/IArbitrator.sol

View workflow job for this annotation

GitHub Actions / Run Linters (16.x)

imported name IAccessController is not used

interface IArbitrator {
/**
Expand Down
35 changes: 0 additions & 35 deletions solidity/interfaces/modules/access/IModuleAccessController.sol

This file was deleted.

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

import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/IAccessController.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';
import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/access/IAccessController.sol';
import {IDisputeModule} from '@defi-wonderland/prophet-core/solidity/interfaces/modules/dispute/IDisputeModule.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

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

import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/IAccessController.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';
import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/access/IAccessController.sol';
import {IResolutionModule} from
'@defi-wonderland/prophet-core/solidity/interfaces/modules/resolution/IResolutionModule.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/IAccessController.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';
import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/access/IAccessController.sol';
import {IResolutionModule} from
'@defi-wonderland/prophet-core/solidity/interfaces/modules/resolution/IResolutionModule.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity ^0.8.19;

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

import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/IAccessController.sol';
import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';
import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/access/IAccessController.sol';
import {IResolutionModule} from
'@defi-wonderland/prophet-core/solidity/interfaces/modules/resolution/IResolutionModule.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
Expand Down
4 changes: 2 additions & 2 deletions solidity/test/integration/IntegrationBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ pragma solidity ^0.8.19;
// solhint-disable-next-line no-console
import {console} from 'forge-std/console.sol';

import {IOracle, Oracle} from '@defi-wonderland/prophet-core/solidity/contracts/Oracle.sol';
import {
CommonAccessController,
IAccessController
} from '@defi-wonderland/prophet-core/solidity/contracts/CommonAccessController.sol';
import {IOracle, Oracle} from '@defi-wonderland/prophet-core/solidity/contracts/Oracle.sol';
} from '@defi-wonderland/prophet-core/solidity/contracts/access/CommonAccessController.sol';
import {IDisputeModule} from '@defi-wonderland/prophet-core/solidity/interfaces/modules/dispute/IDisputeModule.sol';
import {IFinalityModule} from '@defi-wonderland/prophet-core/solidity/interfaces/modules/finality/IFinalityModule.sol';
import {IRequestModule} from '@defi-wonderland/prophet-core/solidity/interfaces/modules/request/IRequestModule.sol';
Expand Down
2 changes: 1 addition & 1 deletion solidity/test/mocks/MockArbitrator.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

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

Check warning on line 4 in solidity/test/mocks/MockArbitrator.sol

View workflow job for this annotation

GitHub Actions / Run Linters (16.x)

imported name IAccessController is not used

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

Expand Down
3 changes: 2 additions & 1 deletion solidity/test/mocks/MockAtomicArbitrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
pragma solidity ^0.8.19;

import {IArbitrator} from '../../interfaces/IArbitrator.sol';
import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/IAccessController.sol';

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

contract MockAtomicArbitrator is IArbitrator {
IOracle.DisputeStatus public answer;
Expand Down
5 changes: 3 additions & 2 deletions solidity/test/unit/modules/dispute/BondEscalationModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import 'forge-std/Test.sol';

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

import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/IAccessController.sol';
import {IModule} from '@defi-wonderland/prophet-core/solidity/interfaces/IModule.sol';
import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/access/IAccessController.sol';

import {IOracle, IOracleAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';
import {IAccessModule} from '@defi-wonderland/prophet-core/solidity/interfaces/modules/access/IAccessModule.sol';
Expand All @@ -21,7 +21,8 @@ import {
import {ModuleTypehash} from '../../../../contracts/utils/ModuleTypehash.sol';
import {IAccountingExtension} from '../../../../interfaces/extensions/IAccountingExtension.sol';
import {IBondEscalationAccounting} from '../../../../interfaces/extensions/IBondEscalationAccounting.sol';
import {IModuleAccessController} from '../../../../interfaces/modules/access/IModuleAccessController.sol';
import {IModuleAccessController} from
'@defi-wonderland/prophet-core/solidity/interfaces/access/IModuleAccessController.sol';

/**
* @dev Harness to set an entry in the requestData mapping, without triggering setup request hooks
Expand Down
3 changes: 2 additions & 1 deletion solidity/test/utils/Helpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
pragma solidity ^0.8.19;

import {TestConstants} from './TestConstants.sol';
import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/IAccessController.sol';

import {IOracle} from '@defi-wonderland/prophet-core/solidity/interfaces/IOracle.sol';
import {IAccessController} from '@defi-wonderland/prophet-core/solidity/interfaces/access/IAccessController.sol';
import {DSTestPlus} from '@defi-wonderland/solidity-utils/solidity/test/DSTestPlus.sol';

contract Helpers is DSTestPlus, TestConstants {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@
dependencies:
"@jridgewell/trace-mapping" "0.3.9"

"@defi-wonderland/[email protected]0e46031c":
version "0.0.0-0e46031c"
resolved "https://registry.yarnpkg.com/@defi-wonderland/prophet-core/-/prophet-core-0.0.0-0e46031c.tgz#0c31c1a8b45dce4789a1605764672aa9470e89ef"
integrity sha512-0y2Bczrhz3G3lto6UhT8JCfsakKnyi4ERgVIDvjjT8ryBjKBSJqw0jbZ79zU1OMUEE3QiUMKmm7p9V1LsLXiXw==
"@defi-wonderland/[email protected]c80cc1e9":
version "0.0.0-c80cc1e9"
resolved "https://registry.yarnpkg.com/@defi-wonderland/prophet-core/-/prophet-core-0.0.0-c80cc1e9.tgz#3586b8bcde26bd670384155f187888745af1e000"
integrity sha512-CU/IRGdOPoHDBiNv3XdimdJqx8Tl/4o3JrkYBKVfx+VW58k9e5i9XquAk+NqDiGZx18TMFZwskkt6fA5cMAQHQ==

"@defi-wonderland/[email protected]":
version "0.0.0-3e9c8e8b"
Expand Down

0 comments on commit 022dfec

Please sign in to comment.