Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sol2uml

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sol2uml - npm Package Compare versions

Comparing version 2.5.15 to 2.5.16

lib/utils/block.d.ts

11

lib/slotValues.js

@@ -12,2 +12,3 @@ "use strict";

const SlotValueCache_1 = require("./SlotValueCache");
const ethers_1 = require("ethers");
const debug = require('debug')('sol2uml');

@@ -215,3 +216,3 @@ /**

: (0, utils_1.hexValue)(bignumber_1.BigNumber.from(blockTag));
// get cached values and missing slot keys from from cache
// get cached values and missing slot keys from the cache
const { cachedValues, missingKeys } = SlotValueCache_1.SlotValueCache.readSlotValues(slotKeys);

@@ -222,2 +223,10 @@ // If all values are in the cache then just return the cached values

}
// Check we are pointing to the correct chain by checking the contract has code
const provider = new ethers_1.ethers.providers.JsonRpcProvider(url);
const code = await provider.getCode(contractAddress, block);
if (!code || code === '0x') {
const msg = `Address ${contractAddress} has no code. Check your "-u, --url" option or "NODE_URL" environment variable is pointing to the correct node.\nurl: ${url}`;
console.error(msg);
throw Error(msg);
}
debug(`About to get ${slotKeys.length} storage values for ${contractAddress} at block ${blockTag} from slot ${missingKeys[0].toString()}`);

@@ -224,0 +233,0 @@ // Get the values for the missing slot keys

9

lib/sol2uml.js

@@ -5,3 +5,2 @@ #! /usr/bin/env node

const commander_1 = require("commander");
const ethers_1 = require("ethers");
const path_1 = require("path");

@@ -20,2 +19,3 @@ const converterClasses2Dot_1 = require("./converterClasses2Dot");

const writerFiles_1 = require("./writerFiles");
const block_1 = require("./utils/block");
const clc = require('cli-color');

@@ -176,8 +176,3 @@ const program = new commander_1.Command();

}
let block = combinedOptions.block;
if (block === 'latest') {
const provider = new ethers_1.ethers.providers.JsonRpcProvider(combinedOptions.url);
block = await provider.getBlockNumber();
debug(`Latest block is ${block}. All storage slot values will be from this block.`);
}
let block = await (0, block_1.getBlock)(combinedOptions);
// Get slot values for each storage section

@@ -184,0 +179,0 @@ for (const storageSection of storageSections) {

{
"name": "sol2uml",
"version": "2.5.15",
"version": "2.5.16",
"description": "Solidity contract visualisation tool.",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc