# Constructor specification requirements

To use WIZARD to deploy your custom contract code, the following convention must be met for WIZARD to support it.

## ECDSA based AVS

The `ECDSAServiceManagerBase` constructor is responsible for initializing key contract addresses and disabling initializers. The mandatory arguments are:

* **AVS Directory (`_avsDirectory`)**: Manages AVS-related data for registered operators.
* **Stake Registry (`_stakeRegistry`)**: Records registration and staking details.
* **Rewards Coordinator (`_rewardsCoordinator`)**: Handles reward distributions.
* **Delegation Manager (`_delegationManager`)**: Manages staker delegations to operators.

The code snippet below shows how these parameters are set:

[`eigenlayer-middleware/src/unaudited/ECDSAServiceManagerBase.sol`](https://github.com/Layr-Labs/eigenlayer-middleware/blob/74438b7915c35ca5a0d312654716160c2499169d/src/unaudited/ECDSAServiceManagerBase.sol)

```solidity
constructor(
    address _avsDirectory,
    address _stakeRegistry,
    address _rewardsCoordinator,
    address _delegationManager
) {
    avsDirectory = _avsDirectory;
    stakeRegistry = _stakeRegistry;
    rewardsCoordinator = _rewardsCoordinator;
    delegationManager = _delegationManager;
    _disableInitializers();
}
```

## BLS based AVS

The `ServiceManagerBase` constructor sets various immutable addresses.  The mandatory arguments are:

* **AVS Directory (`__avsDirectory`)**
* **Rewards Coordinator (`__rewardsCoordinator`)**
* **Registry Coordinator (`__registryCoordinator`)**
* **Stake Registry (`__stakeRegistry`)**

The constructor calls the base storage initializer and then disables further initializers.

[`eigenlayer-middleware/src/ServiceManagerBase.sol`](https://github.com/Layr-Labs/eigenlayer-middleware/blob/74438b7915c35ca5a0d312654716160c2499169d/src/ServiceManagerBase.sol)

```solidity
constructor(
    IAVSDirectory __avsDirectory,
    IRewardsCoordinator __rewardsCoordinator,
    IRegistryCoordinator __registryCoordinator,
    IStakeRegistry __stakeRegistry
)
    ServiceManagerBaseStorage(
        __avsDirectory,
        __rewardsCoordinator,
        __registryCoordinator,
        __stakeRegistry
    )
{
    _disableInitializers();
}
```


---

# 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://docs.altlayer.io/altlayer-documentation/wizard/custom-avs-specification/constructor-specification-requirements.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.
