Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
evm-bn
Advanced tools
Readme
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 1,666 weekly downloads. As such, evm-bn popularity was classified as 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.