additive fees; burnSwapAmounts fix

This commit is contained in:
tim
2025-11-04 16:58:16 -04:00
parent 590acdd4dc
commit dc2e186331
10 changed files with 103 additions and 100 deletions

View File

@@ -900,7 +900,7 @@ contract LMSRStabilizedTest is Test {
int128 alpha = ABDKMath64x64.divu(1, 100); // 1%
int128 S = _computeSizeMetric(s.qInternal);
(int128 payout, int128 burned) = s.swapAmountsForBurn(0, alpha);
(int128 burned, int128 payout) = s.swapAmountsForBurn(0, alpha);
// burned should equal alpha * S
assertEq(burned, alpha.mul(S), "burned size-metric mismatch");
@@ -921,7 +921,7 @@ contract LMSRStabilizedTest is Test {
_updateCachedQInternal(mockQInternal);
int128 alpha = ABDKMath64x64.divu(1, 100); // 1%
(int128 payout, int128 burned) = s.swapAmountsForBurn(0, alpha);
(int128 burned, int128 payout) = s.swapAmountsForBurn(0, alpha);
// Should still burn the size metric
int128 S = _computeSizeMetric(mockQInternal);

View File

@@ -484,7 +484,7 @@ contract NativeTest is Test {
uint256 thisEthBefore = address(this).balance;
// Burn LP and receive all proceeds as native currency (WETH unwrapped)
uint256 payout = pool.burnSwap(
(uint256 payout, ) = pool.burnSwap(
address(this), // payer (holds LP)
address(this), // receiver
lpToBurn, // lpAmount
@@ -506,7 +506,7 @@ contract NativeTest is Test {
uint256 bobEthBefore = bob.balance;
// Burn LP and send native currency to bob
uint256 payout = pool.burnSwap(
(uint256 payout, ) = pool.burnSwap(
address(this), // payer
bob, // receiver
lpToBurn,
@@ -555,7 +555,7 @@ contract NativeTest is Test {
// 4. Burn LP to native currency
uint256 lpToBurn = lpMinted / 2;
uint256 payout = pool.burnSwap(alice, alice, lpToBurn, 2, 0, true);
(uint256 payout, ) = pool.burnSwap(alice, alice, lpToBurn, 2, 0, true);
assertTrue(payout > 0, "Should receive payout in native");
// Alice should have some ETH back (maybe more or less depending on slippage)

View File

@@ -784,7 +784,7 @@ contract PartyPoolTest is Test {
uint256 bobBefore = token0.balanceOf(bob);
// Call burnSwap where this contract is the payer (it holds initial LP from setUp)
uint256 payout = pool.burnSwap(address(this), bob, lpToBurn, target, 0, false);
(uint256 payout, ) = pool.burnSwap(address(this), bob, lpToBurn, target, 0, false);
// Payout must be > 0
assertTrue(payout > 0, "burnSwap should produce a payout");