Smart Contracts

Lux DeFi smart contracts - DEX, Bridge, Lending, Staking, and Governance

Smart Contracts

Lux DeFi protocol is powered by a comprehensive suite of audited smart contracts deployed across Lux Network and supported chains.

Source Code: All contracts are open source at github.com/luxfi/standard

Contract Architecture

┌─────────────────────────────────────────────────────────────────┐
│                    LUX DEFI CONTRACT STACK                       │
├─────────────────────────────────────────────────────────────────┤
│  GOVERNANCE LAYER                                                │
│  ┌─────────────────────────────────────────────────────────┐    │
│  │  Governor | Timelock | DAO | Voting                     │    │
│  └─────────────────────────────────────────────────────────┘    │
├─────────────────────────────────────────────────────────────────┤
│  APPLICATION LAYER                                               │
│  ┌───────────────┐ ┌───────────────┐ ┌───────────────┐          │
│  │  DEX          │ │  Lending      │ │  Bridge       │          │
│  │  OrderBook    │ │  Pool         │ │  Lock/Mint    │          │
│  │  Settlement   │ │  Interest     │ │  Validator    │          │
│  │  Vault        │ │  Liquidator   │ │  MPC Signer   │          │
│  └───────────────┘ └───────────────┘ └───────────────┘          │
├─────────────────────────────────────────────────────────────────┤
│  TOKEN LAYER                                                     │
│  ┌─────────────────────────────────────────────────────────┐    │
│  │  LUX | Wrapped Assets | LP Tokens | aTokens             │    │
│  └─────────────────────────────────────────────────────────┘    │
├─────────────────────────────────────────────────────────────────┤
│  INFRASTRUCTURE                                                  │
│  ┌─────────────────────────────────────────────────────────┐    │
│  │  Precompiles | Oracles | Safe Multisig | Registry       │    │
│  └─────────────────────────────────────────────────────────┘    │
└─────────────────────────────────────────────────────────────────┘

Quick Reference

Core Contracts

ContractMainnetTestnetDescription
LUX Token0x...0x...Native governance token
Bridge0x...0x...Cross-chain bridge
Pool0x...0x...Lending pool
Farm0x...0x...Yield farming
Voting0x...0x...Governance voting

Network Details

NetworkChain IDRPCExplorer
Lux Mainnet96369https://api.lux.network/ext/bc/C/rpchttps://explorer.lux.network
Lux Testnet96370https://api.testnet.lux.network/ext/bc/C/rpchttps://testnet.explorer.lux.network

Contract Categories

DEX Contracts

On-chain order book, settlement engine, and vault management for the decentralized exchange.

  • OrderBook: Central limit order book with matching engine
  • Settlement: Trade settlement and clearing
  • Vault: Asset custody and margin management

Bridge Contracts

Cross-chain asset transfer with MPC threshold signatures.

  • Bridge: Main bridge orchestrator
  • Lock/Mint: Asset locking and wrapped token minting
  • Validator: Bridge validator set management

Lending Contracts

Aave-compatible lending protocol with isolated markets.

  • Pool: Main lending pool
  • Interest: Rate strategy and accrual
  • Liquidator: Position liquidation engine

Token Contracts

Native and wrapped token implementations.

  • LUX: Native governance token
  • WLUX: Wrapped LUX for DeFi
  • Wrapped Assets: Cross-chain wrapped tokens

Governance Contracts

On-chain governance and DAO management.

  • Governor: Proposal and voting system
  • Timelock: Execution delay for security
  • DAO: Treasury and fund management

Staking Contracts

Validator staking and delegation.

  • Staking: Validator registration and bonding
  • Delegation: Stake delegation to validators
  • Rewards: Staking reward distribution

Security

Audits

All contracts have been audited by leading security firms. See Audits for full reports.

Bug Bounty

We maintain an active bug bounty program for responsible disclosure:

  • Critical: Up to $100,000
  • High: Up to $25,000
  • Medium: Up to $5,000

Emergency Procedures

  • Multi-sig controlled pause functionality
  • Timelock delays on critical operations
  • Emergency withdrawal mechanisms

Development

Installation

# Clone the repository
git clone https://github.com/luxfi/standard
cd standard

# Install dependencies
npm install

# Compile contracts
npx hardhat compile

# Run tests
npx hardhat test

Foundry

# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Build
forge build

# Test
forge test

# Deploy
forge script script/Deploy.s.sol --rpc-url $RPC_URL --broadcast

Integration

See Integration Guide for:

  • ABI downloads
  • Event signatures
  • Code examples (ethers.js, web3.js, viem)
  • Testing patterns

Documentation

TopicDescription
DEXExchange contracts
BridgeCross-chain bridge
LendingLending protocol
TokensToken contracts
GovernanceDAO governance
StakingValidator staking
AuditsSecurity audits
AddressesDeployed addresses
IntegrationDeveloper guide