Skip to content

Technical Overview

For those interested in how Levr works under the hood.

Core Contracts

  • LevrFactory_v1 - Deploys all contracts for each project
  • LevrTreasury_v1 - Holds community funds (no owner, governor-controlled)
  • LevrGovernor_v1 - Manages proposals, voting, and execution
  • LevrStaking_v1 - Handles staking, rewards, and time tracking
  • LevrStakedToken_v1 - 1:1 receipt token for staked amount

Architecture

LevrFactory_v1
  ↓ prepareForDeployment() → Get addresses
  ↓ register(clankerToken) → Deploy all contracts
    ├─ Treasury: Community funds
    ├─ Governor: Proposals & voting
    ├─ Staking: Tokens & rewards
    └─ StakedToken: Receipt token

Deployment Flow

  1. Deploy the ERC2771 forwarder (for gasless transactions)
  2. Deploy LevrFactory_v1 with the forwarder address
  3. Call prepareForDeployment() to get treasury and staking addresses
  4. Deploy your Clanker token with:
    • Treasury as airdrop recipient (receives token allocation)
    • Staking as LP fee recipient (receives trading fees)
  5. Call register() as token admin to deploy governor and stakedToken

Security Features

  • Reentrancy guards on all external functions
  • Role-based access control across all contracts
  • No treasury owner - only governor can control
  • Reserve tracking prevents reward overdraw
  • Anti-gaming mechanisms for voting

Governance System

Time-Weighted Voting:

  • VP = Staked balance × Time staked
  • Real-time VP calculation (no snapshots)
  • Partial unstaking reduces time proportionally
  • Full unstaking resets timer to zero
  • Natural protection against late-staking attacks

Dual Thresholds:

  • Quorum: 70% participation (by balance)
  • Approval: 51% support (by VP)

Cycle-Based:

  • Manual start by factory owner
  • Proposal window (e.g., 2 days)
  • Voting window (e.g., 5 days)
  • One winner per cycle

Staking & Rewards

Staking:

  • Protocol fee on stake/unstake
  • Receive 1:1 StakedToken
  • Earn voting power over time

Rewards:

  • Manual accrual system
  • Multi-token support
  • ClankerFeeLocker integration
  • Proportional distribution

Optional Meta-Transaction Support

All user-facing contracts support ERC2771 meta-transactions via LevrForwarder_v1:

  • Users can sign messages off-chain
  • Relayers can execute transactions on-chain
  • Optional gasless experience when relayers are available
  • Standard transactions always work