Skip to content
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

Migrate AccessControl to component #770

Conversation

ericnordelo
Copy link
Member

Fixes #769

PR Checklist

  • Tests
  • Tried the feature on a public network
  • Documentation

Copy link
Collaborator

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, Eric! I left some comments and suggestions, and we need to update the Access API and doc pages

src/access/accesscontrol/accesscontrol.cairo Outdated Show resolved Hide resolved
src/access/accesscontrol/accesscontrol.cairo Outdated Show resolved Hide resolved
Comment on lines +72 to +74
+HasComponent<TContractState>,
+SRC5::HasComponent<TContractState>,
+Drop<TContractState>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +185 to +188
let mut contract = self.get_contract_mut();
let mut src5_component = SRC5::HasComponent::<
TContractState
>::get_component_mut(ref contract);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should do this right now, but I wonder if we can abstract this process out a bit in the future

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cairo team said they were working on improving this, so probably worth waiting a bit anyway, but I agree.

src/access/accesscontrol/accesscontrol.cairo Outdated Show resolved Hide resolved
src/tests/access/test_dual_ownable.cairo Outdated Show resolved Hide resolved
src/tests/mocks/accesscontrol_mocks.cairo Show resolved Hide resolved
src/tests/mocks/accesscontrol_mocks.cairo Show resolved Hide resolved
src/tests/utils.cairo Outdated Show resolved Hide resolved
src/access/accesscontrol/accesscontrol.cairo Outdated Show resolved Hide resolved
Copy link
Collaborator

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Let's remember to update the AccessControl code examples in the ERC20 migration

@ericnordelo ericnordelo merged commit 5439350 into OpenZeppelin:main Oct 18, 2023
2 checks passed
@ericnordelo ericnordelo deleted the feat/migrate-access-control-to-component branch October 18, 2023 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate AccessControl to component
6 participants