Only this pageAll pages
Powered by GitBook
1 of 10

Somnia Documentation

Loading...

Get Started

Loading...

Loading...

Loading...

Loading...

Developer

Loading...

Loading...

Loading...

Introduction

Somnia is a high-performance, cost-efficient EVM-compatible Layer 1 blockchain capable of processing over 1,000,000 transactions per second (TPS) with sub-second finality. It is suitable for serving millions of users and building real-time mass-consumer applications like games, social applications, metaverses, and more, all fully on-chain.

Somnia Mainnet is LIVE. Visit the Network Information Page for Network details.

Developers who are deploying Smart Contracts and need Somnia Test Tokens, STT. Please join the . Go to the #dev-chat channel, tag the Somnia DevRel, @emma_odiaand request Test Tokens. You can also email [email protected] with a brief description of what you are building and your GitHub profile.

Somnia is supported by and . Improbable will develop some of the key technical components of Somnia, including the Blockchain, but the project will require a large and active community to fulfill its vision.

Discord
Improbable
MSquared
Cover

Start developing on Somnia

Cover

Connect To Mainnet

Getting Started for Mainnet

GET SOMI TOKENS

Developers and Non-Developers can purchase SOMI Tokens for interacting on Mainnet from the list of exchanges below:

CEX
DEX

Quickswap

BRIDGE TO SOMNIA

Developers and Non-Developers can also Bridge their Stablecoins from other Networks to Somnia using LayerZero's STARGATE: Welcome to Somnia Mainnet. Below is a checklist for you to confirm the Migration from Testnet to Mainnet.

For Non-Developers

For Developers

Conduct the same checks as non-developers, and in addition, the following.

Gate.io

Bitget

https://stargate.finance/bridge
ChainList
Binance
module.exports = {
  // ...
  networks: {
    somnia: {
      url: "https://api.infra.mainnet.somnia.network",
      accounts: ["0xPRIVATE_KEY"], // put dev menomonic or PK here,
    },
   },
  // ...
};
forge create --rpc-url https://api.infra.mainnet.somnia.network --private-key PRIVATE_KEY src/Example.sol:Example

Testnet STT Tokens

The Somnia Testnet is meant for developers to build and deploy the first versions of their applications, and there may be bugs. Any issues, please: Share your feedback at [email protected]

Or raise them in our Discord

  1. To Proceed with this step, you should connect your wallet with Somnia Testnet

  2. To Request for Somnia Testnet Token, Click on Get STT Tokens button.

Developers who are deploying Smart Contracts and need Somnia Test Tokens, STT. Please join the . Go to the #dev-chat channel, tag the Somnia DevRel, @emma_odiaand request Test Tokens. You can also email [email protected] with a brief description of what you are building and your GitHub profile.

  1. Click on "Get STT"

  1. You should have it in your wallet

  1. You can Select Somnia Testnet and See your tokens

Try Sending Tokens

  1. Click on Send Tokens

  1. Send STT tokens to your Desired Wallet address or a random address

  1. Check our Activity Section in Metamask

Bridging Info

Somnia supports cross-chain asset transfers through two official bridge partners: Relay and Stargate Finance. These bridges enable you to move tokens between Somnia and other blockchain networks while maintaining security and minimizing fees. Whether you're bridging stablecoins, ETH, or other supported assets, this guide will walk you through the complete process.

Prerequisites

  • Wallet Setup: MetaMask, WalletConnect-compatible wallet, or hardware wallet

Discord

Network Configuration: Somnia network added to your wallet

  • Funded Wallet: Source chain tokens to cover bridge fees and gas costs

  • Basic Understanding: Familiarity with blockchain transactions and gas fees

  • Supported Bridges

    Relay Bridge

    Relay is a multichain payments network that has served 5M+ users and processed $5B+ in volume across 85+ networks. It offers instant cross-chain transactions with 99.9% uptime and payments-grade reliability.

    Key Features:

    • Instant Execution: Cross-chain transfers in 1-10 seconds

    • 75+ Networks: Extensive blockchain support including Somnia

    • Predictable Fees: Transparent fee structure with no hidden costs

    • Enterprise Grade: 99.9% uptime with automatic redundancy systems

    Supported Assets: ETH, USDC, USDT, and other major tokens Website: relay.link/bridge

    Stargate Finance

    Stargate is a fully composable cross-chain bridge built on LayerZero that connects 50+ blockchains. It's the first bridge to solve the "bridging trilemma" by providing instant guaranteed finality, native assets, and unified liquidity.

    Key Features:

    • Native Assets: Transfer native tokens without wrapped intermediates

    • Instant Finality: Guaranteed transaction completion

    • Unified Liquidity: Shared liquidity pools across all chains

    • LayerZero Powered: Built on robust omnichain infrastructure

    Supported Assets: USDC, USDT, ETH, BTC, and LayerZero OFTs Website: stargate.finance

    Using Relay Bridge

    1

    Access Relay Bridge

    Navigate to relay.link/bridge in your web browser.

    2

    Connect Your Wallet

    Click "Connect Wallet" and select your preferred wallet provider. Approve the connection when prompted.

    3

    Configure Bridge Transaction

    • Source Chain: Select the blockchain you're bridging FROM

    4

    Review Transaction Details

    Carefully review:

    • Bridge Fee: Relay's service fee

    5

    Execute Bridge Transaction

    Click "Bridge" and confirm the transaction in your wallet. The process typically involves:

    • Approval Transaction: Authorize Relay to spend your tokens (if required)

    6

    Verify Completion

    Check your wallet balance on the destination chain. Relay provides real-time status updates during the bridging process.

    Using Stargate Finance

    1

    Access Stargate Bridge

    Visit stargate.finance and click "Bridge" or "Transfer".

    2

    Connect Wallet & Select Networks

    Connect your wallet and configure:

    • From: Source blockchain

    • To: Somnia (or destination chain)

    • Asset: Select supported token (USDC, USDT, ETH, etc.)

    3

    Enter Transfer Details

    • Amount: Specify transfer amount

    4

    Review Pool Information

    Stargate displays:

    • Available Liquidity: Pool depth on destination chain

    5

    Execute Transfer

    Confirm transaction details and sign with your wallet. 3 Stargate's ΔBridge technology ensures native asset delivery without wrapped tokens.

    6

    Monitor Transaction

    Track your transfer through:

    • Stargate Interface: Real-time status updates

    Troubleshooting Common Issues

    Transaction Stuck or Pending

    Symptoms: Bridge transaction shows "pending" for extended period

    1

    Check Network Status: Verify source and destination chain health

    2

    Gas Price Issues: Increase gas price if transaction is stuck

    3

    Bridge Congestion: Wait for network congestion to clear

    4

    Contact Support: Reach out to bridge support with transaction hash

    Insufficient Liquidity

    Symptoms: Bridge shows "insufficient liquidity" error

    1

    Reduce Amount: Try bridging smaller amounts

    2

    Wait for Rebalancing: Liquidity pools rebalance automatically

    3

    Alternative Routes: Use different bridge or route

    4

    Split Transactions: Break large transfers into smaller ones

    Wrong Network or Address

    Symptoms: Tokens didn't arrive at expected destination

    1

    Verify Network: Ensure correct destination network selected

    2

    Check Address: Confirm recipient address accuracy

    3

    Network Switch: Switch wallet to destination network

    4

    Recovery Process: Contact bridge support for recovery options

    High Fees or Slippage

    Symptoms: Unexpected high costs or poor exchange rates

    1

    Timing: Bridge during low network congestion periods

    2

    Route Optimization: Compare different bridge options

    3

    Amount Adjustment: Larger amounts often have better rates

    4

    Alternative Bridges: Consider other bridge providers

    Verification And Testing

    Test Bridge Functionality

    1

    Connect wallet to both source and destination networks

    2

    Bridge small test amount (e.g., $10-50)

    3

    Verify tokens arrive within expected timeframe

    4

    Check token balances on both chains

    5

    Test bridge interface responsiveness

    Confirm Successful Bridge

    1

    Source Chain: Confirm tokens debited from source wallet

    2

    Bridge Status: Check bridge interface for completion status

    3

    Destination Chain: Verify tokens credited to destination wallet

    4

    Balance Check: Ensure correct amounts received

    You've successfully learned how to bridge assets to and from Somnia using both Relay and Stargate Finance. These official bridge partners provide secure, fast, and reliable cross-chain transfers with different strengths:

    • Relay: Best for fast payments and swaps across 75+ networks

    • Stargate: Ideal for DeFi composability with native asset transfers

    Both bridges support Somnia's high-performance infrastructure, enabling seamless integration with the broader multi-chain ecosystem.

    For technical support, contact the respective bridge providers or Somnia community channels.

    Connect Your Wallet To Mainnet

    Somnia Mainnet is LIVE. Visit the for Network details.

    Share your feedback at [email protected]

    Destination Chain: Select Somnia (or your target chain)
  • Token: Choose the asset you want to bridge

  • Amount: Enter the amount to transfer\

  • Gas Fee: Network transaction cost

  • Estimated Time: Usually 1-10 seconds

  • Recipient Address: Verify destination address(Your address or if you want to bridge to a different wallet.

  • Bridge Transaction: Execute the cross-chain transfer

  • Confirmation: Receive tokens on destination chain

  • Recipient: Destination wallet address (defaults to your connected wallet)

    Only applicable if you are bridging to another wallet address.\

    • Slippage: Set acceptable slippage tolerance (usually 0.1-0.5%)

    Bridge Fee: Protocol fee structure

  • Gas Estimate: Transaction costs

  • Route: Cross-chain path details

  • LayerZero Scan: Cross-chain transaction explorer

  • Destination Explorer: Confirm arrival on target chain

  • Or raise them in our Discord
    1. You can create your MetaMask Wallet from here. If you already have a wallet you may skip this step

    Developers who are deploying Smart Contracts and need Somnia Test Tokens, STT. Please join the Discord. Go to the #dev-chat channel, tag the Somnia DevRel, @emma_odiaand request Test Tokens. You can also email [email protected] with a brief description of what you are building and your GitHub profile.

    1. Visit Chainlist and Click on "Connect Wallet":

    1. First, Connect your Wallet. You may use any desired wallet or Metamask (preferred)

    1. Click on "Add to Metamask" to add Somnia Mainnet to your wallet

    Testnet

    Network Information Page

    Network Info

    The Somnia Mainnet is LIVE

    Developers who deploy Smart Contracts on Mainnet require Somnia Tokens, SOMI. It is a real-world utility token that can be purchased on a list of CEXs and DEXs here.

    Developers who are deploying Smart Contracts and need Somnia Test Tokens, STT. Please join the . Go to the #dev-chat channel, tag the Somnia DevRel, @emma_odiaand request Test Tokens. You can also use the Faucet: You can also email [email protected] with a brief description of what you are building and your GitHub profile.

    Network
    Mainnet
    Testnet

    Add Somnia Mainnet to your wallet through -

    Add Somnia Testnet to your wallet through -

    Using .

    RPC Providers

    RPCs

    Faucet Providers

    Head over to the section to start building on Somnia.

    Community

    to chat with devs and raise issues

    for updates

    Solidity Resources

    • by Learn Web3

    Toolkit

    • - Solidity development framework paired with a JavaScript testing framework

    • - Solidity framework for both development and testing.

    MultiCallV3

    EntryPoint v0.7

    Factory Address

    Alternative Testnet Block Explorer

    Testnet Faucet

    Stakely Mainnet Faucet

    Cookbook.dev

  • Alchemy Unversity

  • Remix - Solidity IDE with interactive features

    Chain ID

    5031

    50312

    Block Explorer

    https://explorer.somnia.network

    https://shannon-explorer.somnia.network/

    Symbol

    SOMI

    STT

    RPC

    https://api.infra.mainnet.somnia.network/

    https://dream-rpc.somnia.network/

    Ankr

    https://www.ankr.com/rpc/somnia

    Public Node

    https://somnia.publicnode.com

    Stakely

    https://somnia-json-rpc.stakely.io

    Validation Cloud

    https://www.validationcloud.io/somnia

    Google Cloud Faucet

    https://cloud.google.com/application/web3/faucet/somnia/shannon

    Stakely

    https://stakely.io/faucet/somnia-testnet-stt

    Thirdweb Faucet

    https://thirdweb.com/somnia-shannon-testnet

    Discord
    https://testnet.somnia.network/
    https://chainlist.org/?chain=50312&search=somnia
    https://testnet.somnia.network/
    Metamask
    Tutorials
    Join the Exclusive Developer Community
    Apply for the Somnia Network Grants Program
    Join us on Discord
    Follow us on Twitter
    Ethereum Developer
    Solidity by Example
    CryptoZombies
    Hardhat Toolkit
    Foundry Toolkit

    Network Overview (Mainnet / Testnet)

    Somnia provides two distinct environments for developers and users: Mainnet and Testnet (Shannon). Both serve different purposes in the ecosystem, and knowing when to use which is essential for building and deploying applications effectively.


    Somnia Mainnet

    The Mainnet is the official production blockchain of Somnia. All transactions on this chain are final and irreversible and require SOMI tokens as gas.

    0x5e44F178E8cF9B2F5409B6f18ce936aB817C5a11
    0x841b8199E6d3Db3C6f264f6C2bd8848b3cA64223
    0x0000000071727De22E5E9d8BAf0edAc6f37da032
    0x4be0ddfebca9a5a4a617dee4dece99e7c862dceb
    https://somnia-testnet.socialscan.io/
    https://testnet.somnia.network/
    https://stakely.io/faucet/somnia-somi
    Key Characteristics
    • Real-value environment secured by Somnia’s validator set.

    • Integrated with wallets, explorers, bridges, and infrastructure providers.

    • Permanent and immutable transaction history.

    • Designed for live dApps, end-users, and production-ready deployments.

    When to Use Mainnet

    • Deploying audited and tested smart contracts.

    • Running dApps with real users and assets.

    • Managing liquidity, staking, governance, or NFT projects.

    • Partner integrations requiring security and finality.

    Example


    Somnia Testnet (Shannon)

    The Testnet is a sandbox environment that mirrors mainnet behavior but uses STT test tokens with no real-world value. It allows safe experimentation and rapid iteration without financial risk.

    Key Characteristics

    • Transactions use STT tokens, available via the faucet.

    • Close-to-mainnet parameters for realistic testing.

    • Safe for prototyping, debugging, and QA.

    • Commonly used in workshops, hackathons, and developer onboarding.

    When to Use Testnet

    • Learning how to connect and deploy on Somnia.

    • Prototyping features or building MVPs.

    • Debugging smart contracts or dApp flows.

    • Preparing for audits and production deployment.

    Example


    Quick Comparison

    Feature
    Mainnet (Production)
    Testnet (Shannon)

    Currency

    SOMI (real value)

    STT (valueless, faucet)

    Purpose

    Production deployments

    Development & testing

    Transactions

    Permanent and irreversible

    Experimental and disposable

    Typical Use

    Live dApps, DeFi, staking, NFT


    Best Practices

    • Start on Testnet: Validate contracts and flows on Shannon before mainnet.

    • Audit before launch: Ensure contracts are reviewed and secure.

    • Use separate configs: Keep .env files distinct for testnet and mainnet.

    • Stay updated: Follow official announcements for upgrades and changes.

    Tip: Treat Testnet as your safe playground and Mainnet as your production stage. Every project should pass through Testnet before moving to Mainnet.

    Smart Contracts

    Below is a list of all critical Smart Contract addresses for Somnia network.

    Contract
    Address
    Deploy to Somnia Mainnet
    # Deploying a contract to Somnia Mainnet
    npx hardhat run scripts/deploy.js --network somnia_mainnet
    Deploy to Somnia Testnet (Shannon)
    # Deploying a contract to Somnia Testnet
    npx hardhat run scripts/deploy.js --network somnia_testnet

    Prototyping, QA, education

    Risk

    Financial impact possible

    No financial risk

    Omnichain SOMI Deployments.

    Mainnet
    Address
    Type

    BNB Chain

    OFT

    Base

    OFT

    Ethereum

    OFT

    Somnia

    NativeOFTAdapter

    LayerZero Contracts

    • chainKey : somnia

    • stage : mainnet

    • EID : 30380

    Contract
    Address

    endpointV2 (main entrypoint)

    sendUln302

    receiveUln302

    executor

    deadDVN

    Oracles

    DIA - Mainnet Price Feeds. Documentation

    Contract
    Address

    Oracle

    Gas Wallet

    USDT

    USDC

    BTC

    ARB

    Protofire - Mainnet VRF Smart Contracts. Documentation.

    Contract
    Address

    VRFV2PlusWrapper

    LINK Token

    LINK/NATIVE oracle

    MultiCallV3

    0x5e44F178E8cF9B2F5409B6f18ce936aB817C5a11

    WSOMI

    0x046EDe9564A72571df6F5e44d0405360c0f4dCab

    USDC

    0x28bec7e30e6faee657a03e19bf1128aad7632a00

    WETH

    0x936Ab8C674bcb567CD5dEB85D8A216494704E9D8

    USDT

    SOL

    0xa4a3a8B729939E2a79dCd9079cee7d84b0d96234

    WETH

    0x4E5A9Ebc4D48d7dB65bCde4Ab9CBBE89Da2Add52

    SOMI

    0x1f5f46B0DABEf8806a1f33772522ED683Ba64E27

    0x67B302E35Aef5EEE8c32D934F5856869EF428330
    0xa9616e5e23ec1582c2828b025becf3ef610e266f
    0x47636b3188774a3E7273D85A537b9bA4Ee7b253
    0x1B0F6590d21dc02B92ad3A7D00F8884dC4f1aed9
    0xC3D4E9Ac47D7f37bB07C2f8355Bb4940DEA3bbC3
    0x6F475642a6e85809B1c36Fa62763669b1b48DD5B
    0xC39161c743D0307EB9BCc9FEF03eeb9Dc4802de7
    0xe1844c5D63a9543023008D332Bd3d2e6f1FE1043
    0x4208D6E27538189bB48E603D6123A94b8Abe0A0b
    0x6788f52439ACA6BFF597d3eeC2DC9a44B8FEE842
    0xbA0E0750A56e995506CA458b2BdD752754CF39C4
    0x3073d2E61ecb6E4BF4273Af83d53eDAE099ea04a
    0x936C4F07fD4d01485849ee0EE2Cdcea2373ba267
    0x5D4266f4DD721c1cD8367FEb23E4940d17C83C93
    0xb12e1d47b0022fA577c455E7df2Ca9943D0152bE
    0x6a96a0232402c2BC027a12C73f763b604c9F77a6
    0x606b2B36516AB7479D1445Ec14B6B39B44901bf8
    0x0a4Db7035284566F6f676991ED418140dC01A2aa
    0xEBD41881413dD76F42DF2902ee865099af9099B4
    Cover

    Learn more about Somnia