Algebra Factory

Algebra factory

Is used to deploy pools and its plugins

Version: Algebra Integral

Inherits: IAlgebraFactory Ownable2Step AccessControlEnumerable

Public variables

POOLS_ADMINISTRATOR_ROLE

bytes32 constant POOLS_ADMINISTRATOR_ROLE = 0xb73ce166ead2f8e9add217713a7989e4edfba9625f71dfd2516204bb67ad3442

Selector: 0xb500a48b

role that can change communityFee and tickspacing in pools

poolDeployer

address immutable poolDeployer

Selector: 0x3119049a

Returns the current poolDeployerAddress

communityVault

address immutable communityVault

Selector: 0x53e97868

Returns the current communityVaultAddress

defaultCommunityFee

uint16 defaultCommunityFee

Selector: 0x2f8a39dd

Returns the default community fee

defaultFee

uint16 defaultFee

Selector: 0x5a6c72d0

Returns the default fee

defaultTickspacing

int24 defaultTickspacing

Selector: 0x29bc3446

Returns the default tickspacing

renounceOwnershipStartTimestamp

uint256 renounceOwnershipStartTimestamp

Selector: 0x084bfff9

defaultPluginFactory

contract IAlgebraPluginFactory defaultPluginFactory

Selector: 0xd0ad2792

Return the current pluginFactory address

poolByPair

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

Selector: 0xd9a641e1

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

POOL_INIT_CODE_HASH

bytes32 constant POOL_INIT_CODE_HASH = 0x177d5fbf994f4d130c008797563306f1a168dc689f81b2fa23b4396931014d91

Selector: 0xdc6fd8ab

returns keccak256 of AlgebraPool init bytecode.

Developer note: keccak256 of AlgebraPool init bytecode. Used to compute pool address deterministically

Functions

constructor

constructor(address _poolDeployer) public

owner

function owner() public view returns (address)

Selector: 0x8da5cb5b

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)

Selector: 0xe8ae2b69

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

Returns:

defaultConfigurationForPool

function defaultConfigurationForPool() external view returns (uint16 communityFee, int24 tickSpacing, uint16 fee)

Selector: 0x25b355d6

Returns the default communityFee and tickspacing

Returns:

computePoolAddress

function computePoolAddress(address token0, address token1) public view returns (address pool)

Selector: 0xd8ed2241

Deterministically computes the pool address given the token0 and token1

Developer note: The method does not check if such a pool has been created

Returns:

createPool

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

Selector: 0xe3433615

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:

setDefaultCommunityFee

function setDefaultCommunityFee(uint16 newDefaultCommunityFee) external

Selector: 0x8d5a8711

Developer note: updates default community fee for new pools

setDefaultFee

function setDefaultFee(uint16 newDefaultFee) external

Selector: 0x77326584

Developer note: updates default fee for new pools

setDefaultTickspacing

function setDefaultTickspacing(int24 newDefaultTickspacing) external

Selector: 0xf09489ac

Developer note: updates default tickspacing for new pools

setDefaultPluginFactory

function setDefaultPluginFactory(address newDefaultPluginFactory) external

Selector: 0x2939dd97

Developer note: updates pluginFactory address

startRenounceOwnership

function startRenounceOwnership() external

Selector: 0x469388c4

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

stopRenounceOwnership

function stopRenounceOwnership() external

Selector: 0x238a1d74

Stops process of renounceOwnership and removes timer.

renounceOwnership

function renounceOwnership() public

Selector: 0x715018a6

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.

Events

RenounceOwnershipStart

event RenounceOwnershipStart(uint256 timestamp, uint256 finishTimestamp)

Emitted when a process of ownership renounce is started

RenounceOwnershipStop

event RenounceOwnershipStop(uint256 timestamp)

Emitted when a process of ownership renounce cancelled

RenounceOwnershipFinish

event RenounceOwnershipFinish(uint256 timestamp)

Emitted when a process of ownership renounce finished

Pool

event Pool(address token0, address token1, address pool)

Emitted when a pool is created

DefaultCommunityFee

event DefaultCommunityFee(uint16 newDefaultCommunityFee)

Emitted when the default community fee is changed

DefaultTickspacing

event DefaultTickspacing(int24 newDefaultTickspacing)

Emitted when the default tickspacing is changed

DefaultFee

event DefaultFee(uint16 newDefaultFee)

Emitted when the default fee is changed

DefaultPluginFactory

event DefaultPluginFactory(address defaultPluginFactoryAddress)

Emitted when the defaultPluginFactory address is changed