Read First
Code written to be understood first, not just executed. Every facet is self-contained and readable top-to-bottom.
Open in docsCompose provides the standard facet library for building modular, diamond-based smart contract systems
Forget traditional smart contract design patterns. Compose takes a radically different approach with Smart Contract Oriented Programming.
We focus on building small, independent, and easy-to-understand smart contracts called facets. Each facet is designed to be deployed once, then reused and composed seamlessly with others to form complete smart contract systems.
Code written to be understood first, not just executed. Every facet is self-contained and readable top-to-bottom.
Open in docsBuilt specifically for ERC-2535 Diamonds. Deploy facets once, reuse them across multiple diamonds onchain.
Open in docsCombine deployed facets instead of inheriting contracts. Build systems from simple, reusable pieces.
Open in docsSmart Contract Oriented Programming (SCOP) - designed specifically for smart contracts, not general software.
Open in docs(In the future) Access verified, audited facets deployed on multiple blockchains.
Open in docsBuilt with love by the community. Join us in creating the standard library for ERC-2535 Diamonds.
Open in docsBoth facets and modules access the same storage in your diamond. Your custom facets can extend Compose functionality without inheritance.
// Your custom facet uses the ERC721 module
import { ERC721Mod } from "compose/ERC721Mod.sol";
contract GameNFTFacet {
function mintWithGameLogic(
address player,
uint256 tokenId
) external {
// Your custom game logic
require(
playerHasEnoughPoints(player),
"Not enough points"
);
// Use ERC721Mod - same storage
ERC721Mod.mint(player, tokenId);
// Standard ERC721Facet functions work seamlessly
updatePlayerStats(player);
}
}