Skip to content

Commit

Permalink
feat: update asset pool factory
Browse files Browse the repository at this point in the history
  • Loading branch information
bhargavaparoksham committed Jan 17, 2025
1 parent b9b8a77 commit d6cecd8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
12 changes: 5 additions & 7 deletions src/interfaces/IAssetPoolFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {ILPRegistry} from './ILPRegistry.sol';
* @dev Interface defining the structure of the PoolFactory contract.
* Responsible for creating and managing asset pools for liquidity provisioning.
*/
interface IPoolFactory {
interface IAssetPoolFactory {
/**
* @dev Emitted when a new asset pool is created.
* @param pool Address of the newly created pool.
Expand Down Expand Up @@ -46,20 +46,18 @@ interface IPoolFactory {

/**
* @dev Creates a new asset pool with the specified parameters.
* @param assetSymbol Symbol of the asset.
* @param assetTokenName Name of the token representing the asset.
* @param assetTokenSymbol Symbol of the token representing the asset.
* @param depositToken Address of the token used for deposits.
* @param assetName Name of the token representing the asset.
* @param assetSymbol Symbol of the token representing the asset.
* @param oracle Address of the oracle providing asset price feeds.
* @param cycleLength Length of each investment cycle in seconds.
* @param rebalancingPeriod Rebalancing period length within a cycle in seconds.
* @return address The address of the newly created asset pool.
*/
function createPool(
string memory assetSymbol,
string memory assetTokenName,
string memory assetTokenSymbol,
address depositToken,
string memory assetName,
string memory assetSymbol,
address oracle,
uint256 cycleLength,
uint256 rebalancingPeriod
Expand Down
20 changes: 9 additions & 11 deletions src/protocol/AssetPoolFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ pragma solidity ^0.8.20;

import 'openzeppelin-contracts/contracts/access/Ownable.sol';
import {ILPRegistry} from '../interfaces/ILPRegistry.sol';
import {IPoolFactory} from '../interfaces/IAssetPoolFactory.sol';
import {IAssetPoolFactory} from '../interfaces/IAssetPoolFactory.sol';
import {AssetPool} from './AssetPool.sol';

/**
* @title PoolFactory
* @dev Implementation of the IPoolFactory interface.
* @dev Implementation of the IAssetPoolFactory interface.
* Responsible for creating and registering asset pools for liquidity provisioning.
*/
contract PoolFactory is IPoolFactory, Ownable {
contract AssetPoolFactory is IAssetPoolFactory, Ownable {
/// @notice Reference to the LP Registry contract.
ILPRegistry public immutable lpRegistry;

Expand All @@ -35,20 +35,18 @@ contract PoolFactory is IPoolFactory, Ownable {
* - `cyclePeriod` is zero.
* - `rebalancingPeriod` is greater than or equal to `cyclePeriod`.
*
* @param assetSymbol Symbol of the asset.
* @param assetTokenName Name of the token representing the asset.
* @param assetTokenSymbol Symbol of the token representing the asset.
* @param depositToken Address of the token used for deposits.
* @param assetName Name of the token representing the asset.
* @param assetSymbol Symbol of the token representing the asset.
* @param oracle Address of the oracle providing asset price feeds.
* @param cyclePeriod Length of each investment cycle in seconds.
* @param rebalancingPeriod Length of the rebalancing period within a cycle in seconds.
* @return address The address of the newly created asset pool.
*/
function createPool(
string memory assetSymbol,
string memory assetTokenName,
string memory assetTokenSymbol,
address depositToken,
string memory assetName,
string memory assetSymbol,
address oracle,
uint256 cyclePeriod,
uint256 rebalancingPeriod
Expand All @@ -63,8 +61,8 @@ contract PoolFactory is IPoolFactory, Ownable {
// Deploy a new AssetPool contract instance.
AssetPool pool = new AssetPool(
depositToken,
assetTokenName,
assetTokenSymbol,
assetName,
assetSymbol,
oracle,
address(lpRegistry),
cyclePeriod,
Expand Down

0 comments on commit d6cecd8

Please sign in to comment.