For the complete documentation index, see llms.txt. This page is also available as Markdown.

Deploy Smart Contract on Unichain

This guide covers adding the network to a browser wallet, then deploying a simple contract using Foundry and Hardhat — pick whichever you prefer.

Unichain is an EVM-equivalent OP Stack Layer 2 that runs standard EVM bytecode, so contracts deploy with the usual Ethereum tooling such as Foundry, Hardhat, and Remix without modification. This guide covers adding Unichain to a wallet and deploying a first contract with Foundry and Hardhat through a GetBlock endpoint.

Prerequisites

  • A wallet holding ETH on Unichain for gas (see Add Network to Your Wallet below)

  • A GetBlock access token from the GetBlock dashboard, used as <ACCESS-TOKEN> in the endpoint https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

  • Node.js version 20 or later, for Hardhat

  • A funded deployer address, on Unichain Sepolia for testing (see Testnet Faucets)

Network Details

Property
Unichain Mainnet
Unichain Sepolia Testnet

Chain ID

130 (0x82)

1301 (0x515)

RPC URL

https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

Currency Symbol

ETH

ETH

Unichain is not pre-configured in MetaMask by default. Only Ethereum Mainnet and Sepolia ship pre-configured, so Unichain must be added manually or through an add-network button before it appears in the wallet.

Add Network to Your Wallet

1

Open your wallet

Open MetaMask, or the EVM wallet of choice.

2

Open network settings

Click the network dropdown at the top of the wallet.

3

Add a network manually

Click Add network, then Add a network manually.

4

Enter network details

Enter the network details from the Prerequisites section above.

5

Save and switch networks

Save and switch to the newly added network.

Deploy with Foundry

1

Install Foundry

2

Create a project

3

Create a contract

Create src/HelloUnichain.sol:

4

Deploy

5

Verify on Block Explorer

Uniscan uses the Etherscan V2 unified API. Use the chain ID and a single Etherscan API key:

Deploy with Hardhat

1

Create a project

Select a JavaScript project when prompted.

2

Configure networks

3

Create a contract

Create contracts/HelloUnichain.sol:

4

Compile and Deploy

Create scripts/deploy.js:

Then compile and deploy:

5

Verify on Block Explorer

Testnet Faucets

Unichain Sepolia

  • Unichain Faucet — dispenses Unichain Sepolia ETH to a connected wallet (verify)

  • Superchain Faucet — Sepolia ETH across OP Stack testnets, including Unichain Sepolia (verify)

  • Bridge Sepolia ETH from Ethereum Sepolia through the Unichain Bridge as an alternative to faucets

Last updated

Was this helpful?