> For the complete documentation index, see [llms.txt](https://fluxion-network.gitbook.io/fluxion-network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fluxion-network.gitbook.io/fluxion-network/developer-resources/technical-overview-and-api/amm-v2-factoryregistry.md).

# amm v2 factoryregistry

## Overview

Registry of approved factories that can be used by protocol routing and gauge flows.

* **Contract:** `FactoryRegistry`
* **Address:** `0x47c401407F11482d562E2c00b67944c379fD8710`
* **Network:** Mantle Mainnet (chainId `5000`)
* Explorer: [`Mantle Explorer`](https://explorer.mantle.xyz/address/0x47c401407F11482d562E2c00b67944c379fD8710)
* Explorer API: [`smart-contract payload`](https://explorer.mantle.xyz/api/v2/smart-contracts/0x47c401407F11482d562E2c00b67944c379fD8710)
* Sourcify metadata: [`metadata.json`](https://repo.sourcify.dev/contracts/full_match/5000/0x47c401407F11482d562E2c00b67944c379fD8710/metadata.json)
* Sourcify source: [`contracts/factories/FactoryRegistry.sol`](https://repo.sourcify.dev/contracts/full_match/5000/0x47c401407F11482d562E2c00b67944c379fD8710/sources/contracts/factories/FactoryRegistry.sol)

## Read Functions

### factoriesToPoolFactory

```solidity
function factoriesToPoolFactory(address poolFactory) external view returns (address votingRewardsFactory, address gaugeFactory)
```

Get the factories correlated to a poolFactory. Once set, this can never be modified. Returns the correlated factories even after an approved poolFactory is unapproved.

Parameters:

* `poolFactory` (address): Not documented in NatSpec.

Returns:

* `votingRewardsFactory` (address): Not documented in NatSpec.
* `gaugeFactory` (address): Not documented in NatSpec.

***

### fallbackPoolFactory

```solidity
function fallbackPoolFactory() external view returns (address return0)
```

Reads contract state.

This function does not take parameters.

Returns:

* `return0` (address): Not documented in NatSpec.

***

### isPoolFactoryApproved

```solidity
function isPoolFactoryApproved(address poolFactory) external view returns (bool return0)
```

Check if a PoolFactory is approved within the factory registry. Router uses this method to ensure a pool swapped from is approved.

Parameters:

* `poolFactory` (address): .

Returns:

* `return0` (bool): True if PoolFactory is approved, else false

***

### owner

```solidity
function owner() external view returns (address return0)
```

Returns the address of the current owner.

This function does not take parameters.

Returns:

* `return0` (address): Not documented in NatSpec.

***

### poolFactories

```solidity
function poolFactories() external view returns (address[] return0)
```

Get all PoolFactories approved by the registry

This function does not take parameters.

Returns:

* `return0` (address\[]): Array of PoolFactory addresses

***

### poolFactoriesLength

```solidity
function poolFactoriesLength() external view returns (uint256 return0)
```

Get the length of the poolFactories array

This function does not take parameters.

Returns:

* `return0` (uint256): Not documented in NatSpec.

## Write Functions

### approve

```solidity
function approve(address poolFactory, address votingRewardsFactory, address gaugeFactory) external
```

Approve a set of factories used in the Protocol. Router.sol is able to swap any poolFactories currently approved. Cannot approve address(0) factories. Cannot aprove path that is already approved. Each poolFactory has one unique set and maintains state. In the case a poolFactory is unapproved and then re-approved, the same set of factories must be used. In other words, you cannot overwrite the factories tied to a poolFactory address. VotingRewardsFactories and GaugeFactories may use the same address across multiple poolFactories.

Parameters:

* `poolFactory` (address): .
* `votingRewardsFactory` (address): .
* `gaugeFactory` (address): .

This function does not return a value.

***

### renounceOwnership

```solidity
function renounceOwnership() external
```

Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner.

NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.

This function does not take parameters and does not return a value.

***

### transferOwnership

```solidity
function transferOwnership(address newOwner) external
```

Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.

Parameters:

* `newOwner` (address): Not documented in NatSpec.

This function does not return a value.

***

### unapprove

```solidity
function unapprove(address poolFactory) external
```

Unapprove a set of factories used in the Protocol. While a poolFactory is unapproved, Router.sol cannot swap with pools made from the corresponding factory. Can only unapprove an approved path. Cannot unapprove the fallback path (core v2 factories).

Parameters:

* `poolFactory` (address): .

This function does not return a value.
