Skip to content

0xFantomMenace/Multi-Chain-LGE

Repository files navigation

Multi-Chain LGE

Smart contracts for Liquidity Generation Events (LGE) supporting multiple DEX architectures across different EVM chains.

Overview

This project implements token launch mechanics through LGE contracts that:

  • Accept contributions in various tokens (auto-swapped to USDC)
  • Provide vesting premiums for longer lock periods
  • Support NFT-based bonus multipliers
  • Handle multi-chain deployments with chain-specific DEX integrations

Contracts

Core LGE Contracts

Contract Description
GrainLGEUniV2.sol LGE for chains with Uniswap V2-style DEXes (SushiSwap, SpookySwap, etc.)
GrainLGEUniV3.sol LGE for chains with Uniswap V3-style DEXes
GrainLGEMetis.sol LGE optimized for Metis network
WETHGateway.sol Helper for native token (ETH/FTM) contributions

Claim Contracts

Contract Description
Claim.sol Handles vested token claims with corrected precision math
UserShares.sol Interface for reading user share data from LGE contracts

Support Contracts

Contract Description
WeightUniv2.sol Weight calculation helper for UniV2 LGE
WeightUniv3.sol Weight calculation helper for UniV3 LGE
WeightMetis.sol Weight calculation helper for Metis LGE

Key Features

Vesting Premium System

Users can choose vesting periods to receive bonus token allocations:

  • 0-2 years (0-8 periods): 0-40% premium (linear)
  • 2-5 years (8-20 periods): 40-60% premium (linear)

NFT Bonuses

Whitelisted NFT collections can provide additional weight multipliers for participants.

Precision

Uses 1e27 as PERCENT_DIVISOR to prevent precision loss in weight calculations - a critical fix over earlier implementations that used 10_000.

Setup

Prerequisites

  • Node.js 18+
  • npm

Installation

git clone <repository-url>
cd multi-chain-lge
npm install

Configuration

cp .env.example .env
# Edit .env with your private key and API keys

Usage

Compile

npm run compile

Test

npm run test

Deploy

npx hardhat run scripts/deploy.ts --network fantom

Architecture

User contributes tokens
        |
        v
Tokens swapped to USDC (if not USDC)
        |
        v
USDC value converted to weight based on:
  - Base contribution amount
  - Vesting premium multiplier
  - NFT bonus (if applicable)
        |
        v
After LGE ends, admin sets total GRAIN allocation
        |
        v
Users claim proportional to their weight
  - No vest: immediate full claim
  - Vested: released quarterly over vesting period

Security Considerations

  • All administrative functions are protected by Ownable
  • Slippage protection on token swaps
  • Vesting period capped to prevent over-claiming
  • Precision math using 1e27 divisor to prevent rounding errors

License

BUSL-1.1

About

Multi-chain LGE smart contracts and deployment scripts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors