Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@nomiclabs/hardhat-truffle5
Advanced tools
Hardhat plugin for integration with TruffleContract from Truffle 5. This allows tests and scripts written for Truffle to work with Hardhat.
This plugin brings to Hardhat TruffleContracts from Truffle 5. With it you can call contract()
and artifacts.require()
like you normally would with Truffle. Interact with your contracts with a familiar API from tasks, scripts and tests.
This plugin requires hardhat-web3 as a prerequisite.
npm install --save-dev @nomiclabs/hardhat-truffle5 @nomiclabs/hardhat-web3 web3
And add the following statement to your hardhat.config.js
:
require("@nomiclabs/hardhat-truffle5");
Or, if you are using TypeScript, add this to your hardhat.config.ts
:
import "@nomiclabs/hardhat-truffle5";
This plugin creates no additional tasks.
An instance of TruffleEnvironmentArtifacts
is injected into env.artifacts
and the method contract()
is injected into the global scope for using in tests.
There are no additional steps you need to take for this plugin to work. Install it, run npx hardhat test
and your Truffle tests should run with no need to make any modifications.
Take a look at the testing guide for a tutorial using it.
FAQs
Truffle 5 Hardhat compatibility plugin
The npm package @nomiclabs/hardhat-truffle5 receives a total of 3,563 weekly downloads. As such, @nomiclabs/hardhat-truffle5 popularity was classified as popular.
We found that @nomiclabs/hardhat-truffle5 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.