
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@ethersproject/constants
Advanced tools
@ethersproject/constants is a package that provides a collection of common constants used in Ethereum development. These constants include predefined values for addresses, hashes, and other frequently used Ethereum-related data.
Addresses
Provides a constant for the zero address, which is often used as a placeholder or default address in Ethereum applications.
const { AddressZero } = require('@ethersproject/constants');
console.log(AddressZero); // Output: '0x0000000000000000000000000000000000000000'
Hashes
Provides a constant for the zero hash, which is a hash filled with zeros and is often used as a default or placeholder hash.
const { HashZero } = require('@ethersproject/constants');
console.log(HashZero); // Output: '0x0000000000000000000000000000000000000000000000000000000000000000'
Ether Units
Provides a constant for the number of wei per ether, which is useful for converting between ether and wei units.
const { WeiPerEther } = require('@ethersproject/constants');
console.log(WeiPerEther.toString()); // Output: '1000000000000000000'
Negative One
Provides a constant for the value negative one, which can be useful in various calculations and comparisons.
const { NegativeOne } = require('@ethersproject/constants');
console.log(NegativeOne.toString()); // Output: '-1'
web3-utils is a utility library for Ethereum that provides various functions and constants for Ethereum development. It includes similar constants like zero address and zero hash, as well as additional utility functions for encoding, decoding, and converting data.
ethjs-util is a utility library for Ethereum that provides a collection of utility functions and constants. It includes constants like zero address and zero hash, and offers additional utility functions for working with Ethereum data types and values.
ethereumjs-util is a utility library for Ethereum that provides a wide range of utility functions and constants. It includes constants like zero address and zero hash, and offers comprehensive support for various Ethereum-related operations, including cryptographic functions and data conversions.
This sub-module is part of the ethers project.
It contains many frequently used constants when dealing with Ethereum.
For more information, see the documentation.
Most users will prefer to use the umbrella package, but for those with more specific needs, individual components can be imported.
const {
AddressZero,
HashZero,
EtherSymbol,
NegativeOne,
Zero,
One,
Two,
WeiPerEther,
MaxUint256
} = require("@ethersproject/constants");
MIT License
FAQs
Common Ethereum constants used for ethers.
The npm package @ethersproject/constants receives a total of 961,907 weekly downloads. As such, @ethersproject/constants popularity was classified as popular.
We found that @ethersproject/constants demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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 uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.