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

Get the modifier(s) #319

Open
dimsome opened this issue Aug 24, 2021 · 2 comments
Open

Get the modifier(s) #319

dimsome opened this issue Aug 24, 2021 · 2 comments

Comments

@dimsome
Copy link

dimsome commented Aug 24, 2021

Not sure, how can I get the modifiers in the template? Ideally, I would like to specify in the docs which modifiers are used or filter out the functions that should only be available to the public.

something along with this:

{{ modifier }}

@dimsome
Copy link
Author

dimsome commented Aug 24, 2021

Surely there must be a better way?

{{#each astNode.modifiers }}{{modifierName.name}}{{/each}}

@frangio
Copy link
Contributor

frangio commented Sep 15, 2021

Hi @dimsome. Modifiers are not exposed currently. By "available to the public" do you mean you want to remove stuff that is onlyOwner or similar? That is interesting... In the meantime you could use an @custom:only-owner attribute and read it from the template using {{natspec.custom.only-owner}}. (Note: I'm actually not sure the dash works, if it doesn't an underscore should work.)

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