Smart contracts for Liquidity Generation Events (LGE) supporting multiple DEX architectures across different EVM chains.
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
| 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 |
| Contract | Description |
|---|---|
Claim.sol |
Handles vested token claims with corrected precision math |
UserShares.sol |
Interface for reading user share data from LGE 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 |
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)
Whitelisted NFT collections can provide additional weight multipliers for participants.
Uses 1e27 as PERCENT_DIVISOR to prevent precision loss in weight calculations - a critical fix over earlier implementations that used 10_000.
- Node.js 18+
- npm
git clone <repository-url>
cd multi-chain-lge
npm installcp .env.example .env
# Edit .env with your private key and API keysnpm run compilenpm run testnpx hardhat run scripts/deploy.ts --network fantomUser 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
- 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
BUSL-1.1