Skip to main content

How to Build dApps on Shibarium

Welcome to Shibarium — the L2 built for the Shiba Inu Ecosystem, designed to provide scalability, lower fees, and seamless developer experiences through full EVM compatibility. Whether you're building DeFi protocols, NFTs, or community tools, Shibarium empowers you with the same stack you're already familiar with on Ethereum.

Step 1: Connect to the Shibarium Network

To start building, add Shibarium RPC to your Ethereum-compatible wallet (e.g., MetaMask). For the complete RPC and chain id detail for Shibarium and Puppynet visit here

Step 2: Choose a Development Stack

Shibarium supports the most popular Ethereum developer tools:

Step 3: Deploy a Smart Contract

Option A: Deploy with Remix

Requirements:

  • MetaMask
  • Test BONE (get from faucet)

Steps:

  1. Write a simple contract in Remix:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract SimpleStorage {
uint storedData;

function set(uint x) public {
storedData = x;
}

function get() public view returns (uint) {
return storedData;
}
}
  1. Compile the contract.
  2. Connect your wallet using Injected Web3.
  3. Select Shibarium network → Deploy.
  4. Interact with your deployed contract via Remix UI.

Option B: Option B: Deploy and Verify with Hardhat

Prerequisites:

  • Node.js
  • MetaMask
  • Hardhat

Install Hardhat:


npm install -g hardhat

Project Setup:


mkdir shibarium-smart-contract
cd shibarium-smart-contract
npx hardhat
npm install --save-dev @nomiclabs/hardhat-ethers ethers dotenv

Write Your Contract (contracts/SimpleStorage.sol):


// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract SimpleStorage {
uint256 private storedData;

function set(uint256 x) public {
storedData = x;
}

function get() public view returns (uint256) {
return storedData;
}
}

Configure Network (hardhat.config.js):


require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
require("dotenv").config();

module.exports = {
solidity: "0.8.0",
networks: {
shibarium: {
url: "https://www.shibrpc.com",
accounts: [process.env.PRIVATE_KEY]
}
},
etherscan: {
apiKey: {
shibarium: "shib"
},
customChains: [
{
network: "shibarium",
chainId: 109,
urls: {
apiURL: "https://www.shibariumscan.io/api/",
browserURL: "https://www.shibariumscan.io/"
}
}
]
}
};

Deploy Script (scripts/deploy.js):


async function main() {
const [deployer] = await ethers.getSigners();
console.log("Deploying contract with:", deployer.address);

const SimpleStorage = await ethers.getContractFactory("SimpleStorage");
const simpleStorage = await SimpleStorage.deploy();

console.log("Deployed to:", simpleStorage.address);
}

main().catch((error) => {
console.error(error);
process.exit(1);
});

Deploy Your Contract:


npx hardhat run scripts/deploy.js --network shibarium

Verify the Contract:

npx hardhat verify --network shibarium <DEPLOYED_CONTRACT_ADDRESS>

Step 4: Test and Iterate

  • Use Puppynet to test your contract before deploying to mainnet.
  • Collect logs and test coverage using Hardhat.
  • Consider integrating frontend frameworks like Next.js or Vite with Ethers.js/Web3.js for a full-stack dApp.

Step 5: Go Further