Skip to content

Commit 3734cb8

Browse files
committed
Improved documentation of Design for Composition
1 parent b8aeb92 commit 3734cb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

website/docs/design/design-for-composition.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function getStorage() internal pure returns (ERC20PermitStorage storage s) {
140140
```
141141
#### Summary: How This Example Follows the Guide
142142

143-
- **Reusing storage struct**: The `ERC20Storage` struct is copied from `ERC20Facet` and reused at the same location in storage `keccak256("compose.erc20")`, ensuring both facets access the same ERC20 token data. This demonstrates how facets can share storage through diamond storage patterns.
143+
- **Reusing storage struct**: The `ERC20Storage` struct is copied from `ERC20Facet` and reused at the same location in storage `keccak256("compose.erc20")`, ensuring both facets access the same ERC20 token data. This demonstrates how facets can share storage.
144144

145145
- **Maintaining variable order**: All variables in the reused `ERC20Storage` struct maintain the same order as the original struct.
146146

@@ -298,7 +298,7 @@ This example demonstrates proper facet extension by:
298298

299299
- **Extending as a new facet**: `ERC20StakingFacet` is a separate, self-contained facet that composes with `ERC20Facet`. This follows the principle that every extension should be implemented as a new facet.
300300

301-
- **Reusing storage struct**: The `ERC20Storage` struct is copied from `ERC20Facet` and reused at the same storage location `keccak256("compose.erc20")`, ensuring both facets access the same token data. This demonstrates how facets can share storage through diamond storage patterns.
301+
- **Reusing storage struct**: The `ERC20Storage` struct is copied from `ERC20Facet` and reused at the same storage location `keccak256("compose.erc20")`, ensuring both facets access the same token data. This demonstrates how facets can share storage.
302302

303303
- **Maintaining variable order**: The `balanceOf` variable remains in the first position of the reused `ERC20Storage` struct, exactly as it appears in the original struct, preserving the order of storage variables.
304304

0 commit comments

Comments
 (0)