Interface ID Calculation #923
-
Hi everyone. I'm wondering that how can the interfaces id being calculated (functions that has a State parameter), like in this code: https://github.com/OpenZeppelin/cairo-contracts/blob/main/src/token/erc721/interface.cairo. I'm following this docs: https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-5.md#how-interfaces-are-identified, but the example interface used doesn't have a State parameters. I tried adding |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Interface IDs are computed from the non-generic version of the interface, (removing self) which is the one matching the external ABI of the contract. You should remove the generic TContractState from the interface trait before computing the ID, and this is a requirement for src5-rs as well. |
Beta Was this translation helpful? Give feedback.
https://github.com/ericnordelo/src5-rs This is a tool for computing the interface id in case it can help.