Remove in-constructor requirements (#2195)
* Remove isConstructor requirement from _setupRole * Remove isConstructor requirement from _setupDecimals * Update contracts/access/AccessControl.sol Co-Authored-By: Francisco Giordano <frangio.1@gmail.com> Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
@ -164,12 +164,16 @@ abstract contract AccessControl is Context {
|
||||
* event. Note that unlike {grantRole}, this function doesn't perform any
|
||||
* checks on the calling account.
|
||||
*
|
||||
* Requirements:
|
||||
* [WARNING]
|
||||
* ====
|
||||
* This function should only be called from the constructor when setting
|
||||
* up the initial roles for the system.
|
||||
*
|
||||
* - this function can only be called from a constructor.
|
||||
* Using this function in any other way is effectively circumventing the admin
|
||||
* system imposed by {AccessControl}.
|
||||
* ====
|
||||
*/
|
||||
function _setupRole(bytes32 role, address account) internal virtual {
|
||||
require(!address(this).isContract(), "AccessControl: roles cannot be setup after construction");
|
||||
_grantRole(role, account);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user