Deploy with Hardhat V3
This guide shows you how to deploy contracts from a Hardhat V3 project onto your Stagenet.
You do not need to change your contracts or your scripts. Just add a network entry pointing at your Stagenet’s RPC URL.
Prerequisites
- A Hardhat V3 project with a deployment script or Ignition module
- A funded deployer wallet — generate one with
contract.dev generate-wallet, or fund an existing address with the Faucet
Add your Stagenet as a network
Copy your Stagenet’s RPC URL from its dashboard and add a stagenet entry under networks in your hardhat.config.{js,ts}:
export default defineConfig({
networks: {
stagenet: {
type: "http",
chainType: "l1",
url: "<YOUR_STAGENET_RPC_URL>",
accounts: ["<YOUR_FUNDED_PRIVATE_KEY>"],
},
},
});Deploy contracts
npx hardhat run scripts/deploy.ts --network stagenetOr use Ignition:
npx hardhat ignition deploy ignition/modules/MyModule.ts --network stagenet --build-profile defaultPass --build-profile default with Ignition if you want automatic dashboards from pushed contracts — Ignition’s optimised default profile strips the metadata needed to match pushed bytecode.
Next steps
To get an automatic dashboard for each deployment, push your compiled contracts:
contract.dev push-contractsDeployments matching pushed bytecode are detected and get dashboards automatically. See Pushing Contracts.
Last updated on