diff --git a/contracts/factory/README.md b/contracts/factory/README.md index 08e10ec47..87fe8feeb 100644 --- a/contracts/factory/README.md +++ b/contracts/factory/README.md @@ -1,115 +1,88 @@ -# FACTORY +#Dex Factory ## Main functionality -```The main purpose of the factory contract is to provide the tooling required for managing, creating, querying of liquidity pools.``` +The main purpose of the factory contract is to provide the tooling required for managing, creating, querying of liquidity pools. +## Messages -## Main methods: -#### 1. initialize +`initialize` -**params:** -* admin: `Address` of the contract administrator to be -* multihop_wasm_hash: `BytesN<32>` hash of the multihop contract to be deployed initially - -**return type:** - void - -**description:** -Used for the initialization of the factory contract - this sets the factory contract as initialized, deploys a multihop contract and sets up the initial factory configuration. The configuration includes admin and address of multihop contract +Params: +- `admin`: `Address` of the contract administrator to be +- `multihop_wasm_hash`: `BytesN<32>` hash of the multihop contract to be deployed initially
-#### 2. create_liquidity_pool -**params:** +`create_liquidity_pool` -* lp_init_info: `LiquidityPoolInitInfo` struct representing information for the new liquidity pool +Params: +- `lp_init_info`: `LiquidityPoolInitInfo` struct representing information for the new liquidity pool -**return type:** +Return type: `Address` of the newly created liquidity pool -**description:** +Description: + Creates a new liquidity pool with 'LiquidityPoolInitInfo'. After deployment of the liquidity pool it updates the liquidity pool list.
-#### 3. query_pools - -**params:** - * None +`query_pools` -**return type:** +Return type: `Vec
` of all the liquidity pools created by the factory -**description:** +Description: Queries for a list of all the liquidity pool addresses that have been created by the called factory contract.
-#### 4. query_pool_details +`query_pool_details` -**params:** +Params: +- `pool_address`: `Address` of the liquidity pool we search for -* pool_address: `Address` of the liquidity pool we search for +Return type: +Struct `LiquidityPoolInfo` containing the information about a given liquidity pool. -**return type:** -`LiquidityPoolInfo` Struct containing the information about a given liquidity pool. - -**description:** +Description: Queries for specific liquidity pool information that has been created by the called factory contract.
-#### 5. query_all_pools_details - -**params:** - -* None +`query_all_pools_details` -**return type:** -`Vec` List of structs containing the information about all liquidity pools created by the factory. +Return type: +`Vec` list of structs containing the information about all liquidity pools created by the factory. -**description:** +Description: Queries for all liquidity pools information that have been created by the called factory contract.
-#### 6. query_for_pool_by_token_pair(env: Env, token_a: Address, token_b: Address) -> Address; +`query_for_pool_by_token_pair(env: Env, token_a: Address, token_b: Address)`; -**params:** +Params: +- token_a: `Address` of the first token in the pool +- token_b: `Address` of the second token in the pool -* token_a: `Address` of the first token in the pool -* token_b: `Address` of the second token in the pool - -**return type:** +Return type: `Address` of the found liquidity pool that holds the given token pair. -**description:** +Description: Queries for a liquidity pool address by the tokens of that pool.
-#### 7. get_admin - -**params:** - -* None +`get_admin` -**return type:** +Return type: `Address` of the admin for the called factory. -**description:** -Queries for admin address of the called factory contract
-#### 8. get_config - -**params:** - -* None - -**return type:** -`Config` of the called factory. +`get_config` -**description:** -Queries for the config of the called factory contract +Return type: +Struct `Config` of the called factory.