# MasterDeployer

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

## Overview

![](/files/7sOKecucf0cwEQfuZvay)

Pangea는 Trident가 제시한 방향인 Pool을 생성하는 Factory와 배포하는 Deployer를 분리하는 설계를 채택하였습니다. 이렇게 함으로써 향후 Pool의 스펙을 변경함에 있어서 자유로워지고, 더 나아가 다른 DAPP의 요구사항에 따라 맞춤형 Pool을 구현할 수 있습니다.&#x20;

예를 들어, 시간에 따라 total Supply가 변화하는 Ampleforth와 같은 Rebasing Token 토큰들은 기존의 Pool spec으로서는 수용하기 어려웠습니다. 하지만 Deployer와 Factory를 분리한 Pangea에서는 프로토콜의 요청 사항에 따라 맞춤형으로 Pool Factory를 개발하여 맞춤형 Pool들을 배포할 수 있습니다.

## 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)
```


---

# 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://pangeaswap.gitbook.io/pangeaswap/developers/contracts/core-contracts/masterdeployer.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.
