
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@foundry-rs/hardhat-anvil
Advanced tools
This Hardhat plugin automatically starts and stops Anvil when running tests or scripts.
This plugin creates a network named anvil
. When this network is used, it can either connect to a running anvil
instance or launch a new server automatically before running tests and scripts.
npm install --save-dev @foundry-rs/hardhat-anvil
And add the following statement to your hardhat.config.js
:
require("@foundry-rs/hardhat-anvil");
Or, if you are using TypeScript, add this to your hardhat.config.ts
:
import "@foundry-rs/hardhat-anvil";
This plugin hooks into the test
.
This plugin adds a waffle
object to the Hardhat Runtime Environment. This object has all the Waffle functionality, already adapted to work with Hardhat.
This is a slightly modified, anvil
compatible version of @nomiclabs/hardhat-waffle
.
Once anvil
is installed you can simply run it and configure it via the CLI.
Once installed, you can build your tests almost like in Waffle.
Instead of importing things from ethereum-waffle
, you access them from the waffle
property of the Hardhat Runtime Environment.
You can set any of the Anvil's options (or anvil --help
) through the anvil
network config.
Note: currently only default settings are used if launch: true
. All other configs are currently ignored
It's recommend to spawn anvil
manually in a separate shell, see also Foundry repo
This example sets a larger block gas limit and the default balance of Anvil's accounts.
module.exports = {
defaultNetwork: "anvil",
anvil: {
url: "http://127.0.0.1:8545/",
launch: false, // if set to `true`, it will spawn a new instance if the plugin is initialized, if set to `false` it expects an already running anvil instance
}
}
};
By default, the anvil
object will be configured as
{
hdPath: "m/44'/60'/0'/0/",
mnemonic: 'test test test test test test test test test test test junk',
url: 'http://127.0.0.1:8545/',
launch: true,
accounts: {
mnemonic: 'test test test test test test test test test test test junk',
path: "m/44'/60'/0'/0/"
}
}
FAQs
Hardhat plugin for managing Anvil
The npm package @foundry-rs/hardhat-anvil receives a total of 175 weekly downloads. As such, @foundry-rs/hardhat-anvil popularity was classified as not popular.
We found that @foundry-rs/hardhat-anvil demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.