Algebra factory
Is used to deploy pools and its dataStorages
Developer note: Version: Algebra V2
role that can change communityFee and tickspacing in pools
Returns the current poolDeployerAddress
Returns the current communityVaultAddress
Developer note: Is retrieved from the pools to restrict calling certain functions not by a tokenomics contract
Returns the default community fee
Developer note: values of constants for sigmoids in fee calculation formula
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
constructor(address _poolDeployer) public public
| Name | Type | Description |
|---|---|---|
| _poolDeployer | address |
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:
| Name | Type | Description |
|---|---|---|
| [0] | address | The address of the factory owner |
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.
| Name | Type | Description |
|---|---|---|
| role | bytes32 | |
| account | address |
Returns:
| Name | Type | Description |
|---|---|---|
| [0] | bool |
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.
| 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 |
function setFarmingAddress(address newFarmingAddress) external external
Developer note: updates tokenomics address on the factory
| Name | Type | Description |
|---|---|---|
| newFarmingAddress | address | The new tokenomics contract address |
function setDefaultCommunityFee(uint8 newDefaultCommunityFee) external external
Developer note: updates default community fee for new pools
| Name | Type | Description |
|---|---|---|
| newDefaultCommunityFee | uint8 | The new community fee, must be <= MAX_COMMUNITY_FEE |
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
| Name | Type | Description |
|---|---|---|
| newConfig | struct AlgebraFeeConfiguration | new default fee configuration. See the #AdaptiveFee.sol library for details |
function startRenounceOwnership() external external
Starts process of renounceOwnership. After that, a certain period of time must pass before the ownership renounce can be completed.
function stopRenounceOwnership() external external
Stops process of renounceOwnership and removes timer.
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.