This is an instance of
AccessControl, which the other contract in the platform will refer to for role management. Rather than having all contracts include their own access management, roles are centralized here to simplify things. For example, giving the
ENS_MANAGER_ROLE here will give the corresponding ability on all contracts in one single transaction.
By default, all roles (including the one not defined yet) are administered by the
setNewRole function allows the
DEFAULT_ADMIN_ROLE to updated role administration rules at any time. Note that this contract is mostly role agnostic and that roles identifiers that are not yet known/defined can be granted at any point without requiring an upgrade of this contract.
constructor(address forwarder) public
function initialize(address __admin) external
Initializer method, access point to initialize inheritance tree.
|__admin||address||address to be the DEFAULT_ADMIN_ROLE.|
function setNewRole(bytes32 role, bytes32 admin) external
Method for DEFAULT_ADMIN_ROLE to create new roles, and define their role admin.
|role||bytes32||id of the new role. Should be keccak256("<ROLE_NAME>").|
|admin||bytes32||role id that will be the role admin for the new role.|
function _authorizeUpgrade(address newImplementation) internal virtual
Access control for the upgrade process (UPGRADER_ROLE)
|newImplementation||address||address of the new deployed implementation.|
function setName(address ensRegistry, string ensName) public
Allow ENS_MANAGER_ROLE to set ENS reverse registration
|ensName||string||the name to set in th registry|
function _msgSender() internal view virtual returns (address sender)
Helper to get either msg msg.sender if not a meta transaction, signer of forwarder metatx if it is.
If the tx is sent by the trusted forwarded, we assume it is a meta transaction and the signer address is encoded in the last 20 bytes of msg.data.
|sender||address||address of sender of the transaction of signer if meta transaction.|
function _msgData() internal view virtual returns (bytes)
Helper to get msg.data if not a meta transaction, forwarder data in metatx if it is.
If the tx is sent by the trusted forwarded, we assume it is a meta transaction and msg.data must have the signer address (encoded in the last 20 bytes of msg.data) removed.
|||bytes||msg.data of the transaction of msg.data - signer address if meta transaction.|