IdentityAccessManagerCoreFacet
Core facet for IdentityAccessManager diamond that handles basic entity access management
State Variables
ADMIN_ROLE
uint64 public constant ADMIN_ROLE = 0;
FINANCE_ROLE
uint64 public constant FINANCE_ROLE = 100;
GOVERNANCE_ROLE
uint64 public constant GOVERNANCE_ROLE = 101;
MEMBER_ROLE
uint64 public constant MEMBER_ROLE = 102;
AGENT_ROLE
uint64 public constant AGENT_ROLE = 103;
TIER_STARTER
uint8 public constant TIER_STARTER = 0;
TIER_SEED
uint8 public constant TIER_SEED = 1;
TIER_SCALE
uint8 public constant TIER_SCALE = 2;
Functions
onlyEntityAdmin
Modifier: caller must be entity, IAM admin, or protocol admin (via GAM)
modifier onlyEntityAdmin();
initialize
Initialize the IdentityAccessManager diamond
function initialize(address _entity, string calldata _entityName, address _globalAccessManager) external;
Parameters
_entity
address
The entity address
_entityName
string
Human-readable name for the entity
_globalAccessManager
address
The global access manager address
setGlobalAccessManager
Set the global access manager reference
function setGlobalAccessManager(address _globalAccessManager) external onlyEntityAdmin;
Parameters
_globalAccessManager
address
Address of the global access manager
updateEntityName
Update the entity name
function updateEntityName(string calldata newName) external onlyEntityAdmin;
Parameters
newName
string
The new entity name
addManagedAsset
Add an asset to be managed by this access manager
function addManagedAsset(address asset) external onlyEntityAdmin;
Parameters
asset
address
The asset address
removeManagedAsset
Remove an asset from management
function removeManagedAsset(address asset) external onlyEntityAdmin;
Parameters
asset
address
The asset address
getEntityRoles
Get role information for UI/tooling
function getEntityRoles() external pure returns (uint64[] memory roleIds, string[] memory roleNames);
Returns
roleIds
uint64[]
Array of all predefined role IDs
roleNames
string[]
Array of corresponding role names
getEntityInfo
Get entity information
function getEntityInfo()
external
view
returns (address entity, string memory entityName, address globalAccessManager);
Returns
entity
address
The entity address
entityName
string
The entity name
globalAccessManager
address
The global access manager address
getManagedAssets
Get managed assets
function getManagedAssets() external view returns (address[] memory assets);
Returns
assets
address[]
Array of managed asset addresses
isManagedAsset
Check if an asset is managed
function isManagedAsset(address asset) external view returns (bool managed);
Parameters
asset
address
The asset address
Returns
managed
bool
True if the asset is managed
_canManageGlobalSettings
Check if caller can manage global settings
function _canManageGlobalSettings() internal view returns (bool);
Returns
<none>
bool
bool True if caller is entity admin or current global protocol admin
_canManageEntitySettings
Check if caller can manage entity-level settings (admin/member management, metadata)
function _canManageEntitySettings() internal view returns (bool);
Events
IdentityAccessManagerCreated
event IdentityAccessManagerCreated(address indexed entity, string entityName);
EntityNameUpdated
event EntityNameUpdated(string oldName, string newName);
GlobalAccessManagerUpdated
event GlobalAccessManagerUpdated(address indexed oldManager, address indexed newManager);
AssetAdded
event AssetAdded(address indexed asset);
AssetRemoved
event AssetRemoved(address indexed asset);
Last updated
Was this helpful?