PartyPoolMintImpl

This commit is contained in:
tim
2025-09-26 11:48:01 -04:00
parent 9cac58013b
commit 28b9474363
5 changed files with 264 additions and 134 deletions

View File

@@ -7,6 +7,7 @@ import "./LMSRStabilized.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {PartyPoolSwapMintImpl} from "./PartyPoolSwapMintImpl.sol";
import {PartyPoolMintImpl} from "./PartyPoolMintImpl.sol";
/// @title PartyPlanner
/// @notice Factory contract for creating and tracking PartyPool instances
@@ -17,6 +18,9 @@ contract PartyPlanner is IPartyPlanner {
/// @notice Address of the SwapMint implementation contract used by all pools created by this factory
address public immutable swapMintImpl;
/// @notice Address of the Mint implementation contract used by all pools created by this factory
address public immutable mintImpl;
// On-chain pool indexing
PartyPool[] private _allPools;
IERC20[] private _allTokens;
@@ -25,9 +29,12 @@ contract PartyPlanner is IPartyPlanner {
mapping(IERC20 => PartyPool[]) private _poolsByToken;
/// @param _swapMintImpl address of the SwapMint implementation contract to be used by all pools
constructor(PartyPoolSwapMintImpl _swapMintImpl) {
require(address(_swapMintImpl) != address(0), "Planner: impl address cannot be zero");
/// @param _mintImpl address of the Mint implementation contract to be used by all pools
constructor(PartyPoolSwapMintImpl _swapMintImpl, PartyPoolMintImpl _mintImpl) {
require(address(_swapMintImpl) != address(0), "Planner: swapMintImpl address cannot be zero");
swapMintImpl = address(_swapMintImpl);
require(address(_mintImpl) != address(0), "Planner: mintImpl address cannot be zero");
mintImpl = address(_mintImpl);
}
/// Main newPool variant: accepts kappa directly (preferred).
@@ -67,7 +74,8 @@ contract PartyPlanner is IPartyPlanner {
_swapFeePpm,
_flashFeePpm,
_stable,
PartyPoolSwapMintImpl(swapMintImpl)
PartyPoolSwapMintImpl(swapMintImpl),
mintImpl
);
_allPools.push(pool);