Deploy Smart Contract on MEVM

Finally, it's time to deploy your first smart contract on Metaverse.Network Alpha Testnet network!

In this tutorial, you will deploy a basic ERC20 token using Remix.

1. Create ERC20 smart contract using Openzeppelin Contract Library

Visit Openzeppelin, select ERC20 as the smart contract you want to build, and feel free to change the Name, Symbol, Initial Supply and some other features if you wish. We would go to a super simple version of ERC20

Name: Test

Symbol: TST

Initial Supply: 100000

Decimals: 18 (only editable in code)

Here is the code it will generated.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract Test is ERC20 {
    constructor() ERC20("Test", "TST") {
        _mint(msg.sender, 100000 * 10 ** 18);
    }
}

2. Deploy ERC20 Smart contract using Remix

Compile Smart Contract with Remix

Open Remix, then Create a New File and name it ERC20.sol, paste the code example into your file.

We also created a quick link for you to interact with Remix, please note that you need to change decimals() to 18 to get the code compiled. Open Remix

At this stage, you should be able to compile the ERC20 smart contract. If you compiled successfully, you will see the screenshot below.

Deploy Smart Contract 🎉

Now, it's an exciting time to get your first smart contract deployed on blockchain.

Step 1: Select the Deployment icon on Remix

Step 2: Select Environment: Injected Provider - MetaMask (you tell Remix to use Environment from MetaMask which is Metaverse.Network Alpha Tetsnet)

Step 3: Click Deploy (make sure you select the account that has Testnet NEER balance to deploy)

Note: Recently, Remix has only recently supported Shanghai Upgrade. Your deployment may fail due to incompatible gas calculations.

The dev team is currently working to upgrade our Testnet soon.

Last updated