# Diamonds

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.&#x20;

<figure><img src="https://3814274390-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7KMvfkKiMk59AtMYuGm9%2Fuploads%2FfV0pjIQgaMwF6ladtpwP%2Fimage.png?alt=media&#x26;token=bcdbfbb6-8e68-44ec-b842-375b4719adc4" alt=""><figcaption><p>Diamonds Page in Forgenie Studio</p></figcaption></figure>

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](https://etherscan.io/) 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.

<figure><img src="https://3814274390-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7KMvfkKiMk59AtMYuGm9%2Fuploads%2FPycNkdtmPrL3UuYolByd%2Fimage.png?alt=media&#x26;token=993516cf-b9d2-4fef-9f00-b80706597505" alt="" width="563"><figcaption><p>Base Components of a Diamond</p></figcaption></figure>

1. **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.
2. **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.
3. **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.
4. **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.
5. **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.
6. **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.
7. **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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.forgenie.com/forgenie-studio/diamonds.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
