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

hardhat-ethernal

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hardhat-ethernal

Ethernal Hardhat plugin

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
548
decreased by-15.69%
Maintainers
1
Weekly downloads
 
Created
Source

Hardhat plugin for Ethernal

Ethernal is a block explorer for EVM-based chains. You can use it with your local chains (the Hardhat network for example), or for chains deployed on remote servers.

It allows you to interact with contracts by automatically generating an UI for all read/write methods. You can also read contract variables in any blocks.

To use Ethernal, you need to synchronize blocks, transactions & artifacts with the dashboard. This plugin allows you to easily do that instead of having to run the CLI separately.

If you are looking for more detailed doc about Ethernal: https://doc.tryethernal.com

Installation

Add hardhat-ethernal to your package.json, and run npm install or yarn

Login

To authenticate with your Ethernal account, you can either use the ethernal npm package and run ethernal login.

Otherwise, you can pass the env variables ETHERNAL_EMAIL and ETHERNAL_PASSWORD to the Hardhat command. This is especially useful if you are running Ethernal on Ubuntu or in a Docker container as you might run into issues with the keychain on there.

Synchronize blocks & transactions

In your hardhat-config.jsfile, require the plugin:

require('hardhat-ethernal');

That's it! Blocks and transactions will now be synchronized.

Options

It's possible to disable the synchronization by setting ethernalSync to false on the hre object.

You can also specify which workspace you want to synchronize blocks & transactions to (default to the last one used in the dashboard).

By default, transactions will be traced using experimentalAddHardhatNetworkMessageTraceHook, showing CALLx and CREATEx operations in the dashboard. You can disable this feature with the ethernalTrace flag.

extendEnvironment((hre) => {
    hre.ethernalSync = true;
    hre.ethernalWorkspace = 'Workspace';
    hre.ethernalTrace = false;
});

Synchronize artifacts

In your deploy script, first require the plugin:

const ethernal = require('hardhat-ethernal');

Then, push your artifacts to Ethernal, after deploying your contract:

/!\ The name parameter needs to match the name of the contract

const Greeter = await hre.ethers.getContractFactory("Greeter");
const greeter = await Greeter.deploy("Hello, Hardhat!");
await hre.ethernal.push({
    name: 'Greeter',
    address: greeter.address
});

The following fields will be synchronized:

  • contractName
  • abi
  • ast
  • source

Keywords

FAQs

Package last updated on 11 Feb 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