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

hardhat-contract-sizer

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hardhat-contract-sizer - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

index.d.ts

27

index.js
const fs = require('fs');
const path = require('path');
const { extendConfig } = require('hardhat/config');
const colors = require('colors/safe');

@@ -10,8 +11,14 @@ const Table = require('cli-table3');

const CONFIG = {
alphaSort: false,
runOnCompile: false,
disambiguatePaths: false,
};
extendConfig(function (config, userConfig) {
config.contractSizer = Object.assign(
{
alphaSort: false,
runOnCompile: false,
disambiguatePaths: false,
},
userConfig.contractSizer
);
});
const NAME = 'size-contracts';

@@ -23,4 +30,2 @@ const DESC = 'Output the size of compiled contracts';

task(NAME, DESC, async function (args, hre) {
let config = Object.assign({}, CONFIG, hre.config.contractSizer);
let files = await hre.artifacts.getArtifactPaths();

@@ -31,3 +36,3 @@

if (!config.disambiguatePaths) {
if (!hre.config.contractSizer.disambiguatePaths) {
name = path.basename(name).replace('.json', '');

@@ -42,3 +47,3 @@ }

if (config.alphaSort) {
if (hre.config.contractSizer.alphaSort) {
contracts.sort((a, b) => a.name.toUpperCase() > b.name.toUpperCase() ? 1 : -1);

@@ -98,9 +103,7 @@ } else {

task(TASK_COMPILE, async function (args, hre, runSuper) {
let config = Object.assign({}, CONFIG, hre.config.contractSizer);
await runSuper();
if (config.runOnCompile) {
if (hre.config.contractSizer.runOnCompile) {
await hre.run(NAME);
}
});
{
"name": "hardhat-contract-sizer",
"version": "2.0.0",
"version": "2.0.1",
"license": "MIT",

@@ -21,2 +21,3 @@ "description": "Output Solidity contract sizes with Hardhat",

"main": "index.js",
"types": "index.d.ts",
"peerDependencies": {

@@ -23,0 +24,0 @@ "hardhat": "^2.0.0"

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