From 817e54316b2d1820b2571d18a23a644303fd267b Mon Sep 17 00:00:00 2001 From: Victor ADASCALITEI <210908+3Nigma@users.noreply.github.com> Date: Tue, 22 Nov 2022 15:29:11 +0200 Subject: [PATCH] Fixed npm vulnerabilities and renamed public library references to venin (and derivatives). --- .vscode/settings.json | 2 +- README.md | 24 ++++++++++++------------ jest.common.config.cjs | 2 +- lib/ContractRegistry.ts | 2 +- lib/HederaNetwork.ts | 2 +- lib/compiler/SolidityCompiler.ts | 8 ++++---- package-lock.json | 28 ++++++++++++++-------------- package.json | 4 ++-- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 758988b..413b331 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,7 @@ "cSpell.customDictionaries": { "custom-dictionary-workspace": { "name": "custom-dictionary-workspace", - "path": "${workspaceFolder:hedera-strato-js}/.cspell/custom-dictionary-workspace.txt", + "path": "${workspaceFolder:hedera-venin-js}/.cspell/custom-dictionary-workspace.txt", "addWords": true, "scope": "workspace" } diff --git a/README.md b/README.md index a27badc..e6aeeb1 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ -# Hedera Strato JS +# Hedera Venin JS -![NodeJS/JsDOM/Browser tests](https://img.shields.io/github/workflow/status/buidler-labs/hedera-strato-js/test-nodejs-jsdom-browser?style=flat-square&label=tests&color=yellowgreen) -[![codecov](https://img.shields.io/codecov/c/github/buidler-labs/hedera-strato-js?style=flat-square)](https://codecov.io/gh/buidler-labs/hedera-strato-js) +![NodeJS/JsDOM/Browser tests](https://img.shields.io/github/workflow/status/buidler-labs/hedera-venin-js/test-nodejs-jsdom-browser?style=flat-square&label=tests&color=yellowgreen) +[![codecov](https://img.shields.io/codecov/c/github/buidler-labs/hedera-venin-js?style=flat-square)](https://codecov.io/gh/buidler-labs/hedera-venin-js) [![Discord support channel](https://img.shields.io/discord/949250301792239686?style=flat-square)](https://discord.com/invite/4mYCre869F) ![contributions](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square) -![license](https://img.shields.io/github/license/buidler-labs/hedera-strato-js.svg?colorB=ff0000&style=flat-square) +![license](https://img.shields.io/github/license/buidler-labs/hedera-venin-js.svg?colorB=ff0000&style=flat-square) ![node version](https://img.shields.io/badge/Node.js-%3E%3D14.8.0-orange.svg?style=flat-square) -![npm version](https://img.shields.io/npm/v/@buidlerlabs/hedera-strato-js.svg?style=flat-square) +![npm version](https://img.shields.io/npm/v/@buidlerlabs/hedera-venin-js.svg?style=flat-square) -[![NPM](https://nodei.co/npm/@buidlerlabs/hedera-strato-js.png?mini=true)](https://nodei.co/npm/@buidlerlabs/hedera-strato-js/) +[![NPM](https://nodei.co/npm/@buidlerlabs/hedera-venin-js.png?mini=true)](https://nodei.co/npm/@buidlerlabs/hedera-venin-js/) Write Web3 [Hedera](https://hedera.com/) smart-contract dApps frictionless and with ease, without having to deal with the hustle and bustle of [Hedera's verbose, underlying services](https://docs.hedera.com/guides/docs/sdks). @@ -22,14 +22,14 @@ Write Web3 [Hedera](https://hedera.com/) smart-contract dApps frictionless and w ## Features -Strato already is packed with a lot of stuff: +Venin already is packed with a lot of stuff: ✔️ Compile a Solidity contract to obtain its Hedera accepted ABI directly from within the library (no external compiler required) ✔️ Deploy a contract to the network ✔️ Use a fluent API to interact with deployed, _live entities_ such as contracts ✔️ Pubsub for contract emitted events ✔️ Pubsub for transaction receipts ✔️ Fine grained cost-control -✔️ Browser bundle-able via a custom made Rollup plugin ([webpack pending](https://github.com/buidler-labs/hedera-strato-js/issues/26)) +✔️ Browser bundle-able via a custom made Rollup plugin ([webpack pending](https://github.com/buidler-labs/hedera-venin-js/issues/26)) ✔️ Using Hedera File Storage as a place to store generic files and JSONs ✔️ Create token via the Hedera Token Service (HTS) ✔️ Create a Hedera account @@ -48,7 +48,7 @@ Strato already is packed with a lot of stuff: ## The drive -As any good-striving, long-lasting, endeavour, we are using Strato to hopefully fuel everything that we, here at BuiDler Labs, build on Hedera. Our Hedera portfolio currently consists of: +As any good-striving, long-lasting, endeavour, we are using Venin to hopefully fuel everything that we, here at BuiDler Labs, build on Hedera. Our Hedera portfolio currently consists of: - [FileCoin-Hedera Grant](https://github.com/taskbar-team/hedera-filecoin-devgrant) - a development grant used to put the foundations of [MyTaskbar](https://mytaskbar.io/) v2, the more decentralized version - [HeadStarter](headstarter.org) - the first Hedera IDO platform @@ -82,7 +82,7 @@ HEDERAS_OPERATOR_KEY=... pragma solidity ^0.8.3; contract HelloWorld { - string public greet = "Hello Hedera Strato!"; + string public greet = "Hello Hedera Venin!"; } ``` @@ -98,7 +98,7 @@ const liveContract = await session.upload(helloWorldContract); console.log(await liveContract.greet()); ``` -If all goes well, you should see the expected `Hello Hedera Strato!` logged inside your console signifying that the contract was successfully compiled, uploaded and executed. +If all goes well, you should see the expected `Hello Hedera Venin!` logged inside your console signifying that the contract was successfully compiled, uploaded and executed. Also, if you want a quick play-through a similar example, please have a look at [our minimum-working code](https://github.com/buidler-labs/hsj-example) repo. @@ -114,7 +114,7 @@ $ npm test ## Contributions -Do you think we missed anything? Want some feature badly? Do you have an idea of something that we might improve? Head over to [our issues page](https://github.com/buidler-labs/hedera-strato-js/issues) and let us know! We want Strato to be a community-lead initiative. This means that any opinion or critic is encouraged (and even welcomed)! +Do you think we missed anything? Want some feature badly? Do you have an idea of something that we might improve? Head over to [our issues page](https://github.com/buidler-labs/hedera-venin-js/issues) and let us know! We want Venin to be a community-lead initiative. This means that any opinion or critic is encouraged (and even welcomed)! Of course, if you're eager to write it yourself, that's also fine and dandy! Just fork us, add your changes and open a pull request. We'll take it from there ... diff --git a/jest.common.config.cjs b/jest.common.config.cjs index 3755eff..47f9d1a 100644 --- a/jest.common.config.cjs +++ b/jest.common.config.cjs @@ -3,7 +3,7 @@ module.exports = { collectCoverage: true, coveragePathIgnorePatterns: ["test/*", "lib.cjs/*", "lib.esm/*"], - displayName: "hedera-strato", + displayName: "hedera-venin", moduleFileExtensions: ["js", "ts"], preset: "ts-jest", setupFiles: ["dotenv/config"], diff --git a/lib/ContractRegistry.ts b/lib/ContractRegistry.ts index f3582ed..20419f5 100644 --- a/lib/ContractRegistry.ts +++ b/lib/ContractRegistry.ts @@ -28,7 +28,7 @@ export class ContractRegistry { ) { // No-op console.error( - "ContractRegistry could not load a Contract due to library linking not currently being supported. This will be supported once https://github.com/buidler-labs/hedera-strato-js/issues/38 is resolved." + "ContractRegistry could not load a Contract due to library linking not currently being supported. This will be supported once https://github.com/buidler-labs/hedera-venin-js/issues/38 is resolved." ); } else { // no mercy diff --git a/lib/HederaNetwork.ts b/lib/HederaNetwork.ts index cd1c4c1..f7ca1df 100644 --- a/lib/HederaNetwork.ts +++ b/lib/HederaNetwork.ts @@ -41,7 +41,7 @@ export type NetworkDefaults = { }; /** - * The main entry-class for the Hedera Strato library. + * The main entry-class for the Hedera Venin library. * * It starts out by referencing a Hedera Network (being it [official](https://docs.hedera.com/guides/mirrornet/hedera-mirror-node#mainnet) or {@link HEDERA_CUSTOM_NET_NAME | custom}) * client before allowing to generate an {@link ApiSession} through the {@link HederaNetwork.login} method call. diff --git a/lib/compiler/SolidityCompiler.ts b/lib/compiler/SolidityCompiler.ts index aa79d65..9d5f0bd 100644 --- a/lib/compiler/SolidityCompiler.ts +++ b/lib/compiler/SolidityCompiler.ts @@ -1,9 +1,9 @@ // Wrapper around the Solidity solc-js compiler meant for Node runtime consumption // Browser variants do not use this and instead polyfill it -// Please see the rollup-strato plugin implementation for more info. +// Please see the rollup-venin plugin implementation for more info. // // NOTE: We have to keep this module as light as possible (least dependencies as possible) so that -// we can polyfill this easily (eg. strato-rollup-plugin). +// we can polyfill this easily (eg. venin-rollup-plugin). // This means no @hashgraph/sdk here. import * as fs from "fs"; import * as sdkPath from "path"; @@ -25,7 +25,7 @@ export interface CompilationResult { export const VIRTUAL_SOURCE_CONTRACT_FILE_NAME = "__contract__.sol"; -// Fix for https://github.com/buidler-labs/hedera-strato-js/issues/81 +// Fix for https://github.com/buidler-labs/hedera-venin-js/issues/81 // as initially reported by https://github.com/ethereum/solidity/issues/12228 const listeners = process.listeners("unhandledRejection"); if (undefined !== listeners[listeners.length - 1]) { @@ -124,7 +124,7 @@ export class SolidityCompiler { /** * Given the path of a solidity file, reads and returns its source code following any necessary preprocessing. * - * Note: This provides fix for #114 (https://github.com/buidler-labs/hedera-strato-js/issues/114) + * Note: This provides fix for #114 (https://github.com/buidler-labs/hedera-venin-js/issues/114) * We need to replace all relative imports (. and .. alike) otherwise the VFS could load the same identifier into multiple references which would end up * erroring out with "Identifier already declared." error messages. * diff --git a/package-lock.json b/package-lock.json index 270e500..84a7d73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@buidlerlabs/hedera-strato-js", + "name": "@buidlerlabs/hedera-venin-js", "version": "0.8.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "@buidlerlabs/hedera-strato-js", + "name": "@buidlerlabs/hedera-venin-js", "version": "0.8.0", "license": "MIT", "dependencies": { @@ -4792,9 +4792,9 @@ } }, "node_modules/@openzeppelin/contracts": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.6.0.tgz", - "integrity": "sha512-8vi4d50NNya/bQqCmaVzvHNmwHvS0OBKb7HNtuNwEE3scXWrP31fKQoGxNMT+KbzmrNZzatE3QK5p2gFONI/hg==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.8.0.tgz", + "integrity": "sha512-AGuwhRRL+NaKx73WKRNzeCxOCOCxpaqF+kp8TJ89QzAipSwZy/NoflkWaL9bywXFRhIzXt8j38sfF7KBKCPWLw==", "dev": true }, "node_modules/@peculiar/asn1-schema": { @@ -5304,9 +5304,9 @@ } }, "node_modules/@xmldom/xmldom": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.5.tgz", - "integrity": "sha512-V3BIhmY36fXZ1OtVcI9W+FxQqxVLsPKcNjWigIaa81dLC9IolJl5Mt4Cvhmr0flUnjSpTdrbMTSbXqYqV5dT6A==", + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.9.tgz", + "integrity": "sha512-yceMpm/xd4W2a85iqZyO09gTnHvXF6pyiWjD2jcOJs7hRoZtNNOO1eJlhHj1ixA+xip2hOyGn+LgcvLCMo5zXA==", "peer": true, "engines": { "node": ">=10.0.0" @@ -18632,9 +18632,9 @@ } }, "@openzeppelin/contracts": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.6.0.tgz", - "integrity": "sha512-8vi4d50NNya/bQqCmaVzvHNmwHvS0OBKb7HNtuNwEE3scXWrP31fKQoGxNMT+KbzmrNZzatE3QK5p2gFONI/hg==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.8.0.tgz", + "integrity": "sha512-AGuwhRRL+NaKx73WKRNzeCxOCOCxpaqF+kp8TJ89QzAipSwZy/NoflkWaL9bywXFRhIzXt8j38sfF7KBKCPWLw==", "dev": true }, "@peculiar/asn1-schema": { @@ -19032,9 +19032,9 @@ } }, "@xmldom/xmldom": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.5.tgz", - "integrity": "sha512-V3BIhmY36fXZ1OtVcI9W+FxQqxVLsPKcNjWigIaa81dLC9IolJl5Mt4Cvhmr0flUnjSpTdrbMTSbXqYqV5dT6A==", + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.9.tgz", + "integrity": "sha512-yceMpm/xd4W2a85iqZyO09gTnHvXF6pyiWjD2jcOJs7hRoZtNNOO1eJlhHj1ixA+xip2hOyGn+LgcvLCMo5zXA==", "peer": true }, "abab": { diff --git a/package.json b/package.json index ee0e7f7..8b56d21 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ ], "main": "./lib.cjs/index.cjs", "module": "./lib.esm/index.mjs", - "name": "@buidlerlabs/hedera-strato-js", + "name": "@buidlerlabs/hedera-venin-js", "scripts": { "build:4-publish": "run-p build:cjs build:esm build:declarations", "build:cjs": "babel --env-name cjs lib --extensions .ts --out-dir lib.cjs --out-file-extension .cjs", @@ -81,7 +81,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/buidler-labs/hedera-strato-js" + "url": "https://github.com/buidler-labs/hedera-venin-js" }, "types": "./types/index.d.ts", "version": "0.8.0",