naddison36 / sol2uml

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

Error returned when smart contract includes assembly code #65

Closed najienka closed 2 years ago

najienka commented 2 years ago

When ran against a smart contract that has some assembly code, the following error is returned. But commenting out the assembly code allows the tool to generate an SVG file as expected.

(node:22591) UnhandledPromiseRejectionWarning: VError: Failed to parse solidity file /contracts/ERC20_Asset_Pool.sol.: index parameter must be between >= 0 and <= number of children.
    at parseSolidityFile (/usr/local/lib/node_modules/sol2uml/lib/fileParser.js:93:15)
    at Object.parseUmlClassesFromFiles (/usr/local/lib/node_modules/sol2uml/lib/fileParser.js:18:28)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async sol2uml (/usr/local/lib/node_modules/sol2uml/lib/sol2uml.js:78:22)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:22591) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:22591) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
naddison36 commented 2 years ago

I tried a few contracts with assembly with the latest version and didn't get this error. Is there an example contract I can test against? Has your contract been deployed and verified on Etherscan?

naddison36 commented 2 years ago

Can reopen when there is an example to replicate this problem