Both facets and libraries access the same storage in your diamond. Your custom facets can extend Compose functionality without inheritance.
Complete, reusable implementations
Helper functions for custom facets
Both work with the same data
// Your custom facet uses LibERC721
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 - same storage!
LibERC721.mint(player, tokenId);
// Standard ERC721Facet functions
// work seamlessly
updatePlayerStats(player);
}
}