naddison36 / sol2uml

Solidity contract visualisation tool
MIT License
1.12k stars 257 forks source link

Explicit imports causes RangeError #180

Open minghinmatthewlam opened 7 months ago

minghinmatthewlam commented 7 months ago

Trying to use sol2uml class on my contract where the contract declares multiple explicit imports like so

pragma solidity 0.8.18;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
...

When running the sol2uml class command there is the error

RangeError: Maximum call stack size exceeded
    at /opt/homebrew/lib/node_modules/sol2uml/lib/associations.js:6:38
    at Array.find (<anonymous>)
    at findAssociatedClass (/opt/homebrew/lib/node_modules/sol2uml/lib/associations.js:6:33)
    at findInheritedType (/opt/homebrew/lib/node_modules/sol2uml/lib/associations.js:84:56)
    at findAssociatedClass (/opt/homebrew/lib/node_modules/sol2uml/lib/associations.js:23:27)
    at findInheritedType (/opt/homebrew/lib/node_modules/sol2uml/lib/associations.js:84:56)
    at findAssociatedClass (/opt/homebrew/lib/node_modules/sol2uml/lib/associations.js:23:27)
    at findInheritedType (/opt/homebrew/lib/node_modules/sol2uml/lib/associations.js:84:56)
    at findAssociatedClass (/opt/homebrew/lib/node_modules/sol2uml/lib/associations.js:23:27)
    at findInheritedType (/opt/homebrew/lib/node_modules/sol2uml/lib/associations.js:84:56)

Running with sol2uml version 2.5.20