SOMI is the native token of the Somnia Network, similar to ETH on Ethereum. Unlike ERC20 tokens, SOMI is built into the protocol itself and does not have a contract address.
Kindly note that the Native Token for Somnia Testnet is STT.
This multi-part guide shows how to use SOMI for:
Payments
Escrow
Donations & Tipping
Sponsored gas via Account Abstraction
Use SOMI for Payments in Smart Contracts
A simple contract that accepts exact SOMI payments:
Use msg.value to access the native token sent in a transaction. No ERC20 functions are needed.
To withdraw collected SOMI:
Deploy using Hardhat Ignition or Viem and test with a sendTransaction call.
Example.sol
Build an SOMI Escrow Contract
A secure escrow contract allows a buyer to deposit SOMI and later release or refund:
Release funds to the seller:
Deploy with Hardhat Ignition and pass SOMI as value during deployment.
Example.sol
SOMI Tip Jar
Allow any wallet to send tips directly:
Withdraw all tips:
Example.sol
Frontend tip
Sponsor SOMI Transactions with Account Abstraction
Using a smart account + relayer (e.g. via Privy, Thirdweb), the dApp can cover gas fees:
The Smart Contract function can execute mint or other logic as usual. The paymaster or relayer pays SOMI.
Conclusion
SOMI is native and used via msg.value, .transfer(), and payable.
There is no contract address for SOMI (STT for Testnet).
You can integrate SOMI into any Solidity or Viem app with no ERC20 logic.
Account Abstraction enables gasless dApps using SOMI as sponsor currency.