# BaseCoreModule

`BaseCoreModule.sol` serves as the base contract for each module in the Unlockd Protocol. It inherits from `BaseCore.sol` and provides additional functionality specific to modules.

### Key variables:

`moduleId`: The unique identifier of the module.

`moduleVersion`: The version of the module.

### Key functions:

```solidity
constructor(uint256 moduleId_, bytes32 moduleVersion_)
```

Initializes the contract with the module ID and version.

### Parameters:

`moduleId_`: The ID of the module.

`moduleVersion_`: The version of the module.

***

```solidity
function unpackTrailingParamMsgSender() 
internal pure returns (address msgSender)
```

Retrieves the original sender address from the calldata using assembly.

### Returns:&#x20;

The original sender's address.

***

```solidity
function unpackTrailingParams() 
internal pure returns (
    address msgSender, 
    address proxyAddr
)
```

Retrieves the original sender address and proxy address from the calldata using assembly.

### Returns:

`msgSender`: The original sender's address.

`proxyAddr`: The proxy address.

***

```solidity
function _checkHasUnlockdWallet(
    address msgSender
) internal view 
```

Description: Checks if the sender has a valid Unlockd wallet by querying the wallet registry contract.

### Parameters:

`msgSender`: The address of the sender to check.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devs.unlockd.finance/core/debt-tokens-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
