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

Exposed event parameters indexed property

Open tzapu opened this issue 4 years ago • 3 comments

hi

is there a way to tell in the template if an event's parameter was indexed or not?

thanks you

tzapu avatar Jun 29 '21 13:06 tzapu

Not directly, but you can do it by accessing the AST node of the event definition. Something like this should work:

{{#each ownEvents}}
{{#each astNode.parameters.parameters}}
{{#if indexed}}
indexed
{{/if}}
{{/each}}
{{/each}}

See here for reference on the AST node for each parameter, including the indexed property.

frangio avatar Jun 29 '21 20:06 frangio

thank you very much @frangio i was able to read it like this {{#with (lookup ../astNode.parameters.parameters @index)}}{{#if indexed}}:white_check_mark:{{/if}}{{/with}}

not sure if you want this issue closed or left to expose it later on

tzapu avatar Jun 29 '21 23:06 tzapu

Let's leave it open, it would be nice to expose this somehow.

frangio avatar Jul 01 '21 13:07 frangio