AssetAdminFacet
Facet for administrative functions including access control and pausing
Diamond facet providing administrative functionality
Functions
_authority
function _authority() internal view returns (address);
addAgent
Add a new agent with admin privileges
function addAgent(address _agent) external;
Parameters
_agent
address
Address of the agent to add
removeAgent
Remove an agent
function removeAgent(address _agent) external;
Parameters
_agent
address
Address of the agent to remove
isAgent
Check if an address is an agent
function isAgent(address _agent) external view returns (bool);
Parameters
_agent
address
Address to check
Returns
<none>
bool
True if the address is an agent, false otherwise
setPaused
Set the paused state
function setPaused(bool _paused) external;
Parameters
_paused
bool
The new paused state
emergencyPause
Emergency pause function - can only pause, not unpause
function emergencyPause() external;
getAdminInfo
Get all administrative information for an address
function getAdminInfo(address account) external view returns (bool isOwner, bool isAgentRole, bool isAdmin);
Parameters
account
address
The address to check
Returns
isOwner
bool
Whether the address is the owner
isAgentRole
bool
Whether the address is an agent
isAdmin
bool
Whether the address has admin privileges (owner or agent)
batchAddAgents
Batch add multiple agents
function batchAddAgents(address[] calldata agents) external;
Parameters
agents
address[]
Array of addresses to add as agents
batchRemoveAgents
Batch remove multiple agents
function batchRemoveAgents(address[] calldata agents) external;
Parameters
agents
address[]
Array of addresses to remove as agents
isInitialized
Check if the contract is initialized
function isInitialized() external view returns (bool);
Returns
<none>
bool
True if the contract is initialized
getContractStatus
Get contract status information
function getContractStatus()
external
view
returns (bool contractPaused, address ownerAddress, uint256 totalAgents, bool contractInitialized);
Returns
contractPaused
bool
Whether the contract is paused
ownerAddress
address
The current owner address
totalAgents
uint256
The total number of agents
contractInitialized
bool
Whether the contract is initialized
hasAdminRole
Check if an address has any administrative privileges
function hasAdminRole(address account) external view returns (bool);
Parameters
account
address
The address to check
Returns
<none>
bool
True if the address has admin privileges
emergencyTransferOwnership
Emergency function to transfer ownership (requires current owner)
function emergencyTransferOwnership(address newOwner) external;
Parameters
newOwner
address
The new owner address
resetAllAgents
Reset all agents (emergency function)
This removes all agents but preserves the owner
function resetAllAgents() external view;
batchCheckAdminStatus
Check multiple addresses for admin status
function batchCheckAdminStatus(address[] calldata accounts) external view returns (bool[] memory);
Parameters
accounts
address[]
Array of addresses to check
Returns
<none>
bool[]
Array of booleans indicating admin status for each address
Events
AgentAdded
event AgentAdded(address indexed agent);
AgentRemoved
event AgentRemoved(address indexed agent);
PausedSet
event PausedSet(bool indexed paused);
Last updated
Was this helpful?