RISE Logo-Light

Deploying Contracts

Deploy smart contracts to RISE using Hardhat Ignition

Deploy your compiled smart contracts to the RISE Testnet using Hardhat Ignition, our official deployment plugin.

Prerequisites

  • Hardhat project configured for RISE (see Get Started)
  • Testnet ETH from the RISE Faucet
  • Private key configured with Configuration Variables

Deploy with Hardhat Ignition

Write a Deployment Module

Hardhat Ignition uses modules to describe deployments. Create ignition/modules/Counter.ts:

ignition/modules/Counter.ts
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";

export default buildModule("CounterModule", (m) => {
  const counter = m.contract("Counter");

  return { counter };
});

This module deploys an instance of the Counter contract. You can also call functions after deployment:

ignition/modules/Counter.ts
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";

export default buildModule("CounterModule", (m) => {
  const counter = m.contract("Counter");

  // Call a function after deployment
  m.call(counter, "setNumber", [42n]);

  return { counter };
});

Test Your Module Locally

Before deploying to a live network, test the module locally:

npx hardhat ignition deploy ignition/modules/Counter.ts
yarn hardhat ignition deploy ignition/modules/Counter.ts
pnpm exec hardhat ignition deploy ignition/modules/Counter.ts
bun x hardhat ignition deploy ignition/modules/Counter.ts

This simulates the deployment in a local network to verify everything works.

Deploy to RISE Testnet

Deploy your contract to RISE:

npx hardhat ignition deploy ignition/modules/Counter.ts --network riseTestnet
yarn hardhat ignition deploy ignition/modules/Counter.ts --network riseTestnet
pnpm exec hardhat ignition deploy ignition/modules/Counter.ts --network riseTestnet
bun x hardhat ignition deploy ignition/modules/Counter.ts --network riseTestnet

You'll see output indicating successful deployment with the contract address.

Ignition remembers deployment state. If you run the same deployment again, nothing will happen because the module was already executed.

View on Explorer

View your deployed contract on the RISE Testnet Explorer by searching for the contract address from the deployment output.

Deploy with Constructor Arguments

If your contract has constructor parameters:

ignition/modules/Counter.ts
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";

export default buildModule("CounterModule", (m) => {
  const initialValue = m.getParameter("initialValue", 42n);

  const counter = m.contract("Counter", [initialValue]);

  return { counter };
});

Deploy with parameters:

npx hardhat ignition deploy ignition/modules/Counter.ts --network riseTestnet --parameters '{"CounterModule":{"initialValue":"100"}}'
yarn hardhat ignition deploy ignition/modules/Counter.ts --network riseTestnet --parameters '{"CounterModule":{"initialValue":"100"}}'
pnpm exec hardhat ignition deploy ignition/modules/Counter.ts --network riseTestnet --parameters '{"CounterModule":{"initialValue":"100"}}'
bun x hardhat ignition deploy ignition/modules/Counter.ts --network riseTestnet --parameters '{"CounterModule":{"initialValue":"100"}}'

Next Steps