-
Notifications
You must be signed in to change notification settings - Fork 479
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
Add ERC: Access Control Registry #723
base: master
Are you sure you want to change the base?
Add ERC: Access Control Registry #723
Conversation
Co-authored-by: Andrew B Coathup <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the err and add ERC
@Joj501 Could you clarify which specific error you're referring to? |
The commit bf21f1a (as a parent of 48b3f97) contains errors. |
ERCS/erc-7820.md
Outdated
struct ContractInfo { | ||
bool isActive; | ||
address admin; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This struct isn't used in any of the public functions of the interface, and should be removed.
// Grants roles to multiple accounts for multiple contracts. | ||
// @param targetContracts An array of contract addresses to which roles will be granted. | ||
// @param roles An array of roles to be granted. | ||
// @param accounts An array of accounts to be granted the roles. | ||
function grantRole( | ||
address[] memory targetContracts, | ||
bytes32[] memory roles, | ||
address[] memory accounts | ||
) external; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation for this function is a bit ambiguous. Does this grant all the listed roles
to all the targetContracts
for all the accounts
, or is it more like a tuple (contract, role, account)
?
|
||
## Rationale | ||
|
||
The IAccessControlRegistry interface aims to provide a standardized way to manage access control across multiple contracts within the ecosystem. By defining a clear structure and set of events, this interface helps streamline the process of registering, unregistering, and managing roles for contracts. The rationale for each function and event is as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IAccessControlRegistry interface aims to provide a standardized way to manage access control across multiple contracts within the ecosystem. By defining a clear structure and set of events, this interface helps streamline the process of registering, unregistering, and managing roles for contracts. The rationale for each function and event is as follows: | |
The `IAccessControlRegistry` interface aims to provide a standardized way to manage access control across multiple contracts within the ecosystem. By defining a clear structure and set of events, this interface helps streamline the process of registering, unregistering, and managing roles for contracts. The rationale for each function and event is as follows: |
ERCS/erc-7820.md
Outdated
#### Efficient Storage and Lookup | ||
|
||
**Mapping Utilization**: The use of mappings for storing contract information (mapping(address => ContractInfo) private contracts) and role assignments (mapping(address => mapping(address => mapping(bytes32 => bool))) private _contractRoles) ensures efficient storage and lookup. This is crucial for maintaining performance in a large-scale system with numerous contracts and roles. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is specific to your reference implementation. The rationale section is for documenting the specification itself. If you'd like to explain choices made about your reference implementation, please put it in that section instead.
ERCS/erc-7820.md
Outdated
|
||
#### Role Management Flexibility | ||
|
||
**Bulk Operations**: Functions like grantRole and revokeRole allow for the assignment and revocation of roles to multiple accounts for multiple contracts in a single transaction. This bulk operation reduces gas costs and simplifies the process of role management in large systems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Bulk Operations**: Functions like grantRole and revokeRole allow for the assignment and revocation of roles to multiple accounts for multiple contracts in a single transaction. This bulk operation reduces gas costs and simplifies the process of role management in large systems. | |
**Bulk Operations**: Functions like `grantRole` and `revokeRole` allow for the assignment and revocation of roles to multiple accounts for multiple contracts in a single transaction. This bulk operation reduces gas costs and simplifies the process of role management in large systems. |
ERCS/erc-7820.md
Outdated
|
||
#### Robust Security Measures | ||
|
||
**Admin-Only Operations**: Functions that modify the state, such as unRegisterContract, _grantRole, and _revokeRole, are restricted to contract admins. This ensures that only authorized personnel can manage contracts and roles, reducing the risk of unauthorized changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, _grantRole
and _revokeRole
don't appear in the Specification.
ERCS/erc-7820.md
Outdated
## Reference Implementation | ||
|
||
```solidity | ||
// SPDX-License-Identifier: MIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code that's inline in the document itself must be CC0-1.0 licensed. We do allow MIT in the assets/
directory if you'd like to link to it there.
Co-authored-by: Sam Wilson <[email protected]>
Co-authored-by: Sam Wilson <[email protected]>
When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md
We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met: