"์ค๋ช ์ ๋ ์๋ฏธ ์๋ค. ์ต๋ช ์ฑ์ ์งํค๋ฉด์ โ ์คํ ์ดํน์ด ์ง์ง ์ฑ ์์ ๋ง๋ ๋ค."
Monaddit is a Reddit-style on-chain community platform built on Monad L1 testnet, where economic incentives ensure responsible content creation. Users stake MDT tokens (ERC-20) to post content, and malicious behavior results in slashing through community-driven moderation games. Gas fees are paid in Monad native coin, while staking, bonds, and rewards use MDT tokens.
Key Innovation: Hybrid on-chain/off-chain architecture where content text is stored in PostgreSQL for efficiency, while content hashes are anchored on-chain for integrity and economic accountability.
- ๐ Stake-based Posting: Deposit MDT tokens (ERC-20) to create posts and comments
- โ๏ธ Optimistic Moderation: Content publishes immediately with 7-day challenge window
- ๐ฒ Jury System: Commit-reveal voting by randomly selected staked moderators
- ๐ Reputation SBTs: Non-transferable tokens tracking karma and dispute history
- ๐ธ Slashing Mechanism: Economic penalties distributed 40/30/20/10 (challenger/jury/stakers/burn)
- ๐ Staking Rewards: Good users earn weekly rewards from 20% of slashing penalties
- ๐ Bond Lifecycle: Withdraw bonds after 7 days if unchallenged
- Smart Contracts: Foundry (Solidity ^0.8.x)
- Frontend: Scaffold-ETH 2, Next.js 15, TypeScript, React 19
- Backend: Rust with Axum web framework
- Database: PostgreSQL (content storage), Redis (queues/caching)
- Web3: Wagmi v2, Viem, RainbowKit, Alloy-rs (backend)
- Blockchain: Monad Testnet (EVM-compatible)
- Styling: Tailwind CSS, DaisyUI/shadcn-ui
- State Management: Zustand
- Storage Strategy:
- Content text โ PostgreSQL (off-chain)
- Content hash โ Blockchain (on-chain anchoring)
- Evidence/snapshots โ IPFS (optional)
| Contract | Address |
|---|---|
| MdtToken | 0x5DBEed591792cB042e7DBA157f99f2e14FFF2ab0 |
| StakingVault | 0x7fC178D288a2de094926b07A443ebE35f42038C7 |
| ContentRegistry | 0x3F6Fd0C3995B6fb6c0563E65bf9f44a754261FF5 |
| ModerationGame | 0xF6876ddc90AFE7753B23398cE104C2592dDeA997 |
| ReputationSBT | 0x6b7a5C5De9d65617fC42E2A46B1b5A2E65c82184 |
| StakingRewards | 0xB1f4B9D360d87A07733B0ea1f4bd0083bcC97Df2 |
| Treasury | 0x8d066C45178B35b2E85272de3892AC6EF4Af1722 |
Network Details:
- Chain: Monad Testnet
- Chain ID: 10143
- RPC URL: https://testnet-rpc.monad.xyz
Before you begin, ensure you have:
- Node.js (>= v20.18.3)
- Yarn
- Git
- Foundry
- Rust (for backend)
- PostgreSQL
- Redis
- Monad testnet RPC access
- Monad native coins from faucet (for gas)
- tMDT tokens (testnet MDT) obtained via MdtToken contract
git clone https://github.com/pdao-monad-blitz-seoul/monaddit.git
cd monaddit
yarn installConfigure Monad testnet in your environment files:
packages/foundry/.env:
MONAD_RPC_URL=https://testnet-rpc.monad.xyz
MONAD_CHAIN_ID=10143
PRIVATE_KEY=your_deployment_keypackages/nextjs/.env.local:
NEXT_PUBLIC_MONAD_RPC_URL=https://testnet-rpc.monad.xyz
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_project_id
NEXT_PUBLIC_BACKEND_URL=http://localhost:8787packages/backend/.env:
DATABASE_URL=postgres://user:pass@localhost:5432/monaddit
REDIS_URL=redis://localhost:6379
MONAD_RPC_URL=https://testnet-rpc.monad.xyz
BACKEND_PORT=8787# Terminal 1: Start local Anvil chain (for testing)
yarn chain
# Terminal 2: Deploy contracts
yarn deploy
# Terminal 3: Start backend services
cd packages/backend
cargo run
# Terminal 4: Start frontend
yarn startVisit http://localhost:3000 to see the app.
# Deploy to Monad testnet
yarn deploy --network monad
# Verify contracts
yarn verify --network monad-
MdtToken.sol
- ERC-20 token with permit functionality (symbol: MDT)
- Testnet token (tMDT) for development
- Mint/burn functions for demo phase
- Optional: votes extension for governance
-
StakingVault.sol
- Manages user stakes and bonds (in MDT tokens)
- Handles slashing operations
- Enforces minimum stake requirements (10 tMDT)
- Tracks stake age for eligibility
-
ContentRegistry.sol
- Records content hash and URI (not full text)
- Manages challenge lifecycle with 7-day window
- Tracks content status (published/disputed/resolved)
- Enables bond withdrawal after challenge period
-
ModerationGame.sol
- Implements commit-reveal voting mechanism
- Random jury selection from staked moderators
- Executes verdict with reward/slashing distribution
- Anti-griefing measures (14-day max lock, 5-day rechallenge cooldown)
-
ReputationSBT.sol
- Non-transferable reputation tokens
- Tracks karma, dispute rate, win/loss ratio
- Influences voting weight and slashing caps
- Determines staking reward eligibility
-
StakingRewards.sol
- Accumulates 20% of slashing penalties
- Weekly epoch distribution to eligible stakers
- Eligibility: min stake, age, no recent violations
- Distribution proportional to stake ร reputation
-
Treasury.sol
- Manages community funds and governance
- Handles bounty payments
| Parameter | Value (Testnet) | Description |
|---|---|---|
| Minimum Stake | 10 tMDT | Required to participate |
| Content Bond | 0.1 tMDT | Locked per post/comment, withdrawable after 7 days |
| Challenge Bond | 0.2 tMDT | Required to initiate dispute |
| Challenge Window | 7 days | Period for challenging content |
| Max Slashing | 20% | Per incident cap |
| Distribution | 40/30/20/10 | Challenger/Jury/StakingRewards/Burn |
| Reward Epoch | 7 days | Weekly staking rewards distribution |
| Max Lock Period | 14 days | Auto-acquittal if exceeded |
| Rechallenge Cooldown | 5 days | Prevents spam on same content |
| Acquittal Cooldown | 48 hours | Optional withdrawal delay |
- Join: Connect wallet โ Get tMDT from faucet/mint โ Stake 10 tMDT โ Receive reputation SBT
- Post: Create content โ Backend stores text โ 0.1 tMDT bond locks โ Hash published on-chain
- Interact: Upvote/downvote, comment, or challenge content
- Challenge: Submit evidence โ Auto-score from backend โ Jury commit-reveal vote
- Resolution:
- If guilty: Bond slashed โ 40% challenger, 30% jury, 20% staking pool, 10% burn
- If innocent: Challenge bond slashed โ Content creator compensated
- Bond Withdrawal: After 7 days without challenges โ Withdraw bond
- Staking Rewards: Weekly distribution to eligible stakers from penalty pool
# Run all tests
yarn test
# Run with gas reporting
forge test --gas-report
# Run specific test
forge test --match-test testStaking -vvvmonaddit/
โโโ packages/
โ โโโ foundry/ # Smart contracts
โ โ โโโ contracts/ # Solidity contracts
โ โ โโโ script/ # Deployment scripts
โ โ โโโ test/ # Contract tests
โ โ โโโ foundry.toml # Foundry config
โ โโโ nextjs/ # Frontend
โ โ โโโ app/ # Next.js app router
โ โ โโโ components/ # React components
โ โ โโโ hooks/ # Custom hooks
โ โ โโโ utils/ # Utilities
โ โโโ backend/ # Rust backend
โ โโโ src/
โ โ โโโ api/ # HTTP endpoints
โ โ โโโ workers/ # Background tasks
โ โ โโโ db/ # Database models
โ โ โโโ chain/ # Alloy-rs bindings
โ โโโ migrations/ # SQL migrations
โ โโโ Cargo.toml # Rust dependencies
โโโ README.md
โโโ CLAUDE.md # AI assistant context
โโโ package.json # Monorepo config
- Off-chain (PostgreSQL): Full content text, metadata, user interactions
- On-chain (Blockchain): Content hash (keccak256), URI, bonds, status
- Benefits: Gas efficiency, scalability, content integrity
- User writes content in frontend
- Frontend sends text to backend
/api/content - Backend stores in PostgreSQL, returns hash
- Frontend publishes hash to
ContentRegistrycontract - Backend listener updates content status from chain events
- Commit-Reveal Voting: Prevents vote manipulation and front-running
- Randomized Juries: Reduces collusion risk through random selection
- Merkle Proofs: Efficient and tamper-proof evidence verification
- Time Locks: 7-day challenge window, 14-day max lock for anti-griefing
- Stake Age: Sybil resistance through minimum 7-day stake age requirement
- Content Integrity: Off-chain storage with on-chain hash anchoring
- Economic Security: Slashing mechanisms create real economic consequences
- Token Separation: Gas fees in Monad native coin, staking/rewards in MDT token
- โ Scaffold-ETH 2 setup with Monad testnet
- โฌ Core smart contracts (MdtToken, StakingVault, ContentRegistry, ModerationGame)
- โฌ Rust backend with PostgreSQL integration
- โฌ Basic frontend with wallet connection
- โฌ Jury commit-reveal mechanism
- โฌ StakingRewards contract with weekly epochs
- โฌ ReputationSBT implementation
- โฌ Backend workers for chain events
- โฌ Frontend bond withdrawal UI
- โฌ Auto-scoring integration (ML model)
- โฌ Gas optimization
- โฌ Demo scenario implementation
- โฌ Testnet deployment
- VRF for truly random jury selection
- Policy pack marketplace
- Mobile app
- Cross-chain support
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see LICENSE file for details.
- Built with Scaffold-ETH 2
- Powered by Monad
- Inspired by decentralized governance experiments