Unlockd
Unlockd.sol
is the main entry point for the Unlockd Protocol. It serves as a proxy dispatcher, routing calls to the appropriate module contracts based on the provided module ID.
Key variables:
_moduleLookup
: A mapping that stores the implementation address for each module ID.
_proxyLookup
: A mapping that stores the proxy address for each module ID (only for single-proxy modules).
Key functions:
Initializes the contract with the ACL manager and installer module addresses. It also sets up the initial module and proxy lookups.
Parameters:
aclManager
: The address of the ACL manager contract.
installerModule
: The address of the installer module contract.
Returns the implementation address for a given module ID.
Parameters:
moduleId
: The ID of the module.
Returns:
The implementation address of the module.
Returns the proxy address for a given module ID.
Parameters:
moduleId
: The ID of the module.
Returns:
The proxy address of the module.
It dispatches the incoming call to the corresponding module contract based on the caller's trusted module ID and implementation address. It uses assembly to extract the module ID and implementation address from the caller's storage slot and delegate the call to the appropriate module contract.
Last updated