Decentralized Token Launch and Trading Infrastructure
Overview • Features • Architecture • Installation • Usage • Testing • Contributing
Four.Meme is a comprehensive smart contract suite for decentralized token creation, fair launches, and liquidity management. Built with security and transparency as core principles, this repository provides production-ready contracts for launching community-driven tokens without pre-sales or venture capital involvement.
The protocol enables developers and communities to:
- Deploy tokens with configurable parameters through an automated factory
- Conduct fair launches with transparent distribution mechanisms
- Establish decentralized liquidity pools for token trading
- Implement vesting schedules for long-term token holder incentives
- Manage token sales with built-in safety features
-
Fair Launch Protocol: Community-driven token launches without preferential allocation. No pre-sales, no venture capital rounds—just transparent, equitable distribution.
-
Decentralized Liquidity Pools: Automated market maker (AMM) integration enabling seamless token swaps and liquidity provision with minimal slippage.
-
Token Factory: Streamlined token deployment system with standardized interfaces and configurable tokenomics parameters.
-
Vesting Mechanisms: Time-locked token distribution contracts supporting multiple vesting schedules for team allocations, advisor compensation, and community rewards.
-
Sale Management: Robust sale handling contracts with configurable caps, whitelisting, and automated distribution.
- Solidity Version: ^0.8.0
- Security Framework: OpenZeppelin-based implementations
- Testing Coverage: Comprehensive unit and integration tests
- Gas Optimization: Efficient contract design minimizing transaction costs
- Upgradeability: Modular architecture supporting future enhancements
contracts/
├── core/
│ ├── FairLaunch.sol # Fair launch mechanism implementation
│ ├── LiquidityPool.sol # AMM liquidity pool management
│ ├── TokenFactory.sol # Token deployment factory
│ ├── SaleHandler.sol # Token sale coordination
│ └── TestVesting.sol # Vesting schedule management
├── interfaces/
│ ├── IFairLaunch.sol
│ ├── IFourMemeToken.sol
│ ├── ILiquidityPool.sol
│ ├── ITokenFactory.sol
│ └── IVesting.sol
├── utils/
│ ├── Ownable.sol # Access control utilities
│ └── SafeMath.sol # Safe arithmetic operations
└── mocks/
├── MockERC20.sol # Testing utilities
└── MockLiquidityProvider.sol
- Token Creation:
TokenFactorydeploys ERC-20 compliant tokens with custom parameters - Fair Launch:
FairLaunchcontract manages initial distribution and price discovery - Liquidity Management:
LiquidityPoolprovides automated trading infrastructure - Token Vesting:
TestVestinghandles time-locked token releases - Sale Coordination:
SaleHandlerorchestrates token sales with configurable parameters
- Node.js >= 16.0.0
- Yarn or npm package manager
- Foundry or Hardhat development environment
- Solidity compiler ^0.8.0
# Clone the repository
git clone https://github.com/frogansol/four.meme-forking-smart-contract
cd four.meme-forking-smart-contract
# Install dependencies
yarn install
# Compile contracts
yarn compile
# Run test suite
yarn test// Example: Deploy a new token using TokenFactory
ITokenFactory factory = ITokenFactory(FACTORY_ADDRESS);
address newToken = factory.createToken(
"MyToken",
"MTK",
1000000 * 10**18,
msg.sender
);// Configure and start a fair launch
IFairLaunch fairLaunch = IFairLaunch(FAIRLAUNCH_ADDRESS);
fairLaunch.initializeLaunch(
tokenAddress,
startTime,
endTime,
softCap,
hardCap
);Pre-configured deployment scripts are available in the script/ directory:
# Deploy all core contracts
node script/test/deploy.js
# Deploy FairLaunch only
node script/test/deployFairLaunch.js
# Deploy LiquidityPool only
node script/test/deployLiquidityPool.jsThe repository includes comprehensive test coverage for all core functionality:
# Run all tests
yarn test
# Run specific test file
yarn test test/fourtoken.test.sol
# Generate coverage report
yarn coverageSecurity is paramount in the Four.Meme ecosystem. Our contracts follow industry best practices:
- OpenZeppelin library integration for battle-tested implementations
- Comprehensive unit and integration testing
- Access control mechanisms on privileged functions
- Reentrancy guards on state-changing operations
- Input validation and bounds checking
Security Audit Status: Pending external audit. Use at your own risk in production environments.
If you discover a security vulnerability, please email security@four.meme. Do not open public issues for security concerns.
We welcome contributions from the community. Whether you're fixing bugs, improving documentation, or proposing new features, your input is valuable.
- Fork the Repository: Create a fork of the project to your GitHub account
- Create a Feature Branch:
git checkout -b feature/your-feature-name - Make Your Changes: Implement your feature or bug fix
- Write Tests: Ensure your changes are covered by appropriate tests
- Run Test Suite: Verify all tests pass before submitting
- Commit Your Changes: Use clear, descriptive commit messages
- Push to Your Fork:
git push origin feature/your-feature-name - Submit a Pull Request: Open a PR with a comprehensive description of your changes
- Follow Solidity style guide and best practices
- Include natspec comments for all public functions
- Maintain gas efficiency in contract implementations
- Add unit tests for new functionality
- Update documentation to reflect changes
When reporting bugs, please include:
- Environment Details: Solidity version, network, development framework
- Reproduction Steps: Clear steps to reproduce the issue
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Relevant Logs: Error messages, transaction hashes, or stack traces
For feature proposals, provide:
- Use Case: Describe the problem your feature would solve
- Proposed Solution: Outline your suggested implementation
- Alternatives Considered: Other approaches you've evaluated
- Additional Context: Any relevant information or examples
This project is licensed under the MIT License. You are free to use, modify, and distribute this software in accordance with the license terms.
See LICENSE for complete license information.
Built with precision for the decentralized future.
Four.Meme - Empowering Community-Driven Token Launches