Consensys / surya

A set of utilities for exploring Solidity contracts
Apache License 2.0
1.06k stars 118 forks source link

Error that some how some attribute of nodes don't have a color attribute #194

Closed ghost closed 6 months ago

ghost commented 6 months ago

Hi everyone, I don't know how to explain this but some how when I use surya graph on a sol file to get a dot file of a graph, some nodes don't really have a color attribute

Here is a example of it: IERC20.totalSupply {'color': 'blue', 'label': 'totalSupply', 'shape': ''} IERC20.balanceOf {'color': 'blue', 'label': 'balanceOf', 'shape': ''} IERC20.transfer {'color': 'blue', 'label': 'transfer', 'shape': ''} IERC20.allowance {'color': 'blue', 'label': 'allowance', 'shape': ''} IERC20.approve {'color': 'blue', 'label': 'approve', 'shape': ''} IERC20.transferFrom {'color': 'blue', 'label': 'transferFrom', 'shape': ''} Context._msgSender {'color': 'white', 'label': '_msgSender', 'shape': ''} Context._msgData {'color': 'white', 'label': '_msgData', 'shape': ''} Ownable. {'color': 'green', 'label': '', 'shape': ''} Ownable.owner {'label': 'owner', 'shape': ''} Ownable.onlyOwner {'color': 'yellow', 'label': 'onlyOwner', 'shape': ''} Ownable.renounceOwnership {'color': 'green', 'label': 'renounceOwnership', 'shape': ''} Ownable.transferOwnership {'color': 'green', 'label': 'transferOwnership', 'shape': ''} Ownable._setOwner {'label': '_setOwner', 'shape': ''} Ownable._msgSender {'label': '_msgSender', 'shape': ''} Ownable.address {'label': 'address', 'shape': ''}

As you see there are nodes with no color, please if anyone have faced this error before can I have a suggestion of fixing it? It will be really helpful!

ghost commented 6 months ago

Update: I figure out that the code that I use npm install -g surya is different from this repository I yeah I don't really know why, but maybe it have something to do with my error