You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUT, what about: Solady-style implementation of Diamond Storage. You've ADMITTED Diamond Storage is good, you basically use it across all these libraries (and the A contract), and in ERC721 you've really made it "lean and mean" with the whole _ERC721_MASTER_SLOT_SEED thing ChatGPT is explaining to me!
I'm not sure exactly what the interface would be for the person using the lib, but there must be an option. I'm also not sure how you would give users the ability to "add new members to existing structs," but I think that's a bad idea anyway so all the better if users can't do it!
Again, don't kill me, just calling it how I see it!
The text was updated successfully, but these errors were encountered:
In Simple Terms:
Diamond Storage is a pattern used in smart contract development to reduce gas costs and improve contract upgradability. It allows for data to be stored in a single contract and accessed by multiple contracts. This pattern is commonly used in ERC721 and other token standards.
In a Solady-style implementation of Diamond Storage, the focus would be on minimizing the code size and gas costs while maintaining the benefits of Diamond Storage. Solady is a framework for developing efficient and secure smart contracts on Solana.
One approach to implementing Diamond Storage in a Solady-style could be to use a single state struct to store all the data related to the contract. This state struct can be defined in a separate file and imported into the contract. The contract can then access the state struct using a global variable.
To allow for adding new members to the state struct, the contract can include a function that modifies the state struct. However, this should be done with caution as it can potentially introduce security vulnerabilities and impact the contract upgradability.
Overall, implementing Diamond Storage in a Solady-style requires careful consideration of the trade-offs between code size, gas costs, and contract upgradability. The interface for the library would depend on the specific use case and requirements.
BUT, what about: Solady-style implementation of Diamond Storage. You've ADMITTED Diamond Storage is good, you basically use it across all these libraries (and the A contract), and in ERC721 you've really made it "lean and mean" with the whole
_ERC721_MASTER_SLOT_SEED
thing ChatGPT is explaining to me!I'm not sure exactly what the interface would be for the person using the lib, but there must be an option. I'm also not sure how you would give users the ability to "add new members to existing structs," but I think that's a bad idea anyway so all the better if users can't do it!
Again, don't kill me, just calling it how I see it!
The text was updated successfully, but these errors were encountered: