This project is the frontend implementation for Slice, a Real-Time Dispute Resolution Protocol built on Next.js. It features a multi-tenant architecture capable of running as a standalone PWA or as an embedded MiniApp across various wallet ecosystems (Base, Beexo).
π Live Demo: Testnet | Mainnet
Slice is a decentralized, real-time dispute resolution protocol. It acts as a neutral truth oracle that resolves disputes quickly and trustlessly through randomly selected jurors and economic incentives.
We are building the "Uber for Justice":
- Decentralized & Trustless: No central authority controls the outcome.
- Fast & Scalable: Designed for real-time applications, offering quick rulings compared to traditional courts.
- Gamified Justice: Jurors enter the Dispute Resolution Market via an intuitive and entertaining App/MiniApp.
- Earn by Ruling: Users stake tokens to become jurors and earn money by correctly reviewing evidence and voting on disputes.
This application uses a Strategy Pattern to manage wallet connections and SDK interactions. Instead of a single monolithic connection logic, we use an abstraction layer that selects the appropriate Adapter based on the runtime environment (detected via subdomains and SDK presence).
We support two active connection strategies (with Lemon planned):
| Strategy | Description | Used By |
|---|---|---|
| Wagmi SW | Uses Smart Wallets (Coinbase/Safe) via Privy & Wagmi. | PWA, Base |
| Wagmi EOA | Uses standard Injected (EOA) connectors. | Beexo |
| (Planned) Lemon SDK | Native @lemoncash/mini-app-sdk. |
Lemon |
The application behaves differently depending on the access point (Subdomain) and injected providers.
| Platform | Subdomain | Connection Strategy | Auth Type |
|---|---|---|---|
| Standard PWA | app. |
Wagmi SW | Social / Email / Passkey π / Wallet |
| Base MiniApp | base. |
Wagmi SW | Coinbase Smart Wallet |
| Beexo | beexo. |
Wagmi EOA | Injected Provider (Beexo) |
| Lemon (planned) | lemon. |
Lemon SDK | Native Lemon Auth |
Experience the future of decentralized justice on Base:
- Testnet Demo: dev.slicehub.xyz β (Base Sepolia)
- Mainnet App: app.slicehub.xyz β (Base)
- Enter the Market: Users open the Slice App or MiniApp and stake USDC to join the juror pool.
- Get Drafted: When a dispute arises, jurors are randomly selected (Drafted) to review the case.
- Review & Vote: Jurors analyze the evidence provided by both parties and vote privately on the outcome.
- Earn Rewards: If their vote aligns with the majority consensus, they earn fees from the losing party.
- Justice Served: The protocol aggregates the votes and executes the ruling on-chain instantly.
Integrating Slice into your protocol is as simple as 1-2-3:
Call slice.createDispute(defender, category, ipfsHash, jurorsRequired) from your contract.
Slice handles the juror selection, voting, and consensus off-chain and on-chain.
Once the dispute status is Executed, read the winner address from the disputes mapping and execute your logic.
| Network | Slice Core | USDC Token |
|---|---|---|
| Base Sepolia | 0xD8A10bD25e0E5dAD717372fA0C66d3a59a425e4D |
0x5dEaC602762362FE5f135FA5904351916053cF70 |
| Base Mainnet | 0xD8A10bD25e0E5dAD717372fA0C66d3a59a425e4D |
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
Rename .env.example to .env.local and add your keys.
NEXT_PUBLIC_APP_ENV="development" # or 'production'
# Pinata / IPFS Config
# https://app.pinata.cloud/
NEXT_PUBLIC_PINATA_JWT="your_pinata_jwt"
NEXT_PUBLIC_PINATA_GATEWAY_URL="your_gateway_url"
# Privy Config (For PWA/Base/Farcaster)
# https://dashboard.privy.io/
NEXT_PUBLIC_PRIVY_APP_ID="your_privy_app_id"
NEXT_PUBLIC_PRIVY_CLIENT_ID="your_privy_client_id"
# Supabase Auth (For Passkeys & Email Auth) π
# https://supabase.com/dashboard/project/_/settings/api
NEXT_PUBLIC_SUPABASE_URL="https://your-project.supabase.co"
NEXT_PUBLIC_SUPABASE_ANON_KEY="your_anon_key"
SUPABASE_SERVICE_ROLE_KEY="your_service_role_key" # β οΈ NEVER expose to client
# Contracts
NEXT_PUBLIC_BASE_SLICE_CONTRACT="0x..."
NEXT_PUBLIC_BASE_USDC_CONTRACT="0x..."pnpm installpnpm run dev- Set up Supabase (for Passkey Auth): π
# Apply database migration
# Option 1: Via Supabase Dashboard
# - Copy contents of supabase/migrations/001_create_user_passkeys.sql
# - Paste in SQL Editor and execute
# Option 2: Via Supabase CLI
supabase db push- PWA Mode: Open
http://localhost:3000 - Miniapp Mode: Use the native testing environment given by the Miniapp SDK.
This app supports multiple authentication methods:
- Email/Password - Traditional authentication
- Magic Link - Passwordless email authentication
- Passkey π - Biometric authentication (Touch ID, Face ID, Windows Hello)
- Social Login - via Privy (Google, Twitter, etc.)
- π Passkey Implementation: See
docs/PASSKEY_IMPLEMENTATION.md - π Testing Guide: See
docs/PASSKEY_TESTING.md - π Known Issues: See
docs/BUGS_AND_EDGE_CASES.md
The src/config/ and src/adapters/ directories manage the multi-environment logic.
We abstract wallet interactions behind a common interface:
useWalletAdapterβ Selects the active strategy based on environment.WagmiAdapterβ Wraps Wagmi hooks (Smart Wallets or EOA).- (Planned)
LemonAdapterβ Will wrap@lemoncash/mini-app-sdk.
- Exports
SUPPORTED_CHAINSmapping WagmiChainobjects to contract addresses. - Defaults based on
NEXT_PUBLIC_APP_ENV.
The contracts/ directory contains the Solidity smart contracts using Hardhat and Viem.
pnpm hardhat compile
pnpm hardhat test
pnpm hardhat run scripts/deploy.ts --network baseSepolia- Phase 1 β Foundation (Core Protocol, Web UI)
- Phase 2 β Architecture Overhaul (Strategy Pattern, Multi-Tenant SDKs)
- Phase 3 β MiniApp Expansion (Live integration with Lemon, Beexo)
- Phase 4 β Slice V1.2 High-Stakes Lottery (Global Passive Staking)
- Phase 5 β Specialized Courts & DAO Governance