> ## Documentation Index
> Fetch the complete documentation index at: https://docs.forteamm.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ALTBCFactory

[Git Source](https://github.com/thrackle-io/liquidity-altbc/blob/a089af3d235b9241cf0ed6c700a259b616853515/src/factory/ALTBCFactory.sol)

**Inherits:**
FactoryBase

**Author:**
@oscarsernarosero @mpetersoCode55 @cirsteve

*creates the pools in an automated and permissioned fashion*

## State Variables

### altbcBytecode

```solidity theme={null}
bytes altbcBytecode;
```

### isByteCodeImmutable

```solidity theme={null}
bool public isByteCodeImmutable;
```

### VERSION

```solidity theme={null}
string public constant VERSION = "v1.0.0";
```

## Functions

### onlyIfByteCodeNotImmutable

```solidity theme={null}
modifier onlyIfByteCodeNotImmutable();
```

### constructor

*constructor receives and saves the ALTBCPool byte code to bypass contract side limit*

```solidity theme={null}
constructor();
```

### createPool

Only allowed deployers can deploy pools and only allowed yTokens are allowed

*deploys an ALTBC pool*

```solidity theme={null}
function createPool(
    address _xToken,
    address _yToken,
    uint16 _lpFee,
    ALTBCInput memory _tbcInput,
    uint256 _xAdd,
    uint256 _wInactive
) external onlyAllowedDeployers onlyAllowedYTokens(_yToken) returns (address deployedPool);
```

**Parameters**

| Name         | Type         | Description                                                           |
| ------------ | ------------ | --------------------------------------------------------------------- |
| `_xToken`    | `address`    | address of the X token (x axis)                                       |
| `_yToken`    | `address`    | address of the Y token (y axis)                                       |
| `_lpFee`     | `uint16`     | percentage of the fees in percentage basis points                     |
| `_tbcInput`  | `ALTBCInput` | input data for the pool                                               |
| `_xAdd`      | `uint256`    | the initial liquidity of xTokens that will be transferred to the pool |
| `_wInactive` | `uint256`    |                                                                       |

**Returns**

| Name           | Type      | Description                      |
| -------------- | --------- | -------------------------------- |
| `deployedPool` | `address` | the address of the deployed pool |

### setByteCode

```solidity theme={null}
function setByteCode(bytes calldata _byteCode) external onlyOwner onlyIfByteCodeNotImmutable;
```

### makeByteCodeImmutable

```solidity theme={null}
function makeByteCodeImmutable() external onlyOwner onlyIfByteCodeNotImmutable;
```
