AttestationAdminFacet
Inherits: AccessManaged
Facet for administrative functions in the AttestationRegistry diamond
Functions
constructor
Constructor
constructor(address _globalAccessManager) AccessManaged(_globalAccessManager);
Parameters
_globalAccessManager
address
Address of the GlobalAccessManager contract
initialize
Initialize the AttestationRegistry with EAS contracts (legacy - for global registry)
function initialize(address easAddress, address schemaRegistryAddress) external;
Parameters
easAddress
address
Address of the EAS contract
schemaRegistryAddress
address
Address of the SchemaRegistry contract
initializeWithMetadata
Initialize the AttestationRegistry with extended parameters (for factory deployment)
function initializeWithMetadata(
address globalAccessManager,
address easAddress,
address schemaRegistryAddress,
string memory registryName,
bool isGlobal
) external;
Parameters
globalAccessManager
address
Address of the GlobalAccessManager contract
easAddress
address
Address of the EAS contract
schemaRegistryAddress
address
Address of the SchemaRegistry contract
registryName
string
Name of the registry
isGlobal
bool
Whether this is a global registry
initializeForEntity
Initialize entity-specific registry with explicit entity and access manager
function initializeForEntity(
address entity,
address identityAccessManager,
address easAddress,
address schemaRegistryAddress,
string memory registryName
) external;
Parameters
entity
address
Address of the entity who owns this registry
identityAccessManager
address
Address of the entity's access manager
easAddress
address
Address of the EAS contract
schemaRegistryAddress
address
Address of the SchemaRegistry contract
registryName
string
Name of the registry
_getIdentityAccessManager
Get the entity access manager for a given entity
function _getIdentityAccessManager(address entity, address globalAccessManager) internal view returns (address);
Parameters
entity
address
The entity address
globalAccessManager
address
The global access manager address
Returns
<none>
address
The entity's access manager address
_getIdentityAccessManagerFromFactory
External helper function to get entity access manager (used in try/catch)
function _getIdentityAccessManagerFromFactory(address entity, address globalAccessManager)
external
view
returns (address accessManager);
Parameters
entity
address
The entity address
globalAccessManager
address
The global access manager address
Returns
accessManager
address
The entity's access manager address
getAccessManager
Get the effective access manager for this registry
function getAccessManager() external view returns (address);
Returns
<none>
address
The access manager address
getRegistryInfo
Get registry information
function getRegistryInfo()
external
view
returns (string memory registryName, bool isGlobal, address entity, address accessManager);
Returns
registryName
string
Name of the registry
isGlobal
bool
Whether this is a global registry
entity
address
The entity address (zero for global)
accessManager
address
The access manager address
setEAS
Set the EAS contract address
function setEAS(address easAddress) external restricted;
Parameters
easAddress
address
The new EAS contract address
setSchemaRegistry
Set the SchemaRegistry contract address
function setSchemaRegistry(address schemaRegistryAddress) external restricted;
Parameters
schemaRegistryAddress
address
The new SchemaRegistry contract address
setValidAttestor
Set valid attestor for an entity
function setValidAttestor(address attestor, bool isValid) external;
Parameters
attestor
address
The attestor address
isValid
bool
Whether the attestor is valid
authorizeDelegator
Authorize a delegator to submit delegated attestations
function authorizeDelegator(address delegator) external;
Parameters
delegator
address
The delegator address
deauthorizeDelegator
Deauthorize a delegator from submitting delegated attestations
function deauthorizeDelegator(address delegator) external;
Parameters
delegator
address
The delegator address
isAuthorizedDelegator
Check if a delegator is authorized
function isAuthorizedDelegator(address delegator) external view returns (bool);
Parameters
delegator
address
The delegator address
Returns
<none>
bool
bool True if authorized
isAttestorTrustedByEntity
Check if an attestor is trusted by an entity
function isAttestorTrustedByEntity(address entity, address attestor) external view returns (bool);
Parameters
entity
address
The entity address
attestor
address
The attestor address
Returns
<none>
bool
bool True if trusted
isGloballyAuthorizedAttestor
Check if an attestor is globally authorized (has SYSTEM_ATTESTOR_ROLE)
function isGloballyAuthorizedAttestor(address attestor) external view returns (bool);
Parameters
attestor
address
The attestor address
Returns
<none>
bool
bool True if globally authorized
withdrawAttestationPayment
Withdraw attestation payment from escrow
function withdrawAttestationPayment(address subject, bytes32 easUID) external;
Parameters
subject
address
The subject address
easUID
bytes32
The EAS schema UID
emergencyWithdraw
Emergency function to withdraw all contract funds (admin only)
function emergencyWithdraw(address payable recipient) external restricted;
Parameters
recipient
address payable
The recipient address
schemaRegistry
Get the SchemaRegistry contract address
function schemaRegistry() external view returns (ISchemaRegistry);
Returns
<none>
ISchemaRegistry
ISchemaRegistry The SchemaRegistry contract
getBalance
Get contract balance
function getBalance() external view returns (uint256);
Returns
<none>
uint256
uint256 The contract balance in wei
pauseSchema
Pause/unpause specific schema operations (admin only)
function pauseSchema(bytes32 easUID, bool paused) external restricted;
Parameters
easUID
bytes32
The schema UID
paused
bool
Whether to pause the schema
_hasAdminRole
Check if caller has admin role in the appropriate access manager
function _hasAdminRole(address account) internal view returns (bool);
Parameters
account
address
The account to check
Returns
<none>
bool
bool True if has admin role
receive
Allow contract to receive ETH
receive() external payable;
Events
ValidAttestorSet
event ValidAttestorSet(address indexed entity, address indexed attestor, bool isValid);
EASUpdated
event EASUpdated(address indexed oldEAS, address indexed newEAS);
AttestationRegistryDeployed
event AttestationRegistryDeployed(
address indexed registryAddress, address admin, address easAddress, address schemaRegistryAddress
);
DelegatorAuthorized
event DelegatorAuthorized(address indexed delegator);
DelegatorDeauthorized
event DelegatorDeauthorized(address indexed delegator);
SchemaUpdated
event SchemaUpdated(bytes32 indexed easUID, string name, bool active);
Last updated
Was this helpful?