Skip to content

btb-finance/VeloLiquidLocker

Repository files navigation

VeloLiquidLocker

A liquid staking solution for VELO tokens with NFT representation, enabling users to maintain liquidity while participating in Velodrome's governance and earning rewards.

Overview

VeloLiquidLocker is a smart contract system that allows users to:

  • Stake VELO tokens and receive NFTs representing their stake
  • Participate in Velodrome governance through voting
  • Earn rewards from pool fees and bribes
  • Maintain liquidity through NFT transferability

Architecture

Core Contract

The VeloLiquidLocker contract implements:

  • ERC721 standard for NFT representation
  • Integration with Velodrome's VotingEscrow and Voter contracts
  • Staking and unstaking mechanisms
  • Vote delegation system
  • Reward distribution logic

Key Features

  1. Staking Mechanism

    • Users stake VELO tokens and receive NFTs
    • 4-year lock period (matching Velodrome's maximum lock duration)
    • NFTs are transferable, enabling secondary market liquidity
  2. Voting System

    • NFT holders can vote on multiple pools
    • Voting power is proportional to locked amount and time
    • Vote delegation through NFT transfers
  3. Reward Distribution

    • Automatic tracking of rewards per vote
    • Proportional distribution based on voting power
    • Claim mechanism for collecting rewards
    • 20% fee on bribes (BRIBE_FEE_PERCENTAGE)

Usage

Staking VELO

// Approve VELO tokens first
veloToken.approve(veloLiquidLocker, amount);

// Stake tokens and receive NFT
uint256 tokenId = veloLiquidLocker.stake(amount);

Voting on Pools

// Vote with NFT on multiple pools
address[] memory pools = new address[](2);
pools[0] = pool1Address;
pools[1] = pool2Address;

uint256[] memory amounts = new uint256[](2);
amounts[0] = amount1;
amounts[1] = amount2;

veloLiquidLocker.vote(tokenId, pools, amounts);

Claiming Rewards

// Claim rewards from specific pools
address[] memory rewardPools = new address[](1);
rewardPools[0] = poolAddress;

veloLiquidLocker.claimRewards(tokenId, rewardPools);

Unstaking

// Unstake after lock period ends
veloLiquidLocker.unstake(tokenId);

Security Features

  • Reentrancy protection using OpenZeppelin's ReentrancyGuard
  • Access control through Ownable pattern
  • Safe token transfer handling
  • Comprehensive input validation

Contract Addresses

Optimism:

  • VeloLiquidLocker: [Contract Address TBD]
  • VELO Token: [Velodrome Token Address]
  • VotingEscrow: [Velodrome VotingEscrow Address]
  • Voter: [Velodrome Voter Address]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published