deployed to Sepolia; liqp-deployments.json

This commit is contained in:
tim
2025-10-16 16:16:41 -04:00
parent 38371614fc
commit e948067167
18 changed files with 304 additions and 64 deletions

View File

@@ -2,7 +2,7 @@
pragma solidity ^0.8.30;
import "../lib/openzeppelin-contracts/contracts/interfaces/IERC3156FlashBorrower.sol";
import "./IWETH9.sol";
import "./NativeWrapper.sol";
import "./LMSRStabilized.sol";
import {IERC20Metadata} from "../lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {IERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
@@ -72,7 +72,7 @@ interface IPartyPool is IERC20Metadata {
function allTokens() external view returns (IERC20[] memory);
/// @notice Token contract used for wrapping native currency
function wrapperToken() external view returns (IWETH9);
function wrapperToken() external view returns (NativeWrapper);
/// @notice Per-token uint base denominators used to convert uint token amounts <-> internal Q64.64 representation.
/// @dev denominators()[i] is the base for _tokens[i]. These _bases are chosen by deployer and must match token decimals.

View File

@@ -873,7 +873,7 @@ library LMSRStabilized {
/// @notice Internal helper to compute kappa from slippage parameters.
/// @dev Returns κ in Q64.64. Implemented as internal so callers within the library can use it
/// without resorting to external calls.
function _computeKappaFromSlippage(
function computeKappaFromSlippage(
uint256 nAssets,
int128 tradeFrac,
int128 targetSlippage
@@ -920,16 +920,6 @@ library LMSRStabilized {
return kappa;
}
/// @notice Compute kappa from slippage parameters.
/// @dev External wrapper that delegates to internal implementation.
function computeKappaFromSlippage(
uint256 nAssets,
int128 tradeFrac,
int128 targetSlippage
) external pure returns (int128) {
return _computeKappaFromSlippage(nAssets, tradeFrac, targetSlippage);
}
/// @notice Legacy-compatible init: compute kappa from slippage parameters and delegate to kappa-based init.
/// @dev Provides backward compatibility for callers that still use the (q, tradeFrac, targetSlippage) init signature.
function init(
@@ -939,7 +929,7 @@ library LMSRStabilized {
int128 targetSlippage
) internal {
// compute kappa using the internal helper
int128 kappa = _computeKappaFromSlippage(initialQInternal.length, tradeFrac, targetSlippage);
int128 kappa = computeKappaFromSlippage(initialQInternal.length, tradeFrac, targetSlippage);
// forward to the new kappa-based init
init(s, initialQInternal, kappa);
}

View File

@@ -4,7 +4,7 @@ pragma solidity ^0.8.30;
import {IERC20Metadata} from "../lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol";
interface IWETH9 is IERC20Metadata {
interface NativeWrapper is IERC20Metadata {
function deposit() external payable;
function withdraw(uint wad) external;
}

View File

@@ -5,7 +5,7 @@ import {IERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20
import {SafeERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import {IPartyPlanner} from "./IPartyPlanner.sol";
import {IPartyPool} from "./IPartyPool.sol";
import {IWETH9} from "./IWETH9.sol";
import {NativeWrapper} from "./NativeWrapper.sol";
import {LMSRStabilized} from "./LMSRStabilized.sol";
import {IPartyPoolDeployer} from "./PartyPoolDeployer.sol";
import {PartyPoolMintImpl} from "./PartyPoolMintImpl.sol";
@@ -33,8 +33,8 @@ contract PartyPlanner is IPartyPlanner {
address private immutable PROTOCOL_FEE_ADDRESS;
function protocolFeeAddress() external view returns (address) { return PROTOCOL_FEE_ADDRESS; }
IWETH9 private immutable WRAPPER;
function wrapper() external view returns (IWETH9) { return WRAPPER; }
NativeWrapper private immutable WRAPPER;
function wrapper() external view returns (NativeWrapper) { return WRAPPER; }
IPartyPoolDeployer private immutable NORMAL_POOL_DEPLOYER;
IPartyPoolDeployer private immutable BALANCED_PAIR_DEPLOYER;
@@ -51,7 +51,7 @@ contract PartyPlanner is IPartyPlanner {
/// @param _protocolFeePpm protocol fee share (ppm) to be used for pools created by this planner
/// @param _protocolFeeAddress recipient address for protocol fees for pools created by this planner (may be address(0))
constructor(
IWETH9 _wrapper,
NativeWrapper _wrapper,
PartyPoolSwapImpl _swapImpl,
PartyPoolMintImpl _mintImpl,
IPartyPoolDeployer _deployer,

View File

@@ -17,7 +17,7 @@ import {Proxy} from "../lib/openzeppelin-contracts/contracts/proxy/Proxy.sol";
import {ReentrancyGuard} from "../lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol";
import {SafeERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC3156FlashLender} from "../lib/openzeppelin-contracts/contracts/interfaces/IERC3156FlashLender.sol";
import {IWETH9} from "./IWETH9.sol";
import {NativeWrapper} from "./NativeWrapper.sol";
/// @title PartyPool - LMSR-backed multi-asset pool with LP ERC20 token
/// @notice A multi-asset liquidity pool backed by the LMSRStabilized pricing model.
@@ -39,7 +39,7 @@ contract PartyPool is PartyPoolBase, ERC20External, IPartyPool {
receive() external payable {}
function wrapperToken() external view returns (IWETH9) { return WRAPPER_TOKEN; }
function wrapperToken() external view returns (NativeWrapper) { return WRAPPER_TOKEN; }
/// @notice Liquidity parameter κ (Q64.64) used by the LMSR kernel: b = κ * S(q)
/// @dev Pool is constructed with a fixed κ. Clients that previously passed tradeFrac/targetSlippage
@@ -109,7 +109,7 @@ contract PartyPool is PartyPoolBase, ERC20External, IPartyPool {
uint256 flashFeePpm_,
uint256 protocolFeePpm_,
address protocolFeeAddress_,
IWETH9 wrapperToken_,
NativeWrapper wrapperToken_,
PartyPoolSwapImpl swapImpl_,
PartyPoolMintImpl mintImpl_
)

View File

@@ -2,7 +2,7 @@
pragma solidity ^0.8.30;
import {IERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import {IWETH9} from "./IWETH9.sol";
import {NativeWrapper} from "./NativeWrapper.sol";
import {LMSRStabilizedBalancedPair} from "./LMSRStabilizedBalancedPair.sol";
import {PartyPool} from "./PartyPool.sol";
import {PartyPoolBase} from "./PartyPoolBase.sol";
@@ -20,7 +20,7 @@ contract PartyPoolBalancedPair is PartyPool {
uint256 flashFeePpm_,
uint256 protocolFeePpm_, // NEW: protocol share of fees (ppm)
address protocolFeeAddress_, // NEW: recipient for collected protocol tokens
IWETH9 wrapperToken_,
NativeWrapper wrapperToken_,
PartyPoolSwapImpl swapMintImpl_,
PartyPoolMintImpl mintImpl_
) PartyPool(name_, symbol_, tokens_, bases_, kappa_, swapFeePpm_, flashFeePpm_, protocolFeePpm_, protocolFeeAddress_, wrapperToken_, swapMintImpl_, mintImpl_)

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.30;
import "./IWETH9.sol";
import "./NativeWrapper.sol";
import {ABDKMath64x64} from "../lib/abdk-libraries-solidity/ABDKMath64x64.sol";
import {ERC20Internal} from "./ERC20Internal.sol";
import {IERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
@@ -17,9 +17,9 @@ abstract contract PartyPoolBase is ERC20Internal, ReentrancyGuard, PartyPoolHelp
using LMSRStabilized for LMSRStabilized.State;
using SafeERC20 for IERC20;
IWETH9 internal immutable WRAPPER_TOKEN;
NativeWrapper internal immutable WRAPPER_TOKEN;
constructor( IWETH9 wrapper_ ) {
constructor( NativeWrapper wrapper_ ) {
WRAPPER_TOKEN = wrapper_;
}

View File

@@ -20,7 +20,7 @@ interface IPartyPoolDeployer {
uint256 flashFeePpm_,
uint256 protocolFeePpm_,
address protocolFeeAddress_,
IWETH9 wrapper_,
NativeWrapper wrapper_,
PartyPoolSwapImpl swapImpl_,
PartyPoolMintImpl mintImpl_
) external returns (IPartyPool pool);
@@ -37,7 +37,7 @@ contract PartyPoolDeployer is IPartyPoolDeployer {
uint256 flashFeePpm_,
uint256 protocolFeePpm_,
address protocolFeeAddress_,
IWETH9 wrapper_,
NativeWrapper wrapper_,
PartyPoolSwapImpl swapImpl_,
PartyPoolMintImpl mintImpl_
) external returns (IPartyPool) {
@@ -69,7 +69,7 @@ contract PartyPoolBalancedPairDeployer is IPartyPoolDeployer {
uint256 flashFeePpm_,
uint256 protocolFeePpm_,
address protocolFeeAddress_,
IWETH9 wrapper_,
NativeWrapper wrapper_,
PartyPoolSwapImpl swapImpl_,
PartyPoolMintImpl mintImpl_
) external returns (IPartyPool) {

View File

@@ -7,7 +7,7 @@ import {SafeERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/uti
import {ReentrancyGuard} from "../lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol";
import {ERC20Internal} from "./ERC20Internal.sol";
import {IPartyPool} from "./IPartyPool.sol";
import {IWETH9} from "./IWETH9.sol";
import {NativeWrapper} from "./NativeWrapper.sol";
import {LMSRStabilized} from "./LMSRStabilized.sol";
import {PartyPoolBase} from "./PartyPoolBase.sol";
@@ -19,7 +19,7 @@ contract PartyPoolMintImpl is PartyPoolBase {
using LMSRStabilized for LMSRStabilized.State;
using SafeERC20 for IERC20;
constructor(IWETH9 wrapper_) PartyPoolBase(wrapper_) {}
constructor(NativeWrapper wrapper_) PartyPoolBase(wrapper_) {}
//
// Initialization Mint

View File

@@ -5,7 +5,7 @@ import {ABDKMath64x64} from "../lib/abdk-libraries-solidity/ABDKMath64x64.sol";
import {IERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import {IPartyPool} from "./IPartyPool.sol";
import {IWETH9} from "./IWETH9.sol";
import {NativeWrapper} from "./NativeWrapper.sol";
import {LMSRStabilized} from "./LMSRStabilized.sol";
import {PartyPoolBase} from "./PartyPoolBase.sol";
@@ -17,7 +17,7 @@ contract PartyPoolSwapImpl is PartyPoolBase {
using LMSRStabilized for LMSRStabilized.State;
using SafeERC20 for IERC20;
constructor(IWETH9 wrapper_) PartyPoolBase(wrapper_) {}
constructor(NativeWrapper wrapper_) PartyPoolBase(wrapper_) {}
function swapToLimitAmounts(
uint256 inputTokenIndex,