Skip to content

Commit 42ed4e7

Browse files
committed
Converting documentation to use modules
1 parent 08f6e51 commit 42ed4e7

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
sidebar_position: 7
3-
title: "Understanding Facets and Libraries"
4-
description: Learn how facets and libraries work together through shared storage to build composable systems.
3+
title: "Understanding Facets and Modules"
4+
description: Learn how facets and modules work together through shared storage to build composable systems.
55
---
66

77
Compose uses two complementary patterns for smart contract development:
@@ -17,35 +17,35 @@ Compose uses two complementary patterns for smart contract development:
1717

1818
**Example**: `ERC20Facet.sol` contains the complete ERC-20 token implementation.
1919

20-
### Libraries (Helper Functions)
20+
### Modules (Helper Functions)
2121

22-
**Libraries** (prefixed with `Lib`) help developers integrate their custom facets with Compose's facets. They:
22+
**Solidity modules help developers integrate their custom facets with Compose's facets. They:
2323

2424
- **Provide helper functions**: Reusable internal functions for custom facets
2525
- **Access shared storage**: Work with the same storage layout as their corresponding facet
2626
- **Enable composition**: Allow custom facets to interact with Compose functionality
2727
- **Initializes Deployment**: Used to set variables when deploying diamonds
2828

29-
**Example**: `LibERC20.sol` provides helper functions to interact with ERC-20 storage from custom facets.
29+
**Example**: `ERC20.sol` provides helper functions to interact with ERC-20 storage from custom facets.
3030

3131
### The Key Insight: Shared Storage
3232

33-
**Both facets and libraries access the SAME storage in your diamond.** When `ERC721Facet` and `LibERC721` both define identical storage at `keccak256("compose.erc721")`, they're reading and writing the same data. This is how your custom facets can extend Compose functionality without inheritance.
33+
**Both facets and modules access the SAME storage in your diamond.** When `ERC721Facet` and `ERC721` both define identical storage at `keccak256("compose.erc721")`, they're reading and writing the same data. This is how your custom facets can extend Compose functionality without inheritance.
3434

3535
### When to Use Each
3636

37-
**Use a Facet when you want:**
37+
**Use a facet when you want:**
3838

3939
- The complete, standard implementation (e.g., full ERC-20 functionality)
4040
- To reuse it (on-chain) across multiple diamonds
4141
- A verified, audited implementation
4242

43-
**Use a Library when you're:**
43+
**Use a module when you're:**
4444

4545
- Building a custom facet that needs to interact with Compose features
4646
- Extending standard functionality with custom logic
4747
- Initializing storage variables during diamond deployment
4848

49-
## Available Facets & Libraries
49+
## Available Facets & Modules
5050

51-
Look in the [src directory](https://github.com/Perfect-Abstractions/Compose/tree/main/src) to see the currently provided functionality, facets and libraries.
51+
Look in the [src directory](https://github.com/Perfect-Abstractions/Compose/tree/main/src) to see the currently provided functionality, facets and modules.

website/docs/foundations/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ import CalloutBox from '@site/src/components/ui/CalloutBox';
5252
size="medium"
5353
/>
5454
<DocCard
55-
title="Understanding Facets and Libraries"
56-
description="Learn how facets and libraries work together through shared storage to build composable systems."
57-
href="/docs/foundations/facets-and-libraries"
55+
title="Understanding Facets and Modules"
56+
description="Learn how facets and modules work together through shared storage to build composable systems."
57+
href="/docs/foundations/facets-and-modules"
5858
icon={<Icon name="book" size={28} />}
5959
size="medium"
6060
/>

0 commit comments

Comments
 (0)