Skip to main content
Hardhat is a development environment for Ethereum software that provides tools for editing, compiling, debugging, and deploying smart contracts and dApps. The Fireblocks Hardhat Plugin integrates Fireblocks’ secure transaction features into your Hardhat workflow, enabling secure deployment and transaction signing.

Using Hardhat

To use the Fireblocks Hardhat Plugin, you must have Hardhat installed. You can follow our abridged Hardhat installation steps below or skip to the Fireblocks Hardhat Plugin section if you already have Hardhat installed.

Install Hardhat

If you need to install Hardhat, you can use our abridged installation guide below. For a complete guide, refer to the official Hardhat installation guide.

Abridged Hardhat installation guide

  1. Install the Hardhat package:
  1. Initialize a new Hardhat project:
This generates the following Hardhat menu display:
  1. Select Create a JavaScript project and press Enter.
  2. Follow the proceeding setup prompts.
Complete these steps to generate a new JavaScript Hardhat project in your current directory.

Fireblocks Plugin

The Fireblocks Hardhat Plugin helps seamlessly integrate Fireblocks into your Hardhat development stack. You can use it to deploy contracts, sign messages, and send transactions securely through Fireblocks.

Installing the Hardhat plugin

  1. Install the plugin package:
  1. Import the plugin into your hardhat.config.js file:

Configuring the Hardhat plugin

This plugin extends the HttpNetworkUserConfig object with an optional fireblocks field.
  1. For this example, copy the code sample below into your hardhat.config.js configuration file:
Working in SandboxIf you are not using a Sandbox workspace, remove the apiBaseUrl line.
  1. Delete the Lock.sol file that came with your generated Hardhat environment:

Deploy a contract using Hardhat Ignition

Now that your Hardhat plugin has been configured to work with Fireblocks, you can begin deploying a smart contract to the Sepolia Ethereum Testnet.

Create and compile the Solidity file

  1. Create a Solidity file in your project folder:
  1. Copy the following code sample into your HelloWorld.sol file:
  1. Run the following command to compile the project:

Update and deploy the script

  1. Create a new file ignition/modules/HelloWorld.js and add the following module definition:
  1. Deploy your contract to the Ethereum Sepolia Testnet using Hardhat Ignition:
This should take a couple of minutes to run if everything was configured correctly. Once the deploy script has finished running successfully, the following message will appear:

Post-deployment

Hardhat Ignition creates an ignition/deployments/chain-11155111 folder for Sepolia that contains all the deployment details. This data enables Hardhat Ignition to recover from errors, resume interrupted deployments, and manage deployment states.

Summary

You have now integrated the Fireblocks Hardhat Plugin into your Ethereum development workflow and deployed a smart contract to the Sepolia Testnet using Hardhat Ignition! This setup enables you to securely deploy contracts and manage transactions with Fireblocks’ infrastructure.