solidity-docgen icon indicating copy to clipboard operation
solidity-docgen copied to clipboard

Get the modifier(s)

Open dimsome opened this issue 3 years ago • 2 comments

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 avatar Aug 24 '21 13:08 dimsome

Surely there must be a better way?

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

dimsome avatar Aug 24 '21 17:08 dimsome

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.)

frangio avatar Sep 15 '21 22:09 frangio