ERC-2535: Diamond Multi-Facet Proxy
ERC-2535 ("Diamonds") extends ERC-1967 to allow a single proxy to dispatch calls across many implementation contracts ("facets"). Each function selector is mapped to exactly one facet. Diamonds let you upgrade individual functions without reimplementing the whole contract, work around Ethereum's 24KB contract size limit by spreading code across facets, and cleanly separate concerns.
IDiamondCut and IDiamondLoupe
function diamondCut(FacetCut[] calldata _diamondCut, address _init, bytes calldata _calldata)
external;
function facetAddress(bytes4 _functionSelector) external view returns (address);
function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory);Neo Equivalent
Neo contracts have no 24 KB size limit (NEF max is 1 MB) so diamonds aren't needed purely for size. But the modular-upgrade-per-function pattern is still useful and implementable on Neo via a small dispatcher contract that routes by method name to the correct facet contract.
Live on Neo TestNet
Both implementations deployed on Neo N3 TestNet.
| Implementation | TestNet Address | Contract Hash |
|---|---|---|
Solidity (neo-solc) | NMtzwNXhZGetcyPmotYvf4ALMEJD1xjGSb | 0x26b6f333…cf79f527 |
Neo C# (nccs) | NXNKvkkpyx9Z5KYCAS6JrH6GDPEPhwvZsE | 0x1b3c602c…34c5bdcf |
Verified: ownership claim and method-router state. The Neo port avoids delegatecall (which doesn't exist in NeoVM) — instead, Dispatch(method, args) looks up the facet contract and invokes it via Contract.Call(facet, method, ...). Cleaner audit surface than the EVM diamond pattern. docs/standards-mirror/deployments/erc-2535/.
