Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@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.
EXPERIMENTAL
Please see the ethers repository for more informations.
@TODO
MIT License
FAQs
Common Ethereum constants used for ethers.
We found that @ethersproject/constants 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.