> For the complete documentation index, see [llms.txt](https://pangeaswap.gitbook.io/pangeaswap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pangeaswap.gitbook.io/pangeaswap/en/developers/contracts/core-contracts/masterdeployer.md).

# MasterDeployer

A contract that distributes the Concentrated Liquidity Pool, which manages the permission of the factory that creates the pool.

{% embed url="<https://github.com/pangea-protocol/pangea-core/blob/main/contracts/deployer/MasterDeployer.sol>" %}

## Overview

![](https://1563666604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FExVtY885R6zefiJOQZzR%2Fuploads%2FiVxTW9eeB7DFg4UoKjkF%2Fimage.png?alt=media\&token=e9649bd4-ebd4-4b9d-b56e-0ac25e8b5e07)

Pangea adopted the design that separates the factory that creates the pool and the deployer that distributes the pool, as suggested by the Trident. By doing so, specification changes of the pool in the future became more flexible. And furthermore, implementing a customized pool according to the requirements of other DAPPs is made possible.

For example, rebasing tokens such as Ampleforth, whose total supply changes over time, were difficult to be accommodated with the existing pool spec. However, in Pangea, which separates the deployer and the factory, custom pools for such tokens can be developed and distributed according to the request of the protocol.

## Methods

### airdropDistributor

```solidity
function airdropDistributor() external nonpayable returns (address)
```

Returns Airdrop Distributor address

### deployPool

```solidity
function deployPool(address factory, bytes deployData) external nonpayable returns (address)
```

Creates pool through factory

### getFactoryAddress

```solidity
function getFactoryAddress(address pool) external view returns (address factory)
```

Returns the address of the Factory which deployed the pool

### getPoolAddress

```solidity
function getPoolAddress(uint256 idx) external view returns (address pool)
```

Return the address of the pool by index

### pools

```solidity
function pools(address pool) external view returns (bool)
```

Returns whether the pool was deployed via a deployer

### protocolFeeTo

Returns the address receiving protocol fees from Pool

```solidity
function protocolFeeTo() external view returns (address)
```

### totalPoolsCount

```solidity
function totalPoolsCount() external view returns (uint256 total)
```

Returns the number of pools deployed from the masterDeployer

## Events

### AddToWhitelistFactory

```solidity
event AddToWhitelistFactory(address indexed factory)
```

### DeployPool

```solidity
event DeployPool(address indexed factory, address indexed pool, bytes deployData)
```

### ProtocolFeeToUpdated

```solidity
event ProtocolFeeToUpdated(address protocolFeeTo)
```

### RemoveFromWhitelistFactory

```solidity
event RemoveFromWhitelistFactory(address indexed factory)
```
