Anyone with a solid understanding of the diamond pattern. Was hoping to get a clarification here https://eip2535diamonds.substack.com/p/how-eip2535-diamonds-reduces-gas

The article mentions that "function calls between CryptoKitties, KittyHats, Marketplace and Guild were converted to internal function calls". There is an example that is supposed to be showing this. However, the example only shows contracts calling the storage library: https://gist.github.com/mudgen/4517fc351cb8e77ebafa8b38c61ac21f

So was wondering what the calls between above contracts look like, and what makes them internal?

Aug 29, 2023, 1:09 AM
Think of the diamond contract as a huge data storage. All the contracts that you want to intercommunicate will be connected to this database as facets
Aug 29, 2023, 8:00 AM
That was sort of my understanding too. And in the example it looks the facets are only interacting with the Library. However, the article mentions that the facets are making internal calls to each other. I understand how the calls to the Library are internal. However, the facet to facet call should still be external
Aug 29, 2023, 9:33 PM
There is no facet to facet call. Contracts are modified to route calls through library instead of making external calls directly
Take a look at aavegotchis implementation

https://github.com/aavegotchi/aavegotchi-contracts/tree/master/contracts/Aavegotchi/facets
Aug 30, 2023, 8:13 AM

© 2024 Draquery.com All rights reserved.