naddison36 / sol2uml

Solidity contract visualisation tool
MIT License
1.13k stars 268 forks source link

Show used Modifiers for functions #99

Closed popelev closed 2 years ago

popelev commented 2 years ago

for example add option -hum (hide used modifiers. default true)

Public: <<modifier>> onlyOwner() <<onlyOwner>> withdraw() <<onlyOwner>> transferOwnership(newOwner : address)

naddison36 commented 2 years ago

This is possible. I think I'd prefer the modifiers to the right of the function definition so they don't get confused with other stereotypes like event, abstract, fallback and payable. There can also be multiple modifiers so it'd need to be comma separated. And modifiers can have parameters so those would ideally be included. The parameter values would not need to be displayed as those are already shown with the function's parameters.

popelev commented 2 years ago

<<modifier>> modifierOne(someValue : uint256) <<modifier>> modifierTwo(someValue : uint256)

foo(value : uint256) <<modifierOne(value), modifierTwo(value)>> or just show modifiers without parameters
foo(value : uint256) <<modifierOne, modifierTwo>>

naddison36 commented 2 years ago

I've added in Release v2.2.0

I went with just listing the modifiers without the params.

The modifiers will be displayed by default. They can be hidden with the existing -hm, --hideModifiers option