A simple ERC-20 token smart contract built with Solidity, designed for meme token creation on Ethereum-compatible blockchains.
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
- 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
- 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)
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.
maxSupply(): Returns the maximum token supplytotalSupply(): Returns the current total supplybalanceOf(address): Returns the balance of a specific address
- Node.js and npm
- Hardhat or Truffle development environment
- OpenZeppelin Contracts library
- Clone this repository
- Install dependencies:
npm install @openzeppelin/contracts
-
Install Hardhat:
npm install --save-dev hardhat
-
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; });
-
Deploy to a network:
npx hardhat run scripts/deploy.js --network <network-name>
- Copy the contract code to Remix IDE
- Compile with Solidity version ^0.8.20
- Deploy using the "Deploy & Run Transactions" tab
// Mint 1000 tokens to an address
await memeToken.mint("0x742d35Cc6634C0532925a3b8D2C8F", ethers.utils.parseEther("1000"));// Burn 100 tokens from your balance
await memeToken.burn(ethers.utils.parseEther("100"));// Transfer tokens
await memeToken.transfer("0x742d35Cc6634C0532925a3b8D2C8F", ethers.utils.parseEther("50"));
// Approve spending
await memeToken.approve("0x742d35Cc6634C0532925a3b8D2C8F", ethers.utils.parseEther("100"));- 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
This project is licensed under the MIT License - see the SPDX-License-Identifier in the contract file.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
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.