solidity-docgen
solidity-docgen copied to clipboard
Get the modifier(s)
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 }}
Surely there must be a better way?
{{#each astNode.modifiers }}{{modifierName.name}}{{/each}}
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.)