Smart Contracts
MemeTrade is built on a modular smart contract architecture on Base, providing secure and efficient token creation and trading.
Overview
MemeTrade's smart contracts are designed to be flexible and extensible, allowing for a wide range of tokenomics and governance models. The platform leverages the security and scalability of Base to offer a seamless experience for users and developers alike.
Key Contracts
Factory Contract: Deploys new token instances and manages platform templates.
Governance Contract: Facilitates community proposals and voting.
Economic Module: Handles fee distribution and liquidity mining rewards.
Template Module: Manages token templates and associated fees.
Security
All contracts are audited by leading security firms and are open source for community review. MemeTrade also offers a bug bounty program to encourage responsible disclosure of vulnerabilities.
Getting Started
To start building on MemeTrade, check out our Developer Guide for detailed instructions on integrating with our smart contracts.
Core Contracts
Factory Contract
The main contract that handles token creation and manages the platform.
Key Functions:
createToken()- Deploy new meme tokensupdateTemplate()- Modify token templatessetGovernance()- Update governance settings
Address (Base Sepolia): 0x[CONTRACT_ADDRESS]
Template Contracts
Modular templates that define token behavior and economics.
ViralTemplate
Implements viral mechanics for meme tokens
Handles holder rewards and burn mechanisms
Manages creator fees and governance
StandardTemplate
Basic ERC-20 functionality
Simple tokenomics
Minimal gas usage
Governance Contract
Manages platform governance and proposal voting.
Key Functions:
propose()- Submit governance proposalsvote()- Cast votes on proposalsexecute()- Execute passed proposals
Liquidity Mining Helper
Facilitates liquidity mining rewards and pool management.
Key Functions:
addLiquidity()- Add liquidity to poolsclaimRewards()- Claim mining rewardsgetRewardInfo()- View reward details
Architecture Overview
Integration Guide
Creating Tokens Programmatically
Interacting with Tokens
Adding Liquidity
Contract ABIs
All contract ABIs are available in our GitHub repository:
Development Setup
Prerequisites
Node.js 18+
Foundry
Git
Installation
Testing
Deployment
Event Reference
Factory Events
Token Events
Gas Optimization
Typical Gas Costs
Token Creation: ~150,000 gas
Token Purchase: ~80,000 gas
Token Sale: ~75,000 gas
Add Liquidity: ~120,000 gas
Optimization Tips
Batch operations when possible
Use appropriate gas limits
Monitor Base network congestion
For more technical details, see our Integration Guide or check the Contract Addresses page.
Last updated
