# Deployer

[Git Source](https://github.com/Ion-Protocol/nucleus-boring-vault/blob/cc0b494b83e17b9b169a73b96050d2810b690477/src/helper/Deployer.sol)

**Inherits:** Auth

## State Variables

### isDeployer

```solidity
mapping(address => bool) public isDeployer;
```

## Functions

### constructor

```solidity
constructor(address _owner, Authority _auth) Auth(_owner, _auth);
```

### deployContract

Deploy some contract to a deterministic address.

*Should be of form: "ContractName Version 0.0" Where the numbers after version are VERSION . SUBVERSION*

```solidity
function deployContract(
    string calldata name,
    bytes memory creationCode,
    bytes calldata constructorArgs,
    uint256 value
)
    external
    requiresAuth
    returns (address);
```

**Parameters**

| Name              | Type      | Description                                                                                       |
| ----------------- | --------- | ------------------------------------------------------------------------------------------------- |
| `name`            | `string`  | string used to derive salt for deployment                                                         |
| `creationCode`    | `bytes`   | the contract creation code to deploy - can be obtained by calling type(contractName).creationCode |
| `constructorArgs` | `bytes`   | the contract constructor arguments if any - must be of form abi.encode(arg1, arg2, ...)           |
| `value`           | `uint256` | non zero if constructor needs to be payable                                                       |

### getAddress

```solidity
function getAddress(string calldata name) external view returns (address);
```

### convertNameToBytes32

```solidity
function convertNameToBytes32(string calldata name) public pure returns (bytes32);
```

## Events

### ContractDeployed

Emitted on `deployContract` calls.

```solidity
event ContractDeployed(string name, address contractAddress, bytes32 creationCodeHash);
```

**Parameters**

| Name               | Type      | Description                                                                                                |
| ------------------ | --------- | ---------------------------------------------------------------------------------------------------------- |
| `name`             | `string`  | string name used to derive salt for deployment                                                             |
| `contractAddress`  | `address` | the newly deployed contract address                                                                        |
| `creationCodeHash` | `bytes32` | keccak256 hash of the creation code - useful to determine creation code is the same across multiple chains |

## Errors

### Deployer\_\_NotADeployer

```solidity
error Deployer__NotADeployer();
```


---

# 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.nucleusearn.io/nucleus-architecture/smart-contracts/contracts/helper/deployer.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.
