-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update IACCOUNT_ID to match the interface for Cairo 1 #612
Comments
There's two reasons to not include it:
|
Let's make sure to document this whenever this is settled. |
Shouldn't we be using Cairo types for generating the Id instead of Solidity types? The rationale for using Solidity types is that is easier to compute using remix or there is something else? Wouldn't something like this be more appropriate?
Being translated into these signatures:
And we can use this Python script for getting the final
Which gives us: I think it may be worth even defining a SIP-165 following the same structure of the ERC, to define if we should use |
Apart from if we use Solidity or Cairo types, how should we coordinate these interface migrations @martriay? Should I tag @juniset from Argent and someone specific from Braavos too? After this change current |
The rationale was to follow ERC165.
I'm not sure whether a SNIP* can be non-sequential. I guess we could work on such a standard, not entirely convinced about the benefits.
We can always start discussions in here and tag relevant people, but ultimately the place for network-wide discussion should be the Shaman's forum, where SNIPs also live. Note that @sgc-code works for Argent.
What it was discussed and implemented before is for tokens to support old account IDs, although as you point out it's not entirely future proof. I think adding the 721 or 1155 receiver interfaces incurs in a similar issue since accounts won't be able to handle new/different standards. All in all I think introspection is important for accounts and other contracts to work with, so I would lean towards improving that. In the early days it didn't look as a great idea, but after achieving some maturity (especially after regenesis) it might make sense for Accounts to be interface retrocompatible. Is this a good time to make such commitment? |
Do we have a defined mapping between Solidity and Cairo types for this?
If a Cairo developer tries to use ERC165 with his Cairo interfaces, today he could find the specification on how to generate the interface_id? Is there a place where he could find how to map the Cairo types to Solidity that he can be sure is the standard way for Starknet? If the answer is no I think a standard would help, and we could avoid mapping to Solidity using Cairo types directly with something like the previous proposal.
We could use a different number of course.
I think we may need to make a distinction between this interface we are defining and the term Account. Even if OZ, Argent, and Braavos follow this interface, other parties can implement valid accounts without the After this, I think making Account retrocompatible sounds good, but this won't avoid changes in the interface id by potentially adding new methods, or changing functions signature. Is part of what you have in mind supporting the previous ids by default? |
Small note, I you go with the solidity style for function signature, than rather than doing the xor manually, you should use
|
Its more complexe than that.
|
One thing to consider is wether we want
and
to produce the same id or not. If you use the "solidity array" syntax you won't be able to distinguish them. |
There are some things to consider for sure, and that's why I think a SNIP would help, but the most important thing to me is to settle on some standardization for interfaces (ERC-165 alone is not enough unless we have a strict mapping between types). And this is not just for Accounts ofc, is a wider issue. After that, I think we can settle on the Standard Account interface, because calling it just the Account interface looks like stating that account contracts not following this interface are not valid accounts, and this is not true, right? |
I created this post on the forum about defining this interface id standard for Starknet, feedback and comments are appreciated. We can continue the discussion about the Standard Account interface here. |
🧐 Motivation
With Cairo 1, there are some changes to the IAccount interface. To be used with ERC-165. The main change is the use of snake_case for the method names.
📝 Details
The old IACCOUNT_ID was calculated here
#449 (comment)
I suggest the following change
There is also
__validate_deploy__
but i see that it was not included in the previous version, not sure if there was a reason to exclude itThe text was updated successfully, but these errors were encountered: