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

Hint at missing role in revert reason for AccessControl rejection #2601

Closed
frangio opened this issue Mar 19, 2021 · 1 comment · Fixed by #2609
Closed

Hint at missing role in revert reason for AccessControl rejection #2601

frangio opened this issue Mar 19, 2021 · 1 comment · Fixed by #2609

Comments

@frangio
Copy link
Contributor

frangio commented Mar 19, 2021

It would be useful to notify clients of what role is necessary to call a function protected by AccessControl. We can include this information in the revert reason in a standard and machine-parseable format.

Note that we don't have a built in function or modifier to check if an account has a role. Users are currently encouraged to use require(hasRole(MINTER_ROLE, msg.sender)), so we would need to add this new modifier or function in order to standardize the revert reason hint.

@Amxx
Copy link
Collaborator

Amxx commented Mar 21, 2021

+1 for the modifier

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