Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nomicfoundation/ethereumjs-common

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nomicfoundation/ethereumjs-common

Resources common to all Ethereum implementations

  • 3.0.0-rc.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is @nomicfoundation/ethereumjs-common?

@nomicfoundation/ethereumjs-common is a library that provides common Ethereum constants, parameters, and functions for various Ethereum networks. It is useful for developers working on Ethereum-based projects who need to handle different network configurations and parameters.

What are @nomicfoundation/ethereumjs-common's main functionalities?

Network Configuration

This feature allows you to create a custom network configuration. The code sample demonstrates how to create a custom network configuration for a network with a specific networkId and chainId.

const Common = require('@nomicfoundation/ethereumjs-common').default;
const mainnetCommon = Common.forCustomChain('mainnet', {
  name: 'custom-network',
  networkId: 1234,
  chainId: 1234,
}, 'istanbul');
console.log(mainnetCommon.chainName());

Hardfork Support

This feature allows you to specify and work with different Ethereum hardforks. The code sample shows how to create a Common instance for the mainnet with the Berlin hardfork.

const Common = require('@nomicfoundation/ethereumjs-common').default;
const common = new Common({ chain: 'mainnet', hardfork: 'berlin' });
console.log(common.hardfork());

Chain Parameters

This feature provides access to various chain parameters such as genesis block information. The code sample demonstrates how to retrieve the genesis block parameters for the Ropsten test network.

const Common = require('@nomicfoundation/ethereumjs-common').default;
const common = new Common({ chain: 'ropsten' });
console.log(common.genesis());

Other packages similar to @nomicfoundation/ethereumjs-common

Keywords

FAQs

Package last updated on 30 Aug 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc