
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
hardhat-prb-math
Advanced tools
Hardhat plugin to complement the PRBMath smart contract library for advanced fixed-point math.
This plugin is complementary to the PRBMath smart contract library for advanced fixed-point math. It provides mirroring TypeScript implementations for the mathematical functions originally written in Solidity.
First, install the plugin and its peer dependencies:
yarn add --dev hardhat-prb-math @ethersproject/bignumber evm-bn mathjs
Second, import the plugin in your hardhat.config.js:
require("hardhat-prb-math");
Or if you are using TypeScript, in your hardhat.config.ts:
import "hardhat-prb-math";
This plugin adds no additional tasks.
This plugin extends the Hardhat Runtime Environment by adding a prb.math field whose type is HardhatPRBMath.
This plugin does not extend the HardhatUserConfig object.
There are no additional steps you need to take for this plugin to work.
Install it and access prb.math through the Hardhat Runtime Environment anywhere you need it (tasks, scripts, tests,
etc). For example, in your hardhat.config.ts:
import type { BigNumber } from "@ethersproject/bignumber";
import { fromBn, toBn } from "evm-bn";
import { task } from "hardhat/config";
import { TaskArguments } from "hardhat/types";
task("log2", "Calculate the binary logarithm")
.addParam("x", "Input")
.setAction(async function (taskArgs: TaskArguments, { prb }): Promise<void> {
const x: BigNumber = toBn(taskArgs.x);
const result: BigNumber = prb.math.log2(x);
console.log({ result: fromBn(result) });
});
export default {};
Unlicense © Paul Razvan Berg
FAQs
Hardhat plugin to complement PRBMath
We found that hardhat-prb-math 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.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.