DocumentRegistryFactory
Inherits: Factory
Factory for deploying DocumentRegistry diamonds
Enables both global and entity-specific document registries
Functions
constructor
Deploy DocumentRegistryFactory
constructor(address _facetRegistry, address _globalAccessManager)
Factory("DocumentRegistryFactory", _facetRegistry, _globalAccessManager, "DocumentRegistryFactory");
Parameters
_facetRegistry
address
Address of the FacetRegistry
_globalAccessManager
address
Address of the GlobalAccessManager
deployDocumentRegistry
Deploy a new DocumentRegistry diamond
function deployDocumentRegistry(string memory registryName, bool isGlobal, bytes32 salt)
external
returns (address registry);
Parameters
registryName
string
Name for the registry (e.g., "GlobalDocuments", "AcmeCorpDocuments")
isGlobal
bool
Whether this is a global registry (protocol-wide)
salt
bytes32
Salt for CREATE2 deployment
Returns
registry
address
Address of the deployed DocumentRegistry
deployDocumentRegistryForEntity
Deploy a new DocumentRegistry diamond for a specific entity
function deployDocumentRegistryForEntity(
address entity,
address identityAccessManager,
string memory registryName,
bytes32 salt
) external returns (address registry);
Parameters
entity
address
Address of the entity who will own this registry
identityAccessManager
address
Address of the entity's access manager
registryName
string
Name for the registry
salt
bytes32
Salt for CREATE2 deployment
Returns
registry
address
Address of the deployed DocumentRegistry
getRegistryAddress
Get the address of a registry deployment
function getRegistryAddress(string memory registryName, address deployer, bytes32 salt)
external
view
returns (address registry);
Parameters
registryName
string
Name of the registry
deployer
address
Address of the deployer
salt
bytes32
Salt used for deployment
Returns
registry
address
Predicted address of the registry
Events
DocumentRegistryDeployed
event DocumentRegistryDeployed(address indexed registry, address indexed deployer, bool isGlobal, string registryName);
Last updated
Was this helpful?