sol2uml 2.0.0 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -53,7 +53,7 @@ Options:
53
53
  -f, --outputFormat <value> output file format. (choices: "svg", "png", "dot", "all", default: "svg")
54
54
  -o, --outputFileName <value> output file name
55
55
  -i, --ignoreFilesOrFolders <filesOrFolders> comma separated list of files or folders to ignore
56
- -n, --network <network> Ethereum network (choices: "mainnet", "polygon", "bsc", "arbitrum", "ropsten", "kovan", "rinkeby", "goerli", default: "mainnet")
56
+ -n, --network <network> Ethereum network (choices: "mainnet", "polygon", "bsc", "arbitrum", "ropsten", "kovan", "rinkeby", "goerli", "sepolia", default: "mainnet")
57
57
  -k, --apiKey <key> Etherscan, Polygonscan or BscScan API key
58
58
  -v, --verbose run with debugging statements (default: false)
59
59
  -h, --help display help for command
@@ -195,7 +195,7 @@ A Solidity variable becomes an attribute in UML and a Solidity function becomes
195
195
 
196
196
  * event
197
197
  * modifier
198
- * abstract - is there is no function body on a contract, the operator is marked as abstract. Operators on an Interface do not have an abstract stereotype as all operators are abstract.
198
+ * abstract - if there is no function body on a contract, the operator is marked as abstract. Operators on an Interface do not have an abstract stereotype as all operators are abstract.
199
199
  * fallback - abstract fallback functions will just have an abstract stereotype.
200
200
  * payable - payable fallback functions will just have a fallback stereotype.
201
201
 
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isElementary = exports.calcStorageByteSize = exports.parseStructStorageObject = exports.convertClasses2StorageObjects = exports.StorageType = void 0;
4
4
  const umlClass_1 = require("./umlClass");
5
+ const associations_1 = require("./associations");
5
6
  var StorageType;
6
7
  (function (StorageType) {
7
8
  StorageType[StorageType["Contract"] = 0] = "Contract";
@@ -45,9 +46,9 @@ const parseStorage = (umlClass, umlClasses, storages, storageObjects, inheritedC
45
46
  inheritedContracts.push(...newInheritedContracts.map((c) => c.targetUmlClassName));
46
47
  // Recursively parse each new inherited contract
47
48
  newInheritedContracts.forEach((parent) => {
48
- const parentClass = umlClasses.find((umlClass) => umlClass.name === parent.targetUmlClassName);
49
+ const parentClass = (0, associations_1.findAssociatedClass)(parent, umlClass, umlClasses);
49
50
  if (!parentClass)
50
- throw Error(`Failed to find parent contract ${parent.targetUmlClassName} of ${umlClass.name}`);
51
+ throw Error(`Failed to find parent contract ${parent.targetUmlClassName} of ${umlClass.absolutePath}`);
51
52
  // recursively parse inherited contract
52
53
  parseStorage(parentClass, umlClasses, storages, storageObjects, inheritedContracts);
53
54
  });
@@ -1,6 +1,6 @@
1
1
  import { ASTNode } from '@solidity-parser/parser/dist/src/ast-types';
2
2
  import { UmlClass } from './umlClass';
3
- declare const networks: readonly ["mainnet", "ropsten", "kovan", "rinkeby", "goerli", "polygon", "bsc", "arbitrum"];
3
+ declare const networks: readonly ["mainnet", "ropsten", "kovan", "rinkeby", "goerli", "sepolia", "polygon", "bsc", "arbitrum"];
4
4
  declare type Network = typeof networks[number];
5
5
  export declare class EtherscanParser {
6
6
  protected apikey: string;
@@ -13,6 +13,7 @@ const networks = [
13
13
  'kovan',
14
14
  'rinkeby',
15
15
  'goerli',
16
+ 'sepolia',
16
17
  'polygon',
17
18
  'bsc',
18
19
  'arbitrum',
package/lib/sol2uml.js CHANGED
@@ -37,6 +37,7 @@ The Solidity code can be pulled from verified source code on Blockchain explorer
37
37
  'kovan',
38
38
  'rinkeby',
39
39
  'goerli',
40
+ 'sepolia',
40
41
  ])
41
42
  .default('mainnet'))
42
43
  .option('-k, --apiKey <key>', 'Etherscan, Polygonscan, BscScan or Arbiscan API key')
@@ -101,8 +102,7 @@ program
101
102
  ...options,
102
103
  };
103
104
  const { umlClasses, contractName } = await (0, parserGeneral_1.parserUmlClasses)(fileFolderAddress, combinedOptions);
104
- const filteredUmlClasses = (0, filterClasses_1.classesConnectedToBaseContracts)(umlClasses, [combinedOptions.contractName || contractName]);
105
- const storageObjects = (0, converterClasses2Storage_1.convertClasses2StorageObjects)(combinedOptions.contractName || contractName, filteredUmlClasses);
105
+ const storageObjects = (0, converterClasses2Storage_1.convertClasses2StorageObjects)(combinedOptions.contractName || contractName, umlClasses);
106
106
  if ((0, regEx_1.isAddress)(fileFolderAddress)) {
107
107
  // The first object is the contract
108
108
  storageObjects[0].address = fileFolderAddress;
@@ -0,0 +1 @@
1
+ export declare const isAddress: (input: string) => boolean;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isAddress = void 0;
4
+ const isAddress = (input) => {
5
+ return input.match(/^0x([A-Fa-f0-9]{40})$/) !== null;
6
+ };
7
+ exports.isAddress = isAddress;
8
+ //# sourceMappingURL=regEx.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sol2uml",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
4
4
  "description": "Unified Modeling Language (UML) class diagram generator for Solidity contracts",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -41,6 +41,8 @@
41
41
  "files": [
42
42
  "lib/*.js",
43
43
  "lib/*.d.ts",
44
+ "lib/utils/*.js",
45
+ "lib/utils/*.d.ts",
44
46
  "sol2uml"
45
47
  ],
46
48
  "bin": {