AlgebraFactory

Algebra factory

Is used to deploy pools and its dataStorages

Developer note: Version: Algebra V2-directional-fee

Variables

bytes32 POOLS_ADMINISTRATOR_ROLE constant

role that can change communityFee and tickspacing in pools

address poolDeployer immutable

Returns the current poolDeployerAddress

address communityVault immutable

Returns the current communityVaultAddress

address farmingAddress

Developer note: Is retrieved from the pools to restrict calling certain functions not by a tokenomics contract

uint8 defaultCommunityFee

Returns the default community fee

uint256 renounceOwnershipStartTimestamp

struct AlgebraFeeConfiguration defaultFeeConfiguration

Developer note: values of constants for sigmoids in fee calculation formula

mapping(address => mapping(address => address)) poolByPair

Returns the pool address for a given pair of tokens, or address 0 if it does not exist

Developer note: tokenA and tokenB may be passed in either token0/token1 or token1/token0 order

Functions

constructor

constructor(address _poolDeployer) public public

owner

function owner() public view returns (address) view public

Returns the current owner of the factory Developer note: Can be changed by the current owner via transferOwnership(address newOwner)

Returns:

hasRoleOrOwner

function hasRoleOrOwner(bytes32 role, address account) public view returns (bool) view public

Developer note: Returns `true` if `account` has been granted `role` or `account` is owner.

Returns:

createPool

function createPool(address tokenA, address tokenB) external returns (address pool) external

Creates a pool for the given two tokens Developer note: tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. The call will revert if the pool already exists or the token arguments are invalid.

Returns:

setFarmingAddress

function setFarmingAddress(address newFarmingAddress) external external

Developer note: updates tokenomics address on the factory

setDefaultCommunityFee

function setDefaultCommunityFee(uint8 newDefaultCommunityFee) external external

Developer note: updates default community fee for new pools

setDefaultFeeConfiguration

function setDefaultFeeConfiguration(struct AlgebraFeeConfiguration newConfig) external external

Changes initial fee configuration for new pools Developer note: changes coefficients for sigmoids: Îą / (1 + e^( (β-x) / Îŗ)) alpha1 + alpha2 + baseFee (max possible fee) must be <= type(uint16).max and gammas must be > 0

startRenounceOwnership

function startRenounceOwnership() external external

Starts process of renounceOwnership. After that, a certain period of time must pass before the ownership renounce can be completed.

stopRenounceOwnership

function stopRenounceOwnership() external external

Stops process of renounceOwnership and removes timer.

renounceOwnership

function renounceOwnership() public public

Developer note: Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner if RENOUNCE_OWNERSHIP_DELAY seconds have passed since the call to the startRenounceOwnership() function.