-
Notifications
You must be signed in to change notification settings - Fork 358
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
Implement Access Control #249
Comments
The Solidity implementation for AccessControl stores the |
@andrew-fleming What interoperability do you have in mind in this case? |
At first, the PR proposed (#239) used a uint256. If was felts that IMO, using 252 bits for roles is way sufficient to avoid collisions. It has the drawback that you can't simply reuse the bytes32 roles transparently, but I don't think it's an issue. We can "just" take 252 bits of |
@milancermak one specific example (that's fresh because I'm working on it) is with standard Timelock roles a la |
Right, but what's the benefit of having the role const the same in a Solidity contract and a Cairo contract? |
😆 That seems reasonable to me^
@milancermak ah sorry, I didn't answer your question directly. I think the benefit is in easing the transition for existing applications following the standard. It'd be much simpler, IMO, for cross-chain applications that implement AccessControl to be able to use the same value (thus the same or similar mechanism to calculate said value). Though, @Amxx's solution might resolve this discrepancy with the best of both worlds approach |
Note, if you have an app that lives both in the EVM and Starknet spaces, you can stick to 252 bits roles and use them in both places. |
I would definitely prioritize usability over strict compatibility with Solidity. What is the size of hashes in Cairo natively? If felt, I'd say let's use felt. |
We can use felt, but what should we represent in them? Should it be the first or last 252bits of |
No strong opinion on this. Note that the format of roles is not mandated by AccessControl, it's up to the user and recommendations can change in the future. We've seen users of Solidity's AccessControl use various formats for their role ids including different hash functions or the direct string bytes. |
We can maintain certain agnosticism then. Let's do felts. |
No description provided.
The text was updated successfully, but these errors were encountered: