Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

MemeToken Smart Contract

A simple ERC-20 token smart contract built with Solidity, designed for meme token creation on Ethereum-compatible blockchains.

Overview

MemeToken is an ERC-20 compliant token contract that includes:

  • Fixed maximum supply of 100 million tokens
  • Owner-controlled minting functionality
  • Token burning capability
  • Built on OpenZeppelin's secure contract libraries

Features

  • ERC-20 Standard: Full compatibility with ERC-20 token standard
  • Capped Supply: Maximum supply of 100,000,000 MEME tokens
  • Owner Controls: Only the contract owner can mint new tokens
  • Burn Mechanism: Token holders can burn their own tokens
  • Security: Built using OpenZeppelin's audited contracts

Contract Details

  • Token Name: MemeToken
  • Token Symbol: MEME
  • Decimals: 18 (standard ERC-20)
  • Max Supply: 100,000,000 MEME
  • Initial Supply: 100,000,000 MEME (minted to deployer)

Functions

Public Functions

  • mint(address to, uint256 amount): Mint new tokens to a specified address (owner only)
  • burn(uint256 amount): Burn tokens from the caller's balance
  • Standard ERC-20 functions: transfer, approve, transferFrom, etc.

View Functions

  • maxSupply(): Returns the maximum token supply
  • totalSupply(): Returns the current total supply
  • balanceOf(address): Returns the balance of a specific address

Prerequisites

  • Node.js and npm
  • Hardhat or Truffle development environment
  • OpenZeppelin Contracts library

Installation

  1. Clone this repository
  2. Install dependencies:
    npm install @openzeppelin/contracts

Deployment

Using Hardhat

  1. Install Hardhat:

    npm install --save-dev hardhat
  2. Create a deployment script in scripts/deploy.js:

    async function main() {
      const MemeToken = await ethers.getContractFactory("MemeToken");
      const memeToken = await MemeToken.deploy();
      await memeToken.deployed();
      console.log("MemeToken deployed to:", memeToken.address);
    }
    
    main().catch((error) => {
      console.error(error);
      process.exitCode = 1;
    });
  3. Deploy to a network:

    npx hardhat run scripts/deploy.js --network <network-name>

Using Remix IDE

  1. Copy the contract code to Remix IDE
  2. Compile with Solidity version ^0.8.20
  3. Deploy using the "Deploy & Run Transactions" tab

Usage Examples

Minting Tokens (Owner Only)

// Mint 1000 tokens to an address
await memeToken.mint("0x742d35Cc6634C0532925a3b8D2C8F", ethers.utils.parseEther("1000"));

Burning Tokens

// Burn 100 tokens from your balance
await memeToken.burn(ethers.utils.parseEther("100"));

Standard ERC-20 Operations

// Transfer tokens
await memeToken.transfer("0x742d35Cc6634C0532925a3b8D2C8F", ethers.utils.parseEther("50"));

// Approve spending
await memeToken.approve("0x742d35Cc6634C0532925a3b8D2C8F", ethers.utils.parseEther("100"));

Security Considerations

  • The contract uses OpenZeppelin's battle-tested implementations
  • Only the owner can mint new tokens (centralized control)
  • Maximum supply is enforced to prevent inflation beyond the cap
  • Standard ERC-20 security practices are followed

License

This project is licensed under the MIT License - see the SPDX-License-Identifier in the contract file.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Disclaimer

This is a basic meme token contract for educational and development purposes. Always conduct thorough testing and security audits before deploying to mainnet with real value.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages