Shardeum Documentation

Using Remix

Overview

This guide walks through deploying a SimpleStorage contract on Shardeum using Remix IDE and MetaMask. It’s intended for developers who want a quick, browser-based way to deploy and interact with a contract on Shardeum testnet or mainnet.

For production workflows (scripts, repeatable deployments, CI, testing), refer to the Hardhat and Foundry guides.

Deployment Guide

Prerequisites

Before continuing, ensure you have:

  • MetaMask or other EVM-compatible wallets installed and set up
  • A Shardeum network added to MetaMask
  • SHM tokens available to pay for transaction fees

Step 1: Add Shardeum Network to Metamask

Connect MetaMask to Shardeum testnet by following the instructions here:

Connect Metamask to Shardeum

Once connected, claim test SHM from a faucet to cover deployment gas fees:

Claim SHM from faucet

Step 2: SimpleStorage Contract

Open Remix IDE, create a new file named SimpleStorage.sol, and paste:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
 
contract SimpleStorage {
    uint256 public value;
 
    event ValueUpdated(uint256 newValue);
 
    constructor(uint256 _value) {
        value = _value;
        emit ValueUpdated(_value);
    }
 
    function setValue(uint256 _value) external {
        value = _value;
        emit ValueUpdated(_value);
    }
}

Step 3: Compile the Contract

  1. In Remix, open the Solidity Compiler tab
  2. Select compiler version 0.8.20 (or another 0.8.x compatible version)
  3. Click Compile SimpleStorage.sol

Step 4: Deploy the Contract

  1. Open the Deploy & Run Transactions tab
  2. Set Environment to Injected Provider - MetaMask
  3. Confirm MetaMask is connected to the Shardeum network you want (testnet or mainnet)
  4. Select SimpleStorage from the contract dropdown
  5. Enter the constructor argument:
    • _value (example: 1)

Click Deploy and approve the transaction in MetaMask.

Setp 5: Verify Deployment

After deployment:

  • Copy the contract address shown in Remix
  • Search it on the explorer

Step 6: Interact With the Contract

In Remix (under “Deployed Contracts”):

  • Read value() to see the stored value
  • Call setValue(42) to update the value
  • Confirm the new value by reading value() again

On this page