Skip to main content

StablePoolFactory

The StablePoolFactory is responsible for creation of Stable pools.

The full contract can be found here

Read-Only Functions

getDeployData

function getDeployData() external view override returns (bytes memory, IMasterDeployerV2);

Returns the cached deploy data and the master deployer.

Returns

NameTypeDescription
bytesbytes memoryThe cached deployment data.
IMasterDeployerV2IMasterDeployerV2The master deployer contract.

Modifiers

This function is marked as a view, which means it doesn't modify the contract state.


calculatePoolAddress

function calculatePoolAddress(
address token0,
address token1,
uint256 swapFee
) external view returns (address);

Calculates the address of a pool given token addresses and a swap fee.

Parameters

NameTypeDescription
token0addressaddress for one of the tokens in the pair
token1addressaddress for the other token in the pair
swapFeeuint256fee for swapping tokens in the pool

Returns

NameTypeDescription
addressaddressCalculated pool address

Modifiers

This function is marked as a view, which means it doesn't modify the contract state.

State-Changing Functions

deployPool

function deployPool(bytes memory _deployData) external returns (address pool);

Deploys a new StablePool with the given parameters.

  • tokenA and tokenB are the two tokens of the pool.
  • swapFee is the fee for swapping tokens in the pool.

Parameters

NameTypeDescription
_deployDatabytesencoded tokenA, tokenB, and swapFee

Returns

NameTypeDescription
pooladdressaddress of the newly deployed StablePool

Modifiers

This function does not have any explicit modifiers.

Events

This function does not emit any events.