Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@nomiclabs/hardhat-web3
Advanced tools
This plugin integrates Web3.js 1.x
into Hardhat.
This plugin brings to Hardhat the Web3 module and an initialized instance of Web3.
npm install --save-dev @nomiclabs/hardhat-web3 'web3@^1.0.0-beta.36'
And add the following statement to your hardhat.config.js
:
require("@nomiclabs/hardhat-web3");
Or, if you are using TypeScript, add this to your hardhat.config.ts
:
import "@nomiclabs/hardhat-web3";
This plugin creates no additional tasks.
This plugin adds the following elements to the HardhatRuntimeEnvironment
:
Web3
: The Web3.js module.web3
: An instantiated Web3.js object connected to the selected network.Install it and access Web3.js through the Hardhat Runtime Environment anywhere you need it (tasks, scripts, tests, etc). For example, in your hardhat.config.js
:
require("@nomiclabs/hardhat-web3");
// task action function receives the Hardhat Runtime Environment as second argument
task("accounts", "Prints accounts", async (_, { web3 }) => {
console.log(await web3.eth.getAccounts());
});
module.exports = {};
And then run npx hardhat accounts
to try it.
Read the documentation on the Hardhat Runtime Environment to learn how to access the HRE in different ways to use Web3.js from anywhere the HRE is accessible.
FAQs
Hardhat plugin for using Web3 1.x
The npm package @nomiclabs/hardhat-web3 receives a total of 0 weekly downloads. As such, @nomiclabs/hardhat-web3 popularity was classified as not popular.
We found that @nomiclabs/hardhat-web3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.