π Diamonds
Last updated
Last updated
In the Forgenie Protocol, you own the ability to add, upgrade, remove functionality from a Diamond smart contract which you can trade or simply transfer to other address. By allowing Diamonds to be exchanged, we introduce multiple monetization opportunities for smart contracts, as now they can be seen as collectible items whose price would be determined by features such as rarity and uniqueness, compliance with standards, level of efficiency and security. Similarly, developers and project owners can offer customization services to build a Diamond smart contract tailored to the specific needs of clients.
The Forgenie protocol extends the EIP2535 standard by introducing a mechanism to turn a Diamond immutable in a granular way, as an alternative to removing the diamondCut
function that turns the Diamond immutable all at once. In this way, we allow Diamond owners to strike a balance between customization and security. They can choose to lock down essential components of the smart contract, while retaining the ability to upgrade or modify other Facets as needed. This flexibility enables them to adapt their smart contracts to evolving market demands, regulatory requirements, or security and technological advancements.
Essentially, a Facet can implement any smart contract functionality which can be added to a Diamond or be extended after deployment. However, some functions are required by default for structuring information such that users or query services like Etherscan can get information about which interfaces are supported and what Facets a Diamond currently has. More exactly, it consists of these integral functionality components ensuring seamless interaction and management.
Diamond Fallback: This component serves as the gateway to the Diamond, dynamically delegating calls to the correct Facets based on the function signature. This process ensures that the correct functionality is always executed, and it facilitates the Diamond's ability to remain modular and adaptable.
Diamond Cut: This function is responsible for adding, replacing, or removing Facets within a Diamond. It ensures that the Diamond remains modular and adaptable by enabling the integration of new functionalities or the removal of outdated ones.
Diamond Loupe: Diamond Loupe is a set of standard functions that provide information about the Facets and functions of a Diamond. It offers a clear and structured way to inspect the Diamond's composition, making it easy for users to understand and interact with the Diamond smart contract.
Ownership: The Base includes a minimal version of the ERC-173 standard, which governs the ownership and transfer of a Diamond. This standard ensures that the Diamond can be owned and managed by a designated address, allowing for easy transfer of control if required.
Introspection: The Base also incorporates the ERC-165 Introspection standard, which enables users to query a Diamond to determine if it supports specific interfaces or functionalities. This feature allows for easier interaction with the Diamond and ensures that it adheres to widely-accepted interface standards.
Diamond Incremental: This unique functionality within the Base handles granular immutability. It empowers Diamond owners to choose which Facets or functions should be rendered immutable, providing a fine-tuned control over the Diamond's adaptability and security.
Token Bound: This component provides the crucial functionality that transforms a Diamond into a Non-Fungible Token (NFT). By implementing this functionality, each Diamond becomes a unique and transferable entity. Also this functionality opens up the possibility of adding rich metadata to each Diamond, thereby increasing their value and utility in various applications.