Introduction
What is rocketh?
rocketh is a framework-agnostic system for deploying smart contracts on Ethereum-compatible networks. It provides a minimal API to save and load deployments, making it easy to track and manage contract deployments across different networks.
The name is the archaic third-person verb, so it rhymes with doth: rocketh, as in "it deployeth".
Key features of rocketh include:
- Deployment tracking and management
- Deploy Scripts that can run anywhere, including in the browser
- Named accounts for easier contract interaction
- Deterministic deployments
- Library linking
- Support for various deployment strategies
Try it here
"Deploy scripts that can run anywhere, including in the browser" is easy to claim, so here it is running. Press Start and this page boots an EVM in your tab and walks four real deploy scripts, one step at a time.
Nothing is simulated. The contracts are compiled bytecode executed by a real EVM, the scripts are ordinary rocketh scripts using the same @rocketh/deploy and @rocketh/proxy you would use against mainnet, and every address you see really has code at it. Nothing talks to a network, so nothing is deployed anywhere but your own tab, and it all disappears when you reload.
What just happened
The four steps are a story about upgradeable contracts, and the interesting part is step 2.
- Deploy behind a proxy.
GreetingsRegistrygoes up with aCREATE2implementation and a proxy in front of it. You get two addresses: the proxy is the one you hand out, the implementation is the code behind it. - Write a greeting. You set
"hello"and it reads back as"hello", even though the script passed a"proxy:"prefix to the contract's constructor. This is the bug, and it is one of the most common proxy mistakes there is: a constructor runs against the implementation's storage, never the proxy's, so the proxy's own_prefixslot was never written. - Upgrade the implementation. The same proxy is pointed at
GreetingsRegistryV2, which sets the prefix through apostUpgradecall instead of a constructor. Watch the two tags in the Deployed panel: the proxy is same as before, the implementation is replaced. Your greeting from step 2 is still there. - Write another greeting. Now it comes back
"proxy:hello again". The greeting from step 2 keeps its old, unprefixed value.
That last asymmetry is worth sitting with. An upgrade replaces code, not storage: it changes what happens next, it does not rewrite what already happened. It is also why GreetingsRegistryV2 may only append storage variables. Reordering them, or inserting one above messages, would leave the new code reading the old slots and silently reinterpret every greeting anyone had stored.
Read the contracts
Both implementations live in packages/rocketh-playground/contracts/, and the four deploy scripts are in src/fixture/deploy-scripts.ts. They are compiled from that source, so what you read is what ran.
What is hardhat-deploy?
hardhat-deploy is a plugin for the Hardhat Ethereum development environment that leverages rocketh to provide a comprehensive deployment system. It makes it easy to deploy contracts to any network, keeping track of them and replicating the same environment for testing.
Key features of hardhat-deploy include:
- Integration with Hardhat's testing and task system
- Deployment scripts with tags and dependencies
- Named accounts for clearer tests and deployment scripts
- Support for specific deploy scripts per network
- Deployment retrying through saved pending transactions
Relationship Between rocketh and hardhat-deploy
hardhat-deploy v2 is a complete rewrite that uses rocketh under the hood. While rocketh provides the core deployment functionality, hardhat-deploy integrates it with the Hardhat environment, making it accessible through Hardhat tasks and configuration.
rocketh is designed to be modular, with core functionality provided by separate packages like @rocketh/deploy, @rocketh/proxy, and @rocketh/diamond. hardhat-deploy wires these modules together and adds Hardhat-specific functionality.
Where to go next
If you are starting a project, read these in order:
- Installation and Setup - install the packages and create the three files rocketh expects.
- Core Concepts - deployments, environments, chains, named accounts, tags and dependencies.
- Using rocketh - deploy contracts, proxies and diamonds, link libraries, deploy deterministically.
- Examples - complete deploy scripts to copy from.
Then, as you need them:
- Using hardhat-deploy with rocketh - the Hardhat plugin, and running deploy scripts in tests.
- Testing your deploy scripts - the
@rocketh/test-utilsharness, no node required. - Exporting, verifying and documenting - getting addresses and ABIs to a frontend, and source to a block explorer.
- Handling unknown signers - privileged calls owned by a Safe, multisig or governance key.
- Captured transactions - what a run sent, in order: a Safe batch from a fork rehearsal, or a deployment replayed in a Solidity test.
- Running once, and running last -
idandreturn truefor a script that must never run again, andrunAtTheEndfor the one that consumes what the others left behind. - Production hardening - what to check before a deployment touches a live chain.
- Architecture Overview - how the packages fit together.
Migrating an existing project? See Migrating from hardhat-deploy v1 to v2, and the dedicated hardhat-deploy documentation.