Algebra Factory
Algebra factory
Is used to deploy pools and its plugins
Version: Algebra Integral
Inherits: IAlgebraFactory Ownable2Step AccessControlEnumerable
Public variables
POOLS_ADMINISTRATOR_ROLE
Selector: 0xb500a48b
role that can change communityFee and tickspacing in pools
poolDeployer
Selector: 0x3119049a
Returns the current poolDeployerAddress
communityVault
Selector: 0x53e97868
Returns the current communityVaultAddress
defaultCommunityFee
Selector: 0x2f8a39dd
Returns the default community fee
defaultFee
Selector: 0x5a6c72d0
Returns the default fee
defaultTickspacing
Selector: 0x29bc3446
Returns the default tickspacing
renounceOwnershipStartTimestamp
Selector: 0x084bfff9
defaultPluginFactory
Selector: 0xd0ad2792
Return the current pluginFactory 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
Selector: 0xdc6fd8ab
returns keccak256 of AlgebraPool init bytecode.
Developer note: keccak256 of AlgebraPool init bytecode. Used to compute pool address deterministically
Functions
constructor
Name | Type | Description |
---|---|---|
_poolDeployer | address |
owner
Selector: 0x8da5cb5b
Returns the current owner of the factory
Developer note: Can be changed by the current owner via transferOwnership(address newOwner)
Returns:
Name | Type | Description |
---|---|---|
[0] | address | The address of the factory owner |
hasRoleOrOwner
Selector: 0xe8ae2b69
Returns `true` if `account` has been granted `role` or `account` is owner.
Name | Type | Description |
---|---|---|
role | bytes32 | The hash corresponding to the role |
account | address | The address for which the role is checked |
Returns:
Name | Type | Description |
---|---|---|
[0] | bool | bool Whether the address has this role or the owner role or not |
defaultConfigurationForPool
Selector: 0x25b355d6
Returns the default communityFee and tickspacing
Returns:
Name | Type | Description |
---|---|---|
communityFee | uint16 | which will be set at the creation of the pool |
tickSpacing | int24 | which will be set at the creation of the pool |
fee | uint16 | which will be set at the creation of the pool |
computePoolAddress
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
Name | Type | Description |
---|---|---|
token0 | address | first token |
token1 | address | second token |
Returns:
Name | Type | Description |
---|---|---|
pool | address | The contract address of the Algebra pool |
createPool
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.
Name | Type | Description |
---|---|---|
tokenA | address | One of the two tokens in the desired pool |
tokenB | address | The other of the two tokens in the desired pool |
Returns:
Name | Type | Description |
---|---|---|
pool | address | The address of the newly created pool |
setDefaultCommunityFee
Selector: 0x8d5a8711
Developer note: updates default community fee for new pools
Name | Type | Description |
---|---|---|
newDefaultCommunityFee | uint16 | The new community fee, must be <= MAX_COMMUNITY_FEE |
setDefaultFee
Selector: 0x77326584
Developer note: updates default fee for new pools
Name | Type | Description |
---|---|---|
newDefaultFee | uint16 | The new fee, must be <= MAX_DEFAULT_FEE |
setDefaultTickspacing
Selector: 0xf09489ac
Developer note: updates default tickspacing for new pools
Name | Type | Description |
---|---|---|
newDefaultTickspacing | int24 | The new tickspacing, must be <= MAX_TICK_SPACING and >= MIN_TICK_SPACING |
setDefaultPluginFactory
Selector: 0x2939dd97
Developer note: updates pluginFactory address
Name | Type | Description |
---|---|---|
newDefaultPluginFactory | address | address of new plugin factory |
startRenounceOwnership
Selector: 0x469388c4
Starts process of renounceOwnership. After that, a certain period of time must pass before the ownership renounce can be completed.
stopRenounceOwnership
Selector: 0x238a1d74
Stops process of renounceOwnership and removes timer.
renounceOwnership
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
Emitted when a process of ownership renounce is started
Name | Type | Description |
---|---|---|
timestamp | uint256 | The timestamp of event |
finishTimestamp | uint256 | The timestamp when ownership renounce will be possible to finish |
RenounceOwnershipStop
Emitted when a process of ownership renounce cancelled
Name | Type | Description |
---|---|---|
timestamp | uint256 | The timestamp of event |
RenounceOwnershipFinish
Emitted when a process of ownership renounce finished
Name | Type | Description |
---|---|---|
timestamp | uint256 | The timestamp of ownership renouncement |
Pool
Emitted when a pool is created
Name | Type | Description |
---|---|---|
token0 | address | The first token of the pool by address sort order |
token1 | address | The second token of the pool by address sort order |
pool | address | The address of the created pool |
DefaultCommunityFee
Emitted when the default community fee is changed
Name | Type | Description |
---|---|---|
newDefaultCommunityFee | uint16 | The new default community fee value |
DefaultTickspacing
Emitted when the default tickspacing is changed
Name | Type | Description |
---|---|---|
newDefaultTickspacing | int24 | The new default tickspacing value |
DefaultFee
Emitted when the default fee is changed
Name | Type | Description |
---|---|---|
newDefaultFee | uint16 | The new default fee value |
DefaultPluginFactory
Emitted when the defaultPluginFactory address is changed
Name | Type | Description |
---|---|---|
defaultPluginFactoryAddress | address | The new defaultPluginFactory address |