Skip to main content
MANTRA Chain is fully EVM-compatible, which means you can deploy Solidity smart contracts using familiar tools like Hardhat, Foundry, or Remix.
Full EVM Compatibility: Deploy Solidity smart contracts using standard EVM tooling - no need to learn new languages!

Prerequisites

Before deploying, make sure you have:
  • A funded wallet with MANTRA tokens for gas fees
  • Your contract compiled and ready to deploy
  • Network configuration set up

Network Configuration

Testnet (DuKong)

Mainnet

Method 1: Using Hardhat

Hardhat is a popular development environment for Ethereum software.

Setup

  1. Install Node.js (version 18.0 or higher recommended)
  2. Create a new project:
  3. Configure Hardhat for MANTRA Chain by updating hardhat.config.js:

Create Deployment Script

Create scripts/deploy.js:

Deploy

For more details, see our Hardhat guide.

Method 2: Using Foundry

Foundry is a fast, portable, and modular toolkit for Ethereum application development.

Setup

  1. Install Foundry:
  2. Create a new project:

Deploy with Forge

Using Scripts

Create script/Deploy.s.sol:
Deploy:
For more details, see our Foundry guide.

Method 3: Using Remix

Remix is a web-based IDE that makes it easy to deploy contracts without local setup.

Steps

  1. Go to Remix IDE
  2. Create or import your Solidity contract
  3. Compile your contract
  4. Go to the “Deploy & Run” tab
  5. Select “Injected Provider” (MetaMask)
  6. Make sure MetaMask is connected to MANTRA Chain
    • Add MANTRA Chain network if needed:
      • Network Name: MANTRA Chain Testnet
      • RPC URL: https://evm.dukong.mantrachain.io
      • Chain ID: 5887
      • Currency Symbol: MANTRA
  7. Deploy your contract

After Deployment

Verify Your Contract

After deployment, verify your contract on the block explorer. This allows others to view and interact with your contract source code. See our Verifying Contracts guide for detailed instructions.

Interact with Your Contract

Once deployed, you can:
  • View your contract on the block explorer
  • Interact with it using the explorer’s contract interaction features
  • Build a frontend application to interact with your contract

Next Steps

Resources