This commit is contained in:
tim
2025-09-18 19:23:31 -04:00
parent 19f14c6a95
commit bd210b56ff
5 changed files with 491 additions and 220 deletions

View File

@@ -44,7 +44,7 @@ contract PartyPool is IPartyPool, ERC20, ReentrancyGuard {
//
// Internal state
//
LMSRStabilized.State internal lmsr;
// Cached on-chain balances (uint) and internal 64.64 representation
@@ -52,9 +52,9 @@ contract PartyPool is IPartyPool, ERC20, ReentrancyGuard {
uint256[] internal cachedUintBalances;
uint256[] internal bases; // per-token uint base used to scale token amounts <-> internal
function denominators() external view returns (uint256[] memory) { return bases; }
mapping(address=>uint) public tokenAddressToIndexPlusOne; // Uses index+1 so a result of 0 indicates a failed lookup
uint256 public constant LP_SCALE = 1e18; // Scale used to convert LMSR lastTotal (Q64.64) into LP token units (uint)
/// @param name_ LP token name
@@ -766,8 +766,8 @@ contract PartyPool is IPartyPool, ERC20, ReentrancyGuard {
}
}
}
/// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
/// @dev The caller of this method receives a callback in the form of IPartyFlashCallback#partyFlashCallback
/// @param recipient The address which will receive the token amounts
@@ -831,7 +831,7 @@ contract PartyPool is IPartyPool, ERC20, ReentrancyGuard {
}
}
/* ----------------------
Conversion helpers
---------------------- */