Documentation Index
Fetch the complete documentation index at: https://fireblocks-43c4b3ee-chore-add-cli.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
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
- Install the Hardhat package:
- Initialize a new Hardhat project:
- Select Create a JavaScript project and press Enter.
- Follow the proceeding setup prompts.
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
- Install the plugin package:
- Import the plugin into your
hardhat.config.jsfile:
Configuring the Hardhat plugin
This plugin extends theHttpNetworkUserConfig object with an optional fireblocks field.
- For this example, copy the code sample below into your
hardhat.config.jsconfiguration file:
Working in Sandbox
If you are not using a Sandbox workspace, remove the apiBaseUrl line.
- Delete the
Lock.solfile 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
- Create a Solidity file in your project folder:
- Copy the following code sample into your
HelloWorld.solfile:
- Run the following command to compile the project:
Update and deploy the script
- Create a new file
ignition/modules/HelloWorld.jsand add the following module definition:
- Deploy your contract to the Ethereum Sepolia Testnet using Hardhat Ignition:
Post-deployment
Hardhat Ignition creates anignition/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.