ownership & killable

This commit is contained in:
tim
2025-10-19 13:35:33 -04:00
parent 5aa0032be0
commit d55be28cba
18 changed files with 364 additions and 176 deletions

View File

@@ -8,38 +8,38 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/// @title IPartyPlanner
/// @notice Interface for factory contract for creating and tracking PartyPool instances
interface IPartyPlanner {
interface IPartyPlanner is IOwnable {
// Event emitted when a new pool is created
event PartyStarted(IPartyPool indexed pool, string name, string symbol, IERC20[] tokens);
/// @notice Creates a new PartyPool instance and initializes it with initial deposits (legacy signature).
/// @dev Deprecated in favour of the kappa-based overload below; kept for backwards compatibility.
/// @param name_ LP token name
/// @param symbol_ LP token symbol
/// @param _tokens token addresses (n)
/// @param _bases scaling _bases for each token (n) - used when converting to/from internal 64.64 amounts
/// @param _tradeFrac trade fraction in 64.64 fixed-point (as used by LMSR)
/// @param _targetSlippage target slippage in 64.64 fixed-point (as used by LMSR)
/// @param _swapFeePpm fee in parts-per-million, taken from swap input amounts before LMSR calculations
/// @param _flashFeePpm fee in parts-per-million, taken for flash loans
/// @param _stable if true and assets.length==2, then the optimization for 2-asset stablecoin pools is activated
/// @param name LP token name
/// @param symbol LP token symbol
/// @param tokens token addresses (n)
/// @param bases scaling bases for each token (n) - used when converting to/from internal 64.64 amounts
/// @param tradeFrac trade fraction in 64.64 fixed-point (as used by LMSR)
/// @param targetSlippage target slippage in 64.64 fixed-point (as used by LMSR)
/// @param swapFeePpm fee in parts-per-million, taken from swap input amounts before LMSR calculations
/// @param flashFeePpm fee in parts-per-million, taken for flash loans
/// @param stable if true and assets.length==2, then the optimization for 2-asset stablecoin pools is activated
/// @param payer address that provides the initial token deposits
/// @param receiver address that receives the minted LP _tokens
/// @param receiver address that receives the minted LP tokens
/// @param initialDeposits amounts of each token to deposit initially
/// @param deadline Reverts if nonzero and the current blocktime is later than the deadline
/// @return pool Address of the newly created and initialized PartyPool
/// @return lpAmount Amount of LP _tokens minted to the receiver
/// @return lpAmount Amount of LP tokens minted to the receiver
function newPool(
// Pool constructor args (legacy)
string memory name_,
string memory symbol_,
IERC20[] memory _tokens,
uint256[] memory _bases,
int128 _tradeFrac,
int128 _targetSlippage,
uint256 _swapFeePpm,
uint256 _flashFeePpm,
bool _stable,
string memory name,
string memory symbol,
IERC20[] memory tokens,
uint256[] memory bases,
int128 tradeFrac,
int128 targetSlippage,
uint256 swapFeePpm,
uint256 flashFeePpm,
bool stable,
// Initial deposit information
address payer,
address receiver,
@@ -49,30 +49,30 @@ interface IPartyPlanner {
) external returns (IPartyPool pool, uint256 lpAmount);
/// @notice Creates a new PartyPool instance and initializes it with initial deposits (kappa-based).
/// @param name_ LP token name
/// @param symbol_ LP token symbol
/// @param _tokens token addresses (n)
/// @param _bases scaling _bases for each token (n) - used when converting to/from internal 64.64 amounts
/// @param _kappa liquidity parameter κ in 64.64 fixed-point used to derive b = κ * S(q)
/// @param _swapFeePpm fee in parts-per-million, taken from swap input amounts before LMSR calculations
/// @param _flashFeePpm fee in parts-per-million, taken for flash loans
/// @param _stable if true and assets.length==2, then the optimization for 2-asset stablecoin pools is activated
/// @param name LP token name
/// @param symbol LP token symbol
/// @param tokens token addresses (n)
/// @param bases scaling bases for each token (n) - used when converting to/from internal 64.64 amounts
/// @param kappa liquidity parameter κ in 64.64 fixed-point used to derive b = κ * S(q)
/// @param swapFeePpm fee in parts-per-million, taken from swap input amounts before LMSR calculations
/// @param flashFeePpm fee in parts-per-million, taken for flash loans
/// @param stable if true and assets.length==2, then the optimization for 2-asset stablecoin pools is activated
/// @param payer address that provides the initial token deposits
/// @param receiver address that receives the minted LP _tokens
/// @param receiver address that receives the minted LP tokens
/// @param initialDeposits amounts of each token to deposit initially
/// @param deadline Reverts if nonzero and the current blocktime is later than the deadline
/// @return pool Address of the newly created and initialized PartyPool
/// @return lpAmount Amount of LP _tokens minted to the receiver
/// @return lpAmount Amount of LP tokens minted to the receiver
function newPool(
// Pool constructor args (kappa-based)
string memory name_,
string memory symbol_,
IERC20[] memory _tokens,
uint256[] memory _bases,
int128 _kappa,
uint256 _swapFeePpm,
uint256 _flashFeePpm,
bool _stable,
string memory name,
string memory symbol,
IERC20[] memory tokens,
uint256[] memory bases,
int128 kappa,
uint256 swapFeePpm,
uint256 flashFeePpm,
bool stable,
// Initial deposit information
address payer,
address receiver,
@@ -96,8 +96,8 @@ interface IPartyPlanner {
/// @return pools Array of pool addresses for the requested page
function getAllPools(uint256 offset, uint256 limit) external view returns (IPartyPool[] memory pools);
/// @notice Returns the total number of unique _tokens
/// @return The total count of unique _tokens
/// @notice Returns the total number of unique tokens
/// @return The total count of unique tokens
function tokenCount() external view returns (uint256);
/// @notice Retrieves a page of token addresses