Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Wrong Function from AccessControl used #1

Open
yvesbou opened this issue Nov 8, 2022 · 0 comments
Open

Wrong Function from AccessControl used #1

yvesbou opened this issue Nov 8, 2022 · 0 comments

Comments

@yvesbou
Copy link
Member

yvesbou commented Nov 8, 2022

https://github.com/SwissDAO/membership/blob/0e61a03ece654d3d154efd6ac71ffcc9bde4486f/contracts/MemberCard.sol#L39

Description of _grantRole, to me it looks like, we shouldn't use this function

/**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
 */

instead,

/**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
    _grantRole(role, account);
} 
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant