It is well known that EIP2535 Diamonds can be upgradeable. However they can also be immutable and so have the same immutable guarantees as any other immutable contract. The current implementations of EIP-2535 can be upgradeable or immutable. Making a diamond immutable is simply done by not adding the upgrade function `diamondCut` to the diamond during deployment, or removing it later if it is added.
It is possible to create a viable immutable-only implementation of EIP-2535. In such an implementation, the diamondCut function would not be included, and the contract would be designed to be immutable and not capable of being upgraded.
To accomplish this, the contract would need to be designed to include all the necessary functions and data storage structures at the time of deployment. This would require a thorough understanding of the intended use cases for the contract and careful planning to ensure that all necessary functions and data structures are included.
Additionally, the contract could use a different approach for mapping function selectors to facet addresses. For example, instead of using a Solidity mapping, the contract could use an array or other data structure to store the mapping between function selectors and facet addresses. This could potentially reduce the gas cost of calling functions on the diamond.
Static Diamond Challenge
It is possible to create a viable immutable-only implementation of EIP-2535. In such an implementation, the diamondCut function would not be included, and the contract would be designed to be immutable and not capable of being upgraded.
To accomplish this, the contract would need to be designed to include all the necessary functions and data storage structures at the time of deployment. This would require a thorough understanding of the intended use cases for the contract and careful planning to ensure that all necessary functions and data structures are included.
Additionally, the contract could use a different approach for mapping function selectors to facet addresses. For example, instead of using a Solidity mapping, the contract could use an array or other data structure to store the mapping between function selectors and facet addresses. This could potentially reduce the gas cost of calling functions on the diamond.