Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
hardhat-ethernal
Advanced tools
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
Add hardhat-ethernal
to your package.json
, and run npm install
or yarn
In your hardhat-config.js
file, require the plugin:
require('hardhat-ethernal');
To authenticate, you can set ETHERNAL_EMAIL
and ETHERNAL_PASSWORD
in your env variables, they'll be picked up automatically.
You can also set them in the config object:
module.exports = {
ethernal: {
email: process.env.ETHERNAL_EMAIL,
password: process.env.ETHERNAL_PASSWORD,
}
};
Once you've installed the plugin and authenticated, the plugin will automatically sync blocks and transactions going through your node. By default, it will synchronize to the latest workspace you've used in the dashboard. See next section to learn how to set the workspace manually.
All options need to be under the optional ethernal
key in the Hardhat config object, default values are shown below:
module.exports = {
ethernal: {
disableSync: false, // If set to true, plugin will not sync blocks & txs
disableTrace: false, // If set to true, plugin won't trace transaction
workspace: undefined, // Set the workspace to use, will default to the default workspace (latest one used in the dashboard). It is also possible to set it through the ETHERNAL_WORKSPACE env variable
uploadAst: false, // If set to true, plugin will upload AST, and you'll be able to use the storage feature (longer sync time though)
disabled: false, // If set to true, the plugin will be disabled, nohting will be synced, ethernal.push won't do anything either
resetOnStart: undefined // Pass a workspace name to reset it automatically when restarting the node, note that if the workspace doesn't exist it won't error
}
};
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
});
By default, the push function is not going to upload AST to Ethernal. If you want to use "Storage" tab on contracts pages, you'll need to activate it. To do so, set the hre.ethernalUploadAst = true
flag in your Hardhat config file (this will upload the ast field, as well as the source field).
You can reset a workspace programmatically by calling: hre.ethernal.resetWorkspace(workspaceName)
(async function). All accounts/blocks/transactions/contracts will be deleted.
[v1.0.0] - 2022-05-09
ethernal
object on Hardhat config. See README for detailsFAQs
Ethernal Hardhat plugin
The npm package hardhat-ethernal receives a total of 401 weekly downloads. As such, hardhat-ethernal popularity was classified as not popular.
We found that hardhat-ethernal 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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.