
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
@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 0 weekly downloads. As such, @ethersproject/constants popularity was classified as not 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 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
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.

Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.

Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.