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

@@ -25,7 +25,7 @@ contract PartyPoolMintImpl is PartyPoolBase {
// Initialization Mint
//
function initialMint(address receiver, uint256 lpTokens, int128 KAPPA) external payable native nonReentrant
function initialMint(address receiver, uint256 lpTokens, int128 KAPPA) external payable native killable nonReentrant
returns (uint256 lpMinted) {
uint256 n = _tokens.length;
@@ -65,7 +65,7 @@ contract PartyPoolMintImpl is PartyPoolBase {
// Regular Mint and Burn
//
function mint(address payer, address receiver, uint256 lpTokenAmount, uint256 deadline) external payable native nonReentrant
function mint(address payer, address receiver, uint256 lpTokenAmount, uint256 deadline) external payable native killable nonReentrant
returns (uint256 lpMinted) {
require(deadline == 0 || block.timestamp <= deadline, "mint: deadline exceeded");
uint256 n = _tokens.length;
@@ -131,7 +131,8 @@ contract PartyPoolMintImpl is PartyPoolBase {
return actualLpToMint;
}
/// @notice Burn LP _tokens and withdraw the proportional basket to receiver.
/// @notice Burn LP _tokens and withdraw the proportional basket to receiver. Functional even if the pool has been
/// killed.
/// @dev Payer must own or approve the LP _tokens being burned. The function updates LMSR state
/// proportionally to reflect the reduced pool size after the withdrawal.
/// @param payer address that provides the LP _tokens to burn
@@ -345,7 +346,7 @@ contract PartyPoolMintImpl is PartyPoolBase {
uint256 deadline,
uint256 swapFeePpm,
uint256 protocolFeePpm
) external payable native nonReentrant returns (uint256 lpMinted) {
) external payable native killable nonReentrant returns (uint256 lpMinted) {
uint256 n = _tokens.length;
require(inputTokenIndex < n, "swapMint: idx");
require(maxAmountIn > 0, "swapMint: input zero");
@@ -468,6 +469,8 @@ contract PartyPoolMintImpl is PartyPoolBase {
}
/// @notice Burn LP _tokens then swap the redeemed proportional basket into a single asset `inputTokenIndex` and send to receiver.
/// This version of burn does not work if the vault has been killed, because it involves a swap. Use regular burn()
/// to recover funds if the pool has been killed.
/// @dev The function burns LP _tokens (authorization via allowance if needed), sends the single-asset payout and updates LMSR state.
/// @param payer who burns LP _tokens
/// @param receiver who receives the single asset
@@ -485,7 +488,7 @@ contract PartyPoolMintImpl is PartyPoolBase {
bool unwrap,
uint256 swapFeePpm,
uint256 protocolFeePpm
) external nonReentrant returns (uint256 amountOutUint) {
) external nonReentrant killable returns (uint256 amountOutUint) {
uint256 n = _tokens.length;
require(inputTokenIndex < n, "burnSwap: idx");
require(lpAmount > 0, "burnSwap: zero lp");