LPsLux Proposals
LP-3165

LRC-165 Interface Detection

Implemented

LRC-165 Interface Detection for Lux Network

Category
LRC
Created
2025-01-23

Abstract

LRC-165 (mirrors ERC-165) provides standard interface detection for smart contracts.

Specification

Implements supportsInterface(bytes4 interfaceId) returning true for supported interfaces.

Motivation

This standard ensures compatibility with the broader EVM ecosystem while enabling Lux-specific optimizations.

Rationale

Mirrors the corresponding Ethereum standard for maximum compatibility.

Backwards Compatibility

Fully compatible with existing ERC implementations.

Reference Implementation

Repository: https://github.com/luxfi/standard Local Path: /Users/z/work/lux/standard/

Contracts

ContractDescription
lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.solOpenZeppelin ERC-165

Interfaces

Upgradeable Variants

For proxy-based upgradeable contracts:

ContractDescription
ERC165Upgradeable.solUpgradeable ERC-165

Usage: Initialize in initialize() instead of constructor. See OpenZeppelin Upgrades.

Build and Test

cd /Users/z/work/lux/standard

# Build all contracts
forge build

# Run tests
forge test -vvv

# Gas report
forge test --gas-report

Security Considerations

Implementations should follow established security best practices for the corresponding ERC.

Copyright and related rights waived via CC0.