OpenZeppelin / cairo-contracts

OpenZeppelin Contracts written in Cairo for Starknet, a decentralized ZK Rollup
https://docs.openzeppelin.com/contracts-cairo
MIT License
797 stars 320 forks source link

Allow storage access in SNIP12Metadata #1023

Open ericnordelo opened 4 days ago

ericnordelo commented 4 days ago

🧐 Motivation Currently, we can't dynamically set the name and version when implementing SNIP12, but we need to set them as constant short strings. This intentionally saves some gas by avoiding unnecessary storage reads, but sometimes that's the desired behavior, like for example, with a token generator.

📝 Details Make the SNIP12Metadata trait generic on the contract state, so it can optionally access storage members.