Skip to main content

Introduction

Build with the Compose Library

The Compose library gives developers access to a comprehensive standard library of smart contract facets. By using the library in combination with the ERC-2535 Diamond standard, you can build sophisticated on-chain systems with maximum code reusability.

Foundations

The building blocks of the Compose platform.

Early Stage Development

Compose is currently in development and only available to contributors. It is NOT production ready. Use at your own risk in development environments only.

What is Compose?

Compose is a revolutionary smart contract library that helps developers create sophisticated smart contract systems using the ERC-2535 Diamond standard. It's designed from the ground up to prioritize code readability, on-chain composability, and developer understanding.

The Vision

Imagine having access to a comprehensive, verified standard library of smart contract components that you can combine like LEGO blocks to build complex systems—all deployed once on-chain and reused across your projects. That's Compose.

Key Features

On-Chain Standard Library

Access verified, audited facets deployed once and reused across multiple diamonds on multiple blockchains.

Composable Architecture

Mix and match facets and libraries to build exactly what you need without inheritance conflicts.

Readability First

Code designed to be understood. Smart Contract Oriented Programming prioritizes clarity over cleverness.

Upgradeable by Design

Full power of ERC-2535 Diamonds means your contracts can evolve without redeployment.

Battle-Tested Patterns

Community-reviewed implementations following proven best practices and security standards.

Developer Experience

Intuitive APIs, comprehensive documentation, and helpful libraries make development a breeze.

How It Works

Compose uses a shared storage architecture where both standard facets and your custom facets access the same data:

// Your custom facet integrates with Compose using libraries
import {LibERC721} from "compose/LibERC721.sol";

contract GameNFTFacet {
function mintWithGameLogic(address player, uint256 tokenId) external {
// Your custom game logic
require(playerHasEnoughPoints(player), "Not enough points");

// Use LibERC721 to mint - this modifies the SAME storage
// that ERC721Facet uses for balanceOf(), ownerOf(), etc.
LibERC721.mint(player, tokenId);

// Now the player owns this NFT and can use standard
// ERC721Facet.transferFrom() to transfer it!
updatePlayerStats(player);
}
}
Key Insight

Both your GameNFTFacet and the standard ERC721Facet work with the same storage in your diamond. This is the power of Compose's shared storage architecture.

Why Choose Compose?

Our value

  • Readability: Code that's easy to understand and audit
  • Reusability: Deploy once, use everywhere
  • Standards: Battle-tested, community-reviewed implementations
  • Upgradability: Full power of ERC-2535 Diamonds
  • Composability: Mix and match functionality without conflicts

Perfect For:

  • Building complex DeFi protocols
  • Creating NFT platforms with custom logic
  • Developing DAO governance systems
  • Projects requiring upgradeable smart contracts
  • Teams that prioritize code quality and maintainability

Core Principles

Read First

Code clarity is the top priority. Every line should be understandable by developers and auditors.

Diamond-Native

Designed specifically for ERC-2535. Not adapted from inheritance patterns.

Composition Over Inheritance

Combine facets instead of inheriting. Avoid the complexity of inheritance hierarchies.

Intentional Simplicity

Banned features lead to clearer code. Less magic, more understanding.

Next Steps

Community & Support

Compose is built with 🩵 by a vibrant community of developers who care about code quality.


Ready to revolutionize your smart contract development? Let's get started! 🚀