The official standard smart contracts library for the Lux Network ecosystem.
This repository contains the core smart contracts for the Lux Network, including:
- LUX Token: The native governance and utility token
- Bridge: Cross-chain bridge for asset transfers
- DropNFTs: NFT distribution system
- Lamport Signatures: Post-quantum secure signature implementation
- DeFi Protocols: AMM, staking, and yield farming contracts
- Node.js v18+ and npm/pnpm
- Foundry (for Solidity testing)
- Git
- Clone the repository:
git clone https://github.com/luxfi/standard.git
cd standard- Install dependencies:
npm install
# or
pnpm install- Install Foundry (if not already installed):
./install-foundry.shBuild contracts using Foundry:
forge buildRun tests with Foundry:
forge testRun tests with gas reporting:
forge test --gas-reportGenerate coverage report:
forge coverageDeploy to local network:
anvil # In one terminal
forge script script/Deploy.s.sol:DeployScript --rpc-url localhost --broadcastDeploy to testnet:
forge script script/Deploy.s.sol:DeployTestnet --rpc-url testnet --broadcast --verifyDeploy to mainnet:
forge script script/Deploy.s.sol:DeployMainnet --rpc-url mainnet --broadcast --verify- ERC20 governance token with blacklist functionality
- Bridge minting/burning capabilities
- Pausable for emergency situations
- One-time airdrop functionality
- Cross-chain asset transfers
- Multi-signature security
- Support for multiple chains
- NFT distribution system
- Whitelist management
- Batch minting capabilities
- One-time signature scheme
- Post-quantum secure
- Integration with Lux Safe
- UniswapV2: AMM implementation
- Farm: Yield farming contracts
- Market: NFT marketplace
- Auction: NFT auction system
- All contracts follow best practices
- OpenZeppelin libraries for standard implementations
- Comprehensive test coverage
- Lamport OTS implementation for future-proofing
- Gradual migration path from ECDSA
Located in test/foundry/:
LUX.t.sol- Token contract testsLamport.t.sol- Quantum signature testsTestHelpers.sol- Common test utilities
# All tests
forge test
# Specific test file
forge test --match-path test/foundry/LUX.t.sol
# Specific test function
forge test --match-test testTokenMetadata
# With verbosity
forge test -vvvvMonitor gas usage:
forge snapshotCompare gas changes:
forge snapshot --diff- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.
- GitHub: @luxfi
- Discord: Lux Network