Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move module access controller #56

Merged
merged 4 commits into from
Nov 14, 2024

Conversation

gas1cent
Copy link
Member

🤖 Linear

Closes OPT-530

@gas1cent gas1cent requested a review from xorsal November 14, 2024 08:35
@gas1cent gas1cent self-assigned this Nov 14, 2024
Copy link

linear bot commented Nov 14, 2024

@gas1cent
Copy link
Member Author

Missing tests.

@gas1cent
Copy link
Member Author

Related defi-wonderland/prophet-modules#80

@gas1cent gas1cent marked this pull request as ready for review November 14, 2024 09:11
@@ -10,7 +10,7 @@ import {IRequestModule} from '../interfaces/modules/request/IRequestModule.sol';
import {IResolutionModule} from '../interfaces/modules/resolution/IResolutionModule.sol';
import {IResponseModule} from '../interfaces/modules/response/IResponseModule.sol';
import {ValidatorLib} from '../libraries/ValidatorLib.sol';
import {OracleAccessController} from './OracleAccessController.sol';
import {OracleAccessController} from './access/OracleAccessController.sol';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I didn't like the files thrown in contracts/

if (!ORACLE.isAccessModuleApproved(_accessControl.user, _accessModule)) {
revert ModuleAccessController_AccessModuleNotApproved();
}
_hasAccess(_accessModule, _typehash, _params, _accessControl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#55 will impact here.

Similarly in OracleAccessController.

@gas1cent gas1cent merged commit 88db2d6 into dev Nov 14, 2024
3 checks passed
@gas1cent gas1cent deleted the refactor/OPT-530-move-module-access-controller branch November 14, 2024 14:48
Comment on lines +9 to +10
abstract contract ModuleAccessController is IModuleAccessController, CommonAccessController, Module {
constructor(IOracle _oracle) Module(_oracle) {}
Copy link
Member

@0xJabberwock 0xJabberwock Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does ModuleAccessController inherit from Module, if it is not a module itself? In my opinion, it would make more sense to make the latter inherit from the former, such that:

  • Oracle is OracleAccessController and
  • Module is ModuleAccessController, while
  • MyAccessModule is Module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants