Skip to content

Commit

Permalink
✍🏻add: added diagram to Diamond.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjay-sol committed Sep 15, 2024
1 parent 9fc3df2 commit 79021a3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions contracts/Diamond.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@ pragma solidity ^0.8.0;

import { IDiamond } from "./interfaces/IDiamond.sol";

/*
+------------------------------------+
| Diamond.sol |
+------------------------------------+
/|\
| msg.sig (function selector)
|
+---------+--------------------+-------------------------+
| | |
+----------------------+ +-------------------+ +--------------------+
| OwnershipFacet | | TokenFacet | | OtherFacet (future) |
+----------------------+ +-------------------+ +--------------------+
| - transferOwnership()| | - mint() | | - someOtherFunc() |
| - getOwner() | | - transfer() | | - etc... |
+-----------------------+ | - balanceOf() | +---------------------+
+-------------------+
*/

contract Diamond {
// A mapping to store which facet handles which function selectors
mapping(bytes4 => address) public facets;
Expand Down

0 comments on commit 79021a3

Please sign in to comment.