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:
Once connected, claim test SHM from a faucet to cover deployment gas fees:
Step 2: SimpleStorage Contract
Open Remix IDE, create a new file named SimpleStorage.sol, and paste:
Step 3: Compile the Contract
- In Remix, open the Solidity Compiler tab
- Select compiler version
0.8.20(or another0.8.xcompatible version) - Click Compile SimpleStorage.sol
Step 4: Deploy the Contract
- Open the Deploy & Run Transactions tab
- Set Environment to
Injected Provider - MetaMask - Confirm MetaMask is connected to the Shardeum network you want (testnet or mainnet)
- Select
SimpleStoragefrom the contract dropdown - 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