Closed gpersoon closed 2 years ago
Can you run sol2uml -V
to double-check the new version is being picked up?
This is what is looks like for me
sol2uml -V
2.1.7
sol2uml flatten 0x2762e676a9f17c7de34fe4b124424837c7e18e1c -v
sol2uml verbose on +0ms
sol2uml About to flatten 0x2762e676a9f17c7de34fe4b124424837c7e18e1c +0ms
sol2uml About to get Solidity source code for 0x2762e676a9f17c7de34fe4b124424837c7e18e1c from https://api.etherscan.io/api +0ms
sol2uml codeFolder koios childNode.path @openzeppelin/contracts/access/Ownable.sol +0ms
sol2uml Added Etherscan import @openzeppelin/contracts/access/Ownable.sol with class names: +0ms
sol2uml codeFolder koios childNode.path @openzeppelin/contracts/utils/Strings.sol +0ms
sol2uml Added Etherscan import @openzeppelin/contracts/utils/Strings.sol with class names: +0ms
sol2uml codeFolder koios childNode.path @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol +0ms
sol2uml Added Etherscan import @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol with class names: +0ms
sol2uml codeFolder koios childNode.path @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol +0ms
sol2uml Added Etherscan import @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol with class names: +0ms
sol2uml codeFolder koios childNode.path @openzeppelin/contracts/utils/cryptography/ECDSA.sol +0ms
sol2uml Added Etherscan import @openzeppelin/contracts/utils/cryptography/ECDSA.sol with class names: +0ms
sol2uml codeFolder koios childNode.path ./SignedTokenVerifier.sol +0ms
sol2uml Added Etherscan import koios/SignedTokenVerifier.sol with class names: +0ms
sol2uml Added contract KoiosECDSA +1ms
sol2uml codeFolder koios childNode.path @openzeppelin/contracts/utils/cryptography/ECDSA.sol +17ms
sol2uml Added Etherscan import @openzeppelin/contracts/utils/cryptography/ECDSA.sol with class names: +1ms
sol2uml Added contract SignedTokenVerifier +0ms
sol2uml codeFolder @openzeppelin/contracts/utils/cryptography childNode.path ../Strings.sol +46ms
sol2uml Added Etherscan import @openzeppelin/contracts/utils/Strings.sol with class names: +0ms
sol2uml Added contract ECDSA +0ms
sol2uml codeFolder @openzeppelin/contracts/token/ERC721/extensions childNode.path ../IERC721.sol +1ms
sol2uml Added Etherscan import @openzeppelin/contracts/token/ERC721/IERC721.sol with class names: +0ms
sol2uml Added contract IERC721Enumerable +0ms
sol2uml codeFolder @openzeppelin/contracts/token/ERC721/extensions childNode.path ../ERC721.sol +30ms
sol2uml Added Etherscan import @openzeppelin/contracts/token/ERC721/ERC721.sol with class names: +0ms
sol2uml codeFolder @openzeppelin/contracts/token/ERC721/extensions childNode.path ./IERC721Enumerable.sol +0ms
sol2uml Added Etherscan import @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol with class names: +0ms
sol2uml Added contract ERC721Enumerable +0ms
sol2uml Added contract Strings +15ms
sol2uml codeFolder @openzeppelin/contracts/access childNode.path ../utils/Context.sol +6ms
sol2uml Added Etherscan import @openzeppelin/contracts/utils/Context.sol with class names: +0ms
sol2uml Added contract Ownable +0ms
sol2uml codeFolder @openzeppelin/contracts/token/ERC721 childNode.path ../../utils/introspection/IERC165.sol +1ms
sol2uml Added Etherscan import @openzeppelin/contracts/utils/introspection/IERC165.sol with class names: +0ms
sol2uml Added contract IERC721 +0ms
sol2uml codeFolder @openzeppelin/contracts/token/ERC721 childNode.path ./IERC721.sol +46ms
sol2uml Added Etherscan import @openzeppelin/contracts/token/ERC721/IERC721.sol with class names: +0ms
sol2uml codeFolder @openzeppelin/contracts/token/ERC721 childNode.path ./IERC721Receiver.sol +0ms
sol2uml Added Etherscan import @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol with class names: +0ms
sol2uml codeFolder @openzeppelin/contracts/token/ERC721 childNode.path ./extensions/IERC721Metadata.sol +0ms
sol2uml Added Etherscan import @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol with class names: +0ms
sol2uml codeFolder @openzeppelin/contracts/token/ERC721 childNode.path ../../utils/Address.sol +0ms
sol2uml Added Etherscan import @openzeppelin/contracts/utils/Address.sol with class names: +0ms
sol2uml codeFolder @openzeppelin/contracts/token/ERC721 childNode.path ../../utils/Context.sol +0ms
sol2uml Added Etherscan import @openzeppelin/contracts/utils/Context.sol with class names: +0ms
sol2uml codeFolder @openzeppelin/contracts/token/ERC721 childNode.path ../../utils/Strings.sol +0ms
sol2uml Added Etherscan import @openzeppelin/contracts/utils/Strings.sol with class names: +0ms
sol2uml codeFolder @openzeppelin/contracts/token/ERC721 childNode.path ../../utils/introspection/ERC165.sol +0ms
sol2uml Added Etherscan import @openzeppelin/contracts/utils/introspection/ERC165.sol with class names: +0ms
sol2uml Added contract ERC721 +0ms
sol2uml Added contract Context +1ms
sol2uml Added contract IERC165 +0ms
sol2uml codeFolder @openzeppelin/contracts/utils/introspection childNode.path ./IERC165.sol +1ms
sol2uml Added Etherscan import @openzeppelin/contracts/utils/introspection/IERC165.sol with class names: +0ms
sol2uml Added contract ERC165 +0ms
sol2uml Added contract Address +11ms
sol2uml codeFolder @openzeppelin/contracts/token/ERC721/extensions childNode.path ../IERC721.sol +1ms
sol2uml Added Etherscan import @openzeppelin/contracts/token/ERC721/IERC721.sol with class names: +0ms
sol2uml Added contract IERC721Metadata +0ms
sol2uml Added contract IERC721Receiver +0ms
sol2uml About to write Solidity to file KoiosECDSA.sol +0ms
The flatten works fine for me too, however sol2uml storage KoiosECDSA.sol -v
doesn't.
It is using the 2.1.7 version
sol2uml -V
2.1.7
I see, you are flattening the source locally and then running storage against the local file. You'll need to use the -c, --contract <name>
option to tell sol2uml which contract you want to generate the storage diagram for in the source file.
sol2uml storage -c KoiosECDSA ./KoiosECDSA.sol -v
Note you can generate the storage diagram directly from the source files on Etherscan with the following. It will use Etherscan's contract name so you don't need to explicitly specify which contract to draw the storage diagram for.
sol2uml storage 0x2762e676a9f17c7de34fe4b124424837c7e18e1c -v
And for some extra fun, you can get the data in the storage slots with the -d, --data
option
export NODE_URL=<your API provider's url>
sol2uml storage -d 0x2762e676a9f17c7de34fe4b124424837c7e18e1c -v
You can also use the -u, --url <url>
option to specify your node provider's url.
On the TODO list is to decode the slot data so you can see the number and string values.
Thanks, with the -c
parameter it indeed works!
Might be helpful to give an error message indicating the -c
parameter is missing.
Good idea. I'll do that.
I've published v2.1.8 with better handling of the storage diagram's -c
option
Thanks, works nicely now!
On both Linux (ubuntu 20.04.4 wsl on windows) and Windows 11, I still get this error message with version 2.1.7 of sol2uml: