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

AccessManager restricted should not default to admin role #5001

Open
Ramarti opened this issue Apr 8, 2024 · 1 comment
Open

AccessManager restricted should not default to admin role #5001

Ramarti opened this issue Apr 8, 2024 · 1 comment

Comments

@Ramarti
Copy link

Ramarti commented Apr 8, 2024

Right now, when I deploy an AccessManaged contract and use the restricted modifier, it automatically gives the admin role the permission to call it (since getTargetFunctionRole() will return 0, which is the admin role).

I think that can lead to situations where projects can give the admin role too much power without explicitly declaring it through setTargetFunctionRole, by messing up a deploy script for example (with AccessControl, onlyRole was more explicit about which role protects the method).

Why is this the behavior, instead of reverting if not explicitly set?

@ernestognw
Copy link
Member

The intention of the manager is to provide a way to progressively decentralize a protocol, so deploying is like the very first step where things are still in deployer's control. Next steps would be to assign permissions and finally renounce its own admin role.

I agree granting the admin role to the deployer may be dangerous, but it's designed so that configuration of the manager can be done within the same account and finally renounce the ownership.

See this access-manager-demo example.

What would you say would be the best alternative?

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

No branches or pull requests

2 participants