Catapulta is a tool that makes deploying and verifying smart contracts easier for developers using Foundry or Hardhat. It automates contract verification, which saves you time whether you're working with one or many blockchain networks. Catapulta works with over 20 EVM-compatible networks and automatically verifies contracts on all Routescan-based block explorers, making your contracts transparent with minimal effort.
To get the most out of Catapulta, including automatic verification on Testnet and Mainnet networks, sign up for free at the Catapulta dashboard to get your CATAPULTA_API_KEY
. You will need this key when working with Catapulta.
This article assumes that you are already familiar with how to initialize a Foundry or Hardhat project. If you are not, we recommend that you read our Hardhat and Foundry Contract Verification guides and then come back to this article.
System Requirements
Catapulta requires Git and a GNU/Linux or macOS system. Using emulation on Windows (e.g. Git Bash) is not recommended due to potential unexpected errors and inconsistent outcomes. Ensure your development environment meets these requirements for a smooth experience. Alternatively, you can use Docker to run an Ubuntu VM container to interact with Catapulta on unsupported systems.
Installing Catapulta
To use Catapulta, you’ll need to install it globally via npm
. Open your terminal and run.
npm i -g catapulta
ℹ️ If you receive permission errors, use the sudo
flag to run the command with administrative privileges. Or install Catapulta locally in the project directory with the npm i catapulta
command.
This installs the Catapulta CLI, which integrates with both Foundry and Hardhat workflows. Once installed and the project is initialized, sign in to the Catapulta dashboard, navigate to your project, and add your CATAPULTA_API_KEY
to your project's .env
file. This key connects your deployment session to the Catapulta RPC Relay for automated processing.
Deploying and Verifying with Foundry and Catapulta
You already know how to set up a Foundry project from our previous guides, write smart contracts, and configure your environment. Catapulta takes this a step further by automating deployment and verification in one command. You don't need to manually configure RPC address or network information in .env
, config files, or session variables anymore. Catapulta does it for you. To deploy and verify your contracts at the same time, use the Catapulta CLI.
npx catapulta script script/Counter.s.sol --network <network_name>
This command deploys your Solidity script to the specified network (e.g. Sepolia) and automatically verifies the contract on Routescan-based explorers. After execution, Catapulta generates a deployment report URL, where you can view contract addresses.
ℹ️ To see the Catapulta supported networks, you can run the following command in your terminal: catapulta networks
ℹ️ If you encounter the following error, add `--private-key $PRIVATE_KEY
` flag to your command:
`Error: Keystore file "/Users/{user}/.foundry/keystores/CATAPULTA_DEPLOYER" does not exist`
For contracts already deployed with Forge, you can import them into Catapulta to trigger verification retroactively.
npx catapulta import 'broadcasts/Counter.s.sol/[chain id]/run-latest.json’
This leverages Foundry’s run-latest.json
broadcast file to re-verify your contracts without redeploying.
Deploying and Verifying with Hardhat and Catapulta
If you use Hardhat, you're probably familiar with setting up projects in hardhat.config.js
or .ts
files and creating deployment scripts. This time Catapulta will make deployment and verification easier for you. Just like in Foundry, you don't have to take any additional steps regarding RPC and network information during deployment.
It's a recommended step to install Catapulta locally, even if you have a global installation, because Hardhat's workflow depends on plugins being defined in the project's configuration.
npm i catapulta
Then, import the Catapulta Hardhat plugin at the top of your hardhat.config.js
(or .ts
) file.
JavaScript
require("catapulta/hardhat");
TypeScript
import "catapulta/hardhat";
With your environment set up (including your CATAPULTA_API_KEY
in .env
), deploy using Hardhat Deploy.
npx catapulta deploy --network <network_name>
Alternatively, if you use plain Hardhat scripts, run them through Catapulta.
npx catapulta run ignition/modules/Lock.ts --network <network_name>
Both commands deploy your contracts and automatically verify them on Routescan-based explorers. Check the generated Catapulta deployment report for contract details.
Re-Verifying Your Deployed Contracts
If you do not see your contracts verified on Routescan, you can trigger re-verification for your entire project with a single click. Go to your deployment report, click the ‘Verify contracts’ button, and Catapulta will automatically handle the verification process, so you don't need to manually re-submit your contract code using commands.
How to Find Your Catapulta Deployed and Verified Contract on Routescan
First, copy your contract address from either Catapulta Dashboard or by accessing run-latest.json
broadcast file, if you are using a Foundry project. Then, use Routescan’s search bar to locate your contract address. Remember to switch between Mainnet and Testnet Routescan instances, depending on where you deployed your contract.
You can also access your contract directly with a template link as seen below.
For Mainnet:
https://routescan.io/address/<your_contract_address>/contract/<chain_ID>/code.
For Testnet:
https://testnet.routescan.io/address/<your_contract_address>/contract/<chain_ID>/code.
Practical Tips
Catapulta can fund your deployments via custom gas relay or gas abstraction for developers. Currently it’s available for Ethereum Sepolia, Ethereum Holesky, Avalanche Fuji, and Polygon Amoy, acting like a faucet for your Testnet operations. To fund your deployer account before your deployment, add
--sponsor
flag at the end of your catapulta command.If you are working with Foundry, alternatively to Catapulta Dashboard reports you can open
run-latest.json
from./broadcast
to get report data including contract address.When deploying and verifying contracts, ensure your
CATAPULTA_API_KEY
and private keys are stored securely in your.env
file and never shared.Always double-check network names to avoid deploying to unintended chains.