Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Meme-Empire/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tests/** linguist-vendored
vitest.config.js linguist-vendored
* text=lf
13 changes: 13 additions & 0 deletions Meme-Empire/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

**/settings/Mainnet.toml
**/settings/Testnet.toml
.cache/**
history.txt

logs
*.log
npm-debug.log*
coverage
*.info
costs-reports.json
node_modules
4 changes: 4 additions & 0 deletions Meme-Empire/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

{
"files.eol": "\n"
}
19 changes: 19 additions & 0 deletions Meme-Empire/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

{
"version": "2.0.0",
"tasks": [
{
"label": "check contracts",
"group": "test",
"type": "shell",
"command": "clarinet check"
},
{
"type": "npm",
"script": "test",
"group": "test",
"problemMatcher": [],
"label": "npm test"
}
]
}
23 changes: 23 additions & 0 deletions Meme-Empire/Clarinet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[project]
name = 'Meme-Empire'
description = ''
authors = []
telemetry = true
cache_dir = './.cache'
requirements = []
[contracts.Stacks-Meme]
path = 'contracts/Stacks-Meme.clar'
clarity_version = 3
epoch = 3.1
[repl.analysis]
passes = ['check_checker']

[repl.analysis.check_checker]
strict = false
trusted_sender = false
trusted_caller = false
callee_filter = false

[repl.remote_data]
enabled = false
api_url = 'https://api.hiro.so'
203 changes: 203 additions & 0 deletions Meme-Empire/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
# MemeCoin Empire

A comprehensive community-driven memecoin platform built on the Stacks blockchain, featuring gamified interactions, meme battles, and a reputation-based reward system.

## Features

### Core Token Functionality
- **SIP-010 Compliant**: Fully compliant with the Stacks Improvement Proposal 010 fungible token standard
- **Secure Transfers**: Multi-layer validation for all token transfers
- **Mint & Burn**: Administrative controls for token supply management
- **Metadata Support**: Extensible token metadata system

### Community Features
- **Meme Collections**: Users can create and manage personal meme collections (up to 10 memes per user)
- **Tipping System**: Reward excellent meme creators with tokens
- **Battle System**: Engage in gamified meme battles with other users
- **Reputation System**: Earn "meme power" through community participation
- **Verified Creators**: Special status for recognized meme creators

### Administrative Controls
- **Pause/Unpause**: Emergency controls for contract operations
- **Minting Toggle**: Enable/disable new token creation
- **Airdrop Functionality**: Mass distribution for community building
- **Supply Management**: Maximum supply caps and circulation tracking

## Token Details

| Property | Value |
|----------|-------|
| **Name** | MemeCoin Empire |
| **Symbol** | MEME |
| **Decimals** | 6 |
| **Max Supply** | 1,000,000,000 MEME |
| **Max Memes per User** | 10 |
| **Meme Character Limit** | 280 characters |

## Gamification Elements

### Meme Power System
- **Base Creation Reward**: 10 power points per meme
- **Tip Sender Bonus**: 5 power points for tipping
- **Tip Recipient Bonus**: 15 power points for receiving tips
- **Battle Victory Reward**: 25 power points for winning battles
- **Token Transfer Bonus**: 1 power point per 1000 tokens received

### Battle System
- Battles are determined by meme power + pseudo-randomness
- Winners receive the wager amount from losers
- Battle statistics are tracked for each user
- Victory grants additional meme power

## Getting Started

### Prerequisites
- [Clarinet](https://github.com/hirosystems/clarinet) - Stacks smart contract development tool
- [Node.js](https://nodejs.org/) - For running tests
- [Stacks Wallet](https://www.hiro.so/wallet) - For interacting with the contract

### Installation

1. **Clone the repository**
```bash
git clone <repository-url>
cd memecoin-empire
```

2. **Install dependencies**
```bash
npm install
```

3. **Check contract syntax**
```bash
clarinet check
```

4. **Run tests**
```bash
npm test
```

### Deployment

1. **Deploy to testnet**
```bash
clarinet integrate
```

2. **Deploy to mainnet**
```bash
clarinet deploy --network mainnet
```

## Contract Functions

### Public Functions

#### Token Operations
- `transfer(amount, sender, recipient, memo)` - Transfer tokens between accounts
- `mint-tokens-to-address(amount, recipient)` - Mint new tokens (admin only)
- `burn-user-tokens(amount)` - Burn tokens from user's balance

#### Meme Functions
- `submit-meme-to-collection(content)` - Add meme to personal collection
- `tip-meme-creator(creator, amount, meme)` - Tip a meme creator
- `initiate-meme-battle(opponent, wager)` - Start a meme battle

#### Administrative Functions
- `initialize-memecoin-empire(allocation)` - Initialize contract with founder allocation
- `update-token-metadata-uri(uri)` - Update token metadata
- `toggle-minting-functionality()` - Enable/disable minting
- `toggle-contract-operations-pause()` - Pause/unpause contract
- `execute-community-airdrop(recipients, amount)` - Mass token distribution

### Read-Only Functions

#### Token Information
- `get-name()` - Returns token name
- `get-symbol()` - Returns token symbol
- `get-decimals()` - Returns decimal precision
- `get-balance(address)` - Returns user's token balance
- `get-total-supply()` - Returns total token supply
- `get-token-uri()` - Returns metadata URI

#### User Information
- `get-user-meme-collection(address)` - Returns user's meme collection
- `get-user-meme-power(address)` - Returns user's meme power level
- `is-verified-meme-creator(address)` - Checks creator verification status
- `get-battle-statistics(address)` - Returns user's battle stats

#### Contract Status
- `is-contract-paused()` - Returns pause status
- `is-minting-enabled()` - Returns minting status
- `get-contract-administrator()` - Returns admin address
- `get-complete-token-information()` - Returns comprehensive contract info

## Security Features

### Access Control
- Administrator-only functions protected by sender validation
- Self-interaction prevention for transfers and battles
- Comprehensive input validation on all functions

### Economic Security
- Maximum supply enforcement
- Balance validation before transfers
- Wager validation for battles
- Minting controls with emergency pause

### Error Handling
- Comprehensive error codes for different failure scenarios
- Graceful failure handling with descriptive error messages
- Transaction rollback on validation failures

## Use Cases

### For Users
- **Meme Creators**: Earn tokens and reputation by creating quality memes
- **Community Members**: Participate in battles, tip creators, build collections
- **Collectors**: Curate personal meme collections and build reputation
- **Traders**: Transfer and trade tokens with other community members

### For Administrators
- **Community Building**: Use airdrops to grow the user base
- **Economic Management**: Control token supply and circulation
- **Emergency Response**: Pause operations if needed
- **Metadata Management**: Update token information as needed

### Tokenomics

### Token Distribution
- **Founder Allocation**: Set during contract initialization
- **Community Rewards**: Distributed through meme creation and battles
- **Airdrops**: Mass distribution for community growth
- **Tipping Economy**: Peer-to-peer rewards for quality content

### Reward Structure
- **Content Creation**: Rewards for submitting memes
- **Community Engagement**: Bonuses for tipping and participating
- **Competitive Gaming**: Battle rewards based on skill and luck
- **Token Holding**: Meme power bonuses for token accumulation

## Development

### Contract Structure
```
contracts/
├── Stacks-Meme.clar # Main contract file
tests/
├── memecoin-empire.test.ts # Test suite
├── helpers/ # Test utilities
settings/
├── Clarinet.toml # Project configuration
├── Devnet.toml # Development network settings
```

### Testing
The contract includes comprehensive test coverage for:
- Token transfer functionality
- Meme creation and management
- Battle system mechanics
- Administrative functions
- Error handling scenarios
Loading