Skip to main content
Deploy your EVM smart contracts to MANTRA Chain using standard EVM deployment tools.

Prerequisites

  • A funded wallet with OM tokens for gas fees
  • Your contract compiled and ready to deploy
  • Network configuration set up (see Getting Started)

Network Configuration

Testnet (DuKong)

Mainnet

Using Hardhat

Deployment Script

Create scripts/deploy.js:
const hre = require("hardhat");

async function main() {
  const MyContract = await hre.ethers.getContractFactory("MyContract");
  const myContract = await MyContract.deploy();
  
  await myContract.waitForDeployment();
  const address = await myContract.getAddress();
  
  console.log("Contract deployed to:", address);
  console.log("Explorer:", `https://explorer.dukong.io/address/${address}`);
}

main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });

Deploy

npx hardhat run scripts/deploy.js --network mantra_testnet

Using Foundry

Deploy with Forge

forge create src/MyContract.sol:MyContract \
  --rpc-url https://evm.dukong.mantrachain.io \
  --private-key $PRIVATE_KEY \
  --chain-id 5887

Using Scripts

Create script/Deploy.s.sol:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Script, console} from "forge-std/Script.sol";
import {MyContract} from "../src/MyContract.sol";

contract DeployScript is Script {
    function run() external {
        vm.startBroadcast();
        
        MyContract myContract = new MyContract();
        
        console.log("Contract deployed to:", address(myContract));
        
        vm.stopBroadcast();
    }
}
Deploy:
forge script script/Deploy.s.sol:DeployScript \
  --rpc-url https://evm.dukong.mantrachain.io \
  --private-key $PRIVATE_KEY \
  --broadcast \
  --chain-id 5887

Using Remix

  1. Go to Remix IDE
  2. Compile your contract
  3. Go to Deploy & Run
  4. Select “Injected Provider” (MetaMask)
  5. Make sure MetaMask is connected to MANTRA Chain
  6. Deploy your contract

Verifying Contracts

After deployment, verify your contract on the block explorer. See Verifying Contracts for details.

Next Steps