
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Convert fixed-point numbers to ethers big numbers and vice-versa. This is useful for EVM-related projects, since 1 ETH is 1e18 wei.
n + 1
and above, with n
the number of decimals, rounding down in the process.With yarn:
$ yarn add evm-bn
Or npm:
$ npm install evm-bn
import type { BigNumber } from "@ethersproject/bignumber";
import { toBn } from "evm-bn";
// 3141500000000000000
const foo: BigNumber = toBn("3.1415");
// 115792089237316195423570985008687907853269984665640564039457584007913129639935
const bar: BigNumber = toBn("115792089237316195423570985008687907853269984665640564039457.584007913129639935");
// 100000000000000
const baz: BigNumber = toBn("100e6", 6);
import type { BigNumber } from "@ethersproject/bignumber";
import { fromBn } from "evm-bn";
// 3.1415
const foo: BigNumber = fromBn(BigNumber.from("3141500000000000000"));
// 115792089237316195423570985008687907853269984665640564039457.584007913129639935
const bar: BigNumber = fromBn(
BigNumber.from("115792089237316195423570985008687907853269984665640564039457584007913129639935"),
);
// 100000000
const baz: BigNumber = fromBn(BigNumber.from("100000000000000"), 6);
Feel free to dive in! Open an issue, start a discussion or submit a PR.
Clone the repositories and install the dependencies:
$ yarn install
Now you can start making changes.
MIT © Paul Razvan Berg
FAQs
Convert fixed-point numbers to ethers big numbers and vice-versa
The npm package evm-bn receives a total of 986 weekly downloads. As such, evm-bn popularity was classified as not popular.
We found that evm-bn demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.