Solidity based MemeToken Contract with advanced control functionalities
Opening sourcing my memetoken contract today.
Github: https://github.com/intotheorigin/meme-runway
π Features Overview
Core Token Implementation
- ERC20/BEP20 compliant token standard
- Configurable name, symbol, and total supply
- Decimal precision: 18
- Ownership and access control implementation
- Pausable functionality for emergency situations
π° Advanced Tokenomics
Transaction Fee System
- Configurable fee percentages
- Multi-destination fee distribution
- Liquidity generation: 2%
- Holder rewards: 2%
- Marketing/Development: 2%
- Burn mechanism: 1%
- Fee exclusion list for privileged addresses
Reflection System
- Real-time holder rewards distribution
- Automatic reflection calculation
- Configurable reflection rate
- Excluded addresses list (DEX pairs, contracts)
Anti-Whale Measures
- Maximum transaction amount (1% of total supply)
- Maximum wallet holdings (2% of total supply)
- Progressive tax rates for large transactions
- Standard tax: 7%
- Large trades (>0.5% supply): +3% tax
- Whale trades (>1% supply): +5% tax
π Security Features
Trading Protection
- Configurable trading activation delay
- Transaction cooldown period (30 minutes default)
- Blacklist system for suspicious addresses
- Emergency pause functionality
- Multi-signature requirement for critical functions
Liquidity Management
- Automatic liquidity generation
- Time-locked liquidity (6 months minimum)
- Minimum liquidity threshold enforcement
- Anti-dump mechanisms
π Trading Controls
Limits and Restrictions
maxTransactionAmount = totalSupply * 1 / 100; // 1% max transaction
maxWalletSize = totalSupply * 2 / 100; // 2% max wallet
cooldownTime = 30 minutes; // Time between trades
Blacklist/Whitelist System
- Admin controlled address restrictions
- Automated suspicious activity detection
- Fee exemption whitelist
- Contract interaction blacklist
π¦ Treasury Management
Marketing Wallet
- Multi-signature requirement (3/5)
- Daily spending limits (0.1% of supply)
- Transparent transaction logging
- Community proposal system
Development Fund
- Time-locked vesting schedule
- Milestone-based releases
- Public development roadmap
- Quarterly audit requirements
π Smart Contract Interface
Core Functions
function transfer(address recipient, uint256 amount) external returns (bool)
function approve(address spender, uint256 amount) external returns (bool)
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool)
Admin Functions
function setFees(uint256 liquidityFee, uint256 reflectionFee, uint256 marketingFee) external onlyOwner
function excludeFromFees(address account) external onlyOwner
function setMaxTxAmount(uint256 amount) external onlyOwner
function setMaxWalletSize(uint256 amount) external onlyOwner
function setTradingEnabled(bool enabled) external onlyOwner
View Functions
function isExcludedFromFees(address account) external view returns (bool)
function getTotalFees() external view returns (uint256)
function getHolderRewards(address holder) external view returns (uint256)
π Setup and Deployment
Prerequisites
- Node.js v14+
- Hardhat
- OpenZeppelin Contracts
Installation
npm install
cp .env.example .env
# Edit .env with your configuration
npm run compile
Deployment
npm run deploy:testnet # For testnet deployment
npm run deploy:mainnet # For mainnet deployment
Configuration
- Set token parameters in
config/token.config.js
- Configure network settings in
hardhat.config.js
- Set initial holders in
scripts/deploy.js
π Security Considerations
Audited Components
- Base token implementation
- Fee distribution system
- Reflection mechanism
- Trading restrictions
Best Practices
- Use SafeMath for all calculations
- Implement checks-effects-interactions pattern
- Include emergency pause functionality
- Comprehensive event logging
- Rate limiting for sensitive functions
Known Limitations
- Gas costs may be high during high network congestion
- Reflection calculations may be expensive for large holder counts
- DEX interactions may fail during extreme volatility
π Testing
# Run all tests
npm run test
# Run specific test suite
npm run test:tokenomics
npm run test:security
npm run test:trading
β οΈ Disclaimer
This implementation is provided as-is. Users should conduct thorough testing and auditing before deployment. Cryptocurrency investments carry high risk.