diff --git a/.gas-snapshot b/.gas-snapshot index 6971b0f6..3ed6ee29 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,105 +1,108 @@ -AssetManagedPairTest:testAdjustManagement(uint256,uint256) (runs: 256, μ: 315338, ~: 315670) -AssetManagedPairTest:testAdjustManagement_AdjustAfterLoss(uint256) (runs: 256, μ: 539160, ~: 543586) -AssetManagedPairTest:testAdjustManagement_DecreaseManagement(uint256,uint256) (runs: 256, μ: 507741, ~: 508841) +AssetManagedPairTest:testAdjustManagement(uint256,uint256) (runs: 259, μ: 315359, ~: 315670) +AssetManagedPairTest:testAdjustManagement_AdjustAfterLoss(uint256) (runs: 259, μ: 538682, ~: 543686) +AssetManagedPairTest:testAdjustManagement_DecreaseManagement(uint256,uint256) (runs: 259, μ: 507900, ~: 508841) AssetManagedPairTest:testAdjustManagement_GreaterThanUint104() (gas: 124232) AssetManagedPairTest:testAdjustManagement_Int256Min() (gas: 124764) -AssetManagedPairTest:testAdjustManagement_KStillHolds(uint256) (runs: 256, μ: 632640, ~: 632321) +AssetManagedPairTest:testAdjustManagement_KStillHolds(uint256) (runs: 259, μ: 632922, ~: 632565) AssetManagedPairTest:testAdjustManagement_Uint104() (gas: 745418) -AssetManagedPairTest:testBurn_AfterAlmostTotalLoss() (gas: 633412) -AssetManagedPairTest:testBurn_AfterLoss(uint256,uint256) (runs: 256, μ: 728919, ~: 742349) -AssetManagedPairTest:testMint_AfterLoss(uint256,uint256) (runs: 256, μ: 614585, ~: 624470) +AssetManagedPairTest:testBurn_AfterAlmostTotalLoss() (gas: 633534) +AssetManagedPairTest:testBurn_AfterLoss(uint256,uint256) (runs: 259, μ: 728629, ~: 721639) +AssetManagedPairTest:testMint_AfterLoss(uint256,uint256) (runs: 259, μ: 614136, ~: 624592) AssetManagedPairTest:testSetManager() (gas: 131642) -AssetManagedPairTest:testSetManager_CannotMigrateWithManaged(uint256,uint256) (runs: 256, μ: 412000, ~: 412332) +AssetManagedPairTest:testSetManager_CannotMigrateWithManaged(uint256,uint256) (runs: 259, μ: 412021, ~: 412332) AssetManagedPairTest:testSkimExcessManaged() (gas: 424102) AssetManagedPairTest:testSkimExcessManaged_InvalidToken() (gas: 68737) AssetManagedPairTest:testSkimExcessManaged_NoExcess() (gas: 308106) -AssetManagedPairTest:testSwap_AfterLoss(uint256) (runs: 256, μ: 811699, ~: 816315) -AssetManagedPairTest:testSync(uint256,uint256,uint256,uint256) (runs: 256, μ: 519827, ~: 530086) -AssetManagedPairTest:testSyncManaged_ConstantProduct(uint256,uint256) (runs: 256, μ: 347992, ~: 355385) -AssetManagedPairTest:testSyncManaged_Stable(uint256,uint256) (runs: 256, μ: 386480, ~: 380320) -BufferTest:testAdd_IndexGreaterThanBufferSize(uint16,uint16) (runs: 256, μ: 6788, ~: 6755) -BufferTest:testNext_AtLimit() (gas: 3343) -BufferTest:testNext_GreaterThanBufferSize(uint16) (runs: 256, μ: 7375, ~: 7333) -BufferTest:testPrev_AtLimit() (gas: 3321) -BufferTest:testSub_IndexGreaterThanBufferSize(uint16,uint16) (runs: 256, μ: 6844, ~: 6811) -ConstantProductMathTest:testCalcLogPrice_ReturnsOneWeiWhenPriceDiffGreaterThan1e18(uint256,uint256) (runs: 256, μ: 10749, ~: 10722) -ConstantProductMathTest:testConstantProductOracleMath() (gas: 34880) -ConstantProductPairGas:testGasBurn() (gas: 93599) -ConstantProductPairGas:testGasMint() (gas: 101210) -ConstantProductPairGas:testGasMint_Initial() (gas: 214627) -ConstantProductPairGas:testGasSwap() (gas: 84629) -ConstantProductPairGas:testGasSwap_UpdateOracle() (gas: 93039) -ConstantProductPairGas:testGasSwap_UpdateOracleClamped() (gas: 89966) -ConstantProductPairTest:testBurn() (gas: 137242) -ConstantProductPairTest:testBurn_Zero() (gas: 75138) -ConstantProductPairTest:testMint() (gas: 107375) +AssetManagedPairTest:testSwap_AfterLoss(uint256) (runs: 259, μ: 811566, ~: 816637) +AssetManagedPairTest:testSync(uint256,uint256,uint256,uint256) (runs: 259, μ: 519051, ~: 530143) +AssetManagedPairTest:testSyncManaged_ConstantProduct(uint256,uint256) (runs: 259, μ: 347633, ~: 355507) +AssetManagedPairTest:testSyncManaged_Stable(uint256,uint256) (runs: 259, μ: 385825, ~: 380276) +BufferTest:testAdd_IndexGreaterThanBufferSize(uint16,uint16) (runs: 259, μ: 8249, ~: 8196) +BufferTest:testNext_AtLimit() (gas: 3667) +BufferTest:testNext_GreaterThanBufferSize(uint16) (runs: 259, μ: 8967, ~: 8865) +BufferTest:testPrev_AtLimit() (gas: 3724) +BufferTest:testSub_IndexGreaterThanBufferSize(uint16,uint16) (runs: 259, μ: 8299, ~: 8246) +ConstantProductMathTest:testCalcLogPrice_ReturnsOneWeiWhenPriceDiffGreaterThan1e18(uint256,uint256) (runs: 259, μ: 10887, ~: 10722) +ConstantProductMathTest:testConstantProductOracleMath() (gas: 36040) +ConstantProductPairGas:testGasBurn() (gas: 93660) +ConstantProductPairGas:testGasMint() (gas: 101271) +ConstantProductPairGas:testGasMint_Initial() (gas: 214677) +ConstantProductPairGas:testGasSwap() (gas: 84690) +ConstantProductPairGas:testGasSwap_UpdateOracle() (gas: 93089) +ConstantProductPairGas:testGasSwap_UpdateOracleClamped() (gas: 90066) +ConstantProductPairTest:testBurn() (gas: 137303) +ConstantProductPairTest:testBurn_Zero() (gas: 75199) +ConstantProductPairTest:testMint() (gas: 107436) ConstantProductPairTest:testMint_InitialMint() (gas: 26664) -ConstantProductPairTest:testMint_JustAboveMinimumLiquidity() (gas: 4572608) -ConstantProductPairTest:testMint_MinimumLiquidity() (gas: 4518136) -ConstantProductPairTest:testMint_UnderMinimumLiquidity() (gas: 4464276) -ConstantProductPairTest:testOracle_ClampedPrice_AtLimit() (gas: 147874) -ConstantProductPairTest:testOracle_ClampedPrice_NoDiffWithinLimit() (gas: 148886) -ConstantProductPairTest:testOracle_ClampedPrice_OverLimit() (gas: 150022) -ConstantProductPairTest:testOracle_CorrectPrice(uint32) (runs: 256, μ: 4747360, ~: 4747360) -ConstantProductPairTest:testOracle_CorrectPriceDiffDecimals(uint32) (runs: 256, μ: 4669605, ~: 4669610) -ConstantProductPairTest:testOracle_SimplePrices(uint32) (runs: 256, μ: 4712520, ~: 4712520) -ConstantProductPairTest:testSwap() (gas: 113267) -ConstantProductPairTest:testSwap_ExactOut(uint256) (runs: 256, μ: 110450, ~: 100401) +ConstantProductPairTest:testMint_JustAboveMinimumLiquidity() (gas: 4595755) +ConstantProductPairTest:testMint_MinimumLiquidity() (gas: 4541222) +ConstantProductPairTest:testMint_UnderMinimumLiquidity() (gas: 4487362) +ConstantProductPairTest:testOracle_ClampedPrice_AtLimit() (gas: 147974) +ConstantProductPairTest:testOracle_ClampedPrice_NoDiffWithinLimit() (gas: 148986) +ConstantProductPairTest:testOracle_ClampedPrice_OverLimit() (gas: 150172) +ConstantProductPairTest:testOracle_CorrectPrice(uint32) (runs: 259, μ: 4770807, ~: 4770807) +ConstantProductPairTest:testOracle_CorrectPriceDiffDecimals(uint32) (runs: 259, μ: 4692874, ~: 4692879) +ConstantProductPairTest:testOracle_SimplePrices(uint32) (runs: 259, μ: 4738766, ~: 4738766) +ConstantProductPairTest:testSwap() (gas: 113328) +ConstantProductPairTest:testSwap_ExactOut(uint256) (runs: 259, μ: 110880, ~: 120255) ConstantProductPairTest:testSwap_ExactOutExceedReserves() (gas: 28772) ConstantProductPairTest:testSwap_ExactOut_NewReservesExceedUint104() (gas: 78831) -ConstantProductPairTest:testSwap_ExtremeAmounts() (gas: 4616936) +ConstantProductPairTest:testSwap_ExtremeAmounts() (gas: 4640133) ConstantProductPairTest:testSwap_MinInt256() (gas: 15279) ConstantProductPairTest:testSwap_Reenter() (gas: 78500) -FixedPointMathLibTest:testFullMulDiv(uint256,uint256,uint256) (runs: 256, μ: 9691, ~: 9580) -FixedPointMathLibTest:testMulDiv(uint256,uint256,uint256) (runs: 256, μ: 9274, ~: 9312) -FlashSwapTest:testSwap_FlashSwap_ExactIn(uint256) (runs: 256, μ: 283616, ~: 239855) -FlashSwapTest:testSwap_FlashSwap_ExactOut(uint256) (runs: 256, μ: 259278, ~: 240473) -FlashSwapTest:testSwap_FlashSwap_NoPay(uint256) (runs: 256, μ: 175021, ~: 176656) -GenericFactoryGasTest:testCreateConstantProductPair() (gas: 4380848) +FixedPointMathLibTest:testFullMulDiv(uint256,uint256,uint256) (runs: 259, μ: 12723, ~: 12698) +FixedPointMathLibTest:testMulDiv(uint256,uint256,uint256) (runs: 259, μ: 12344, ~: 12639) +FlashSwapTest:testSwap_FlashSwap_ExactIn(uint256) (runs: 259, μ: 283936, ~: 240430) +FlashSwapTest:testSwap_FlashSwap_ExactOut(uint256) (runs: 259, μ: 259997, ~: 240847) +FlashSwapTest:testSwap_FlashSwap_NoPay(uint256) (runs: 259, μ: 175035, ~: 176656) +GenericFactoryGasTest:testCreateConstantProductPair() (gas: 4403934) GenericFactoryGasTest:testCreateFactory() (gas: 847078) -GenericFactoryGasTest:testCreateStablePair() (gas: 5223881) +GenericFactoryGasTest:testCreateStablePair() (gas: 5246979) GenericFactoryTest:testAddCurve() (gas: 119232) GenericFactoryTest:testAddCurve_OnlyOwner() (gas: 14164) -GenericFactoryTest:testAllPairs() (gas: 9590779) -GenericFactoryTest:testCreatePair_AllCurves(uint256) (runs: 256, μ: 4866752, ~: 5232227) -GenericFactoryTest:testCreatePair_Create2AddressCorrect() (gas: 9661104) -GenericFactoryTest:testCreatePair_CurveDoesNotExist(uint256) (runs: 256, μ: 21248, ~: 21244) -GenericFactoryTest:testCreatePair_IdenticalAddress(uint256) (runs: 256, μ: 14761, ~: 14721) -GenericFactoryTest:testCreatePair_MoreThan18Decimals(uint256) (runs: 256, μ: 156115, ~: 159253) -GenericFactoryTest:testCreatePair_PairAlreadyExists(uint256) (runs: 256, μ: 19044, ~: 19004) -GenericFactoryTest:testCreatePair_ZeroAddress(uint256) (runs: 256, μ: 14907, ~: 14867) -GenericFactoryTest:testGetBytecode_CorrectConstructorData() (gas: 112505) +GenericFactoryTest:testAllPairs() (gas: 9636963) +GenericFactoryTest:testCreatePair_AllCurves(uint256) (runs: 259, μ: 4848517, ~: 5255325) +GenericFactoryTest:testCreatePair_Create2AddressCorrect() (gas: 9707752) +GenericFactoryTest:testCreatePair_CurveDoesNotExist(uint256) (runs: 259, μ: 21248, ~: 21244) +GenericFactoryTest:testCreatePair_IdenticalAddress(uint256) (runs: 259, μ: 14767, ~: 14721) +GenericFactoryTest:testCreatePair_MoreThan18Decimals(uint256) (runs: 259, μ: 155821, ~: 159322) +GenericFactoryTest:testCreatePair_PairAlreadyExists(uint256) (runs: 259, μ: 19050, ~: 19004) +GenericFactoryTest:testCreatePair_ZeroAddress(uint256) (runs: 259, μ: 14913, ~: 14867) +GenericFactoryTest:testGetBytecode_CorrectConstructorData() (gas: 112928) GenericFactoryTest:testGetPair() (gas: 20918) +LogCompressionTest:testToLowResLog_Clamped() (gas: 4835) +LogCompressionTest:testToLowResLog_MaxReturnValue(uint256) (runs: 259, μ: 8922, ~: 8920) +LogCompressionTest:testToLowResLog_MinReturnValue(uint256) (runs: 259, μ: 8995, ~: 8993) OracleWriterTest:testMaxChangeRate_Default() (gas: 68110) -OracleWriterTest:testOracle_MintWrongPriceThenConverge() (gas: 247411426) -OracleWriterTest:testOracle_NoWriteInSameTimestamp() (gas: 489012) -OracleWriterTest:testOracle_OverflowAccPrice(uint32) (runs: 256, μ: 341198, ~: 337108) -OracleWriterTest:testOracle_SamePriceDiffLiq(uint32) (runs: 256, μ: 10139438, ~: 10139451) -OracleWriterTest:testOracle_SamePriceSameLiq(uint32) (runs: 256, μ: 10136050, ~: 10136063) -OracleWriterTest:testOracle_SameReservesDiffPrice(uint32) (runs: 256, μ: 10127949, ~: 10127938) -OracleWriterTest:testOracle_WrapsAroundAfterFull() (gas: 4219823279) +OracleWriterTest:testOracle_MintWrongPriceThenConverge() (gas: 248279012) +OracleWriterTest:testOracle_NoWriteInSameTimestamp() (gas: 489378) +OracleWriterTest:testOracle_OverflowAccPrice(uint32) (runs: 258, μ: 341070, ~: 337508) +OracleWriterTest:testOracle_SamePriceDiffLiq(uint32) (runs: 258, μ: 10185921, ~: 10185935) +OracleWriterTest:testOracle_SamePriceSameLiq(uint32) (runs: 258, μ: 10182533, ~: 10182547) +OracleWriterTest:testOracle_SameReservesDiffPrice(uint32) (runs: 258, μ: 10174433, ~: 10174422) +OracleWriterTest:testOracle_WrapsAroundAfterFull() (gas: 4227819159) OracleWriterTest:testSetClampParams_OnlyFactory() (gas: 91155) -OracleWriterTest:testSetClampParams_TooHigh(uint256) (runs: 256, μ: 76550, ~: 76652) +OracleWriterTest:testSetClampParams_TooHigh(uint256) (runs: 259, μ: 76540, ~: 76652) OracleWriterTest:testSetClampParams_TooLow() (gas: 69054) -OracleWriterTest:testUpdateOracle_AccumulateOldPricesNotNew() (gas: 221088) -OracleWriterTest:testUpdateOracle_DecreasePrice_ExceedBothMaxChangeRateAndMaxChangePerTrade() (gas: 357533) -OracleWriterTest:testUpdateOracle_DecreasePrice_ExceedMaxChangePerTrade() (gas: 305818) -OracleWriterTest:testUpdateOracle_DecreasePrice_ExceedMaxChangeRate() (gas: 306536) -OracleWriterTest:testUpdateOracle_DecreasePrice_LongElapsedTime() (gas: 299777) -OracleWriterTest:testUpdateOracle_LatestTimestampWritten(uint256) (runs: 256, μ: 290897, ~: 291261) -OracleWriterTest:testUpdateOracle_MintThenSwapSameBlock() (gas: 315020) -OracleWriterTest:testUpdateOracle_MultipleSwapsSameBlock() (gas: 410191) -OracleWriterTest:testWriteObservations() (gas: 431394) +OracleWriterTest:testUpdateOracle_AccumulateOldPricesNotNew() (gas: 221271) +OracleWriterTest:testUpdateOracle_DecreasePrice_ExceedBothMaxChangeRateAndMaxChangePerTrade() (gas: 357811) +OracleWriterTest:testUpdateOracle_DecreasePrice_ExceedMaxChangePerTrade() (gas: 306062) +OracleWriterTest:testUpdateOracle_DecreasePrice_ExceedMaxChangeRate() (gas: 306780) +OracleWriterTest:testUpdateOracle_DecreasePrice_LongElapsedTime() (gas: 300021) +OracleWriterTest:testUpdateOracle_LatestTimestampWritten(uint256) (runs: 259, μ: 291116, ~: 291444) +OracleWriterTest:testUpdateOracle_MintThenSwapSameBlock() (gas: 315264) +OracleWriterTest:testUpdateOracle_MultipleSwapsSameBlock() (gas: 410862) +OracleWriterTest:testWriteObservations() (gas: 431760) PairTest:testCustomPlatformFee_OffByDefault() (gas: 74381) PairTest:testCustomSwapFee_OffByDefault() (gas: 68833) -PairTest:testEmitEventOnCreation() (gas: 9582461) +PairTest:testEmitEventOnCreation() (gas: 9628645) PairTest:testNonPayable() (gas: 79592) PairTest:testRecoverToken() (gas: 200069) PairTest:testSetPlatformFeeForPair() (gas: 111080) -PairTest:testSetPlatformFeeForPair_BreachMaximum(uint256) (runs: 256, μ: 110814, ~: 110445) +PairTest:testSetPlatformFeeForPair_BreachMaximum(uint256) (runs: 259, μ: 110819, ~: 110445) PairTest:testSetPlatformFeeForPair_Reset() (gas: 118525) PairTest:testSetSwapFeeForPair() (gas: 112048) -PairTest:testSetSwapFeeForPair_BreachMaximum(uint256) (runs: 256, μ: 111015, ~: 110691) +PairTest:testSetSwapFeeForPair_BreachMaximum(uint256) (runs: 259, μ: 111017, ~: 110691) PairTest:testSetSwapFeeForPair_Reset() (gas: 125017) PairTest:testSwapFee_UseDefault() (gas: 19026) PairTest:testUpdateDefaultFees() (gas: 166371) @@ -114,62 +117,62 @@ ReservoirERC20Test:testApprove_TransferOne() (gas: 67005) ReservoirERC20Test:testApprove_TransferTooMuch() (gas: 37978) ReservoirPairTest:testCheckedTransfer_RevertWhenTransferFail() (gas: 131193) ReservoirPairTest:testCheckedTransfer_RevertWhenTransferReverts() (gas: 433408) -ReservoirPairTest:testPlatformFee_Disable() (gas: 1019945) -ReservoirPairTest:testPlatformFee_DisableReenable() (gas: 1435965) -ReservoirPairTest:testReentrancyGuard_LargeTimestamp() (gas: 197931) -ReservoirPairTest:testSkim(uint256,uint256) (runs: 256, μ: 257157, ~: 257101) -ReservoirPairTest:testSync() (gas: 192487) -ReservoirTimelockTest:testRampA(uint32) (runs: 256, μ: 36089, ~: 36089) +ReservoirPairTest:testPlatformFee_Disable() (gas: 1020726) +ReservoirPairTest:testPlatformFee_DisableReenable() (gas: 1437332) +ReservoirPairTest:testReentrancyGuard_LargeTimestamp() (gas: 198175) +ReservoirPairTest:testSkim(uint256,uint256) (runs: 259, μ: 257162, ~: 257101) +ReservoirPairTest:testSync() (gas: 192609) +ReservoirTimelockTest:testRampA(uint32) (runs: 259, μ: 36089, ~: 36089) ReservoirTimelockTest:testRampA_NotAdmin() (gas: 17852) -ReservoirTimelockTest:testSetCustomPlatformFee(uint256) (runs: 256, μ: 134444, ~: 135105) +ReservoirTimelockTest:testSetCustomPlatformFee(uint256) (runs: 259, μ: 134454, ~: 135105) ReservoirTimelockTest:testSetCustomPlatformFee_NotAdmin() (gas: 81112) -ReservoirTimelockTest:testSetCustomSwapFee(uint256) (runs: 256, μ: 136518, ~: 137142) +ReservoirTimelockTest:testSetCustomSwapFee(uint256) (runs: 259, μ: 136528, ~: 137142) ReservoirTimelockTest:testSetCustomSwapFee_NotAdmin() (gas: 81406) -StableMathTest:testComputeLiquidityFromAdjustedBalances_ConvergeEvenWithVeryUnbalancedValues(uint256,uint256,uint256) (runs: 256, μ: 14078, ~: 12434) -StableMathTest:testGetAmountIn(uint256,uint256,uint256) (runs: 256, μ: 22164, ~: 21987) -StableMathTest:testGetAmountOut(uint256,uint256,uint256) (runs: 256, μ: 26101, ~: 25722) +StableMathTest:testComputeLiquidityFromAdjustedBalances_ConvergeEvenWithVeryUnbalancedValues(uint256,uint256,uint256) (runs: 259, μ: 14124, ~: 12439) +StableMathTest:testGetAmountIn(uint256,uint256,uint256) (runs: 259, μ: 22156, ~: 21987) +StableMathTest:testGetAmountOut(uint256,uint256,uint256) (runs: 259, μ: 26111, ~: 25722) StableMathTest:testMinALessThanMaxA() (gas: 3381) -StableOracleMathTest:testCalcLogPrice_VerySmallAmounts(uint256,uint256) (runs: 256, μ: 12101, ~: 10171) -StableOracleMathTest:testCalcSpotPrice_CanonicalVersion_VerySmallAmounts(uint256,uint256) (runs: 256, μ: 13379, ~: 13271) -StableOracleMathTest:testCalcSpotPrice_VerySmallAmounts(uint256,uint256) (runs: 256, μ: 13565, ~: 13457) -StableOracleMathTest:testCalculatedSpotPriceIsCloseToEstimated(uint256,uint256) (runs: 256, μ: 21622, ~: 22020) +StableOracleMathTest:testCalcLogPrice_VerySmallAmounts(uint256,uint256) (runs: 259, μ: 12298, ~: 10312) +StableOracleMathTest:testCalcSpotPrice_CanonicalVersion_VerySmallAmounts(uint256,uint256) (runs: 259, μ: 13393, ~: 13271) +StableOracleMathTest:testCalcSpotPrice_VerySmallAmounts(uint256,uint256) (runs: 259, μ: 13579, ~: 13457) +StableOracleMathTest:testCalculatedSpotPriceIsCloseToEstimated(uint256,uint256) (runs: 259, μ: 21676, ~: 22020) StableOracleMathTest:testPrice_Token0MoreExpensive() (gas: 9345) StableOracleMathTest:testPrice_Token1MoreExpensive() (gas: 9646) -StablePairGas:testGasBurn() (gas: 102997) -StablePairGas:testGasMint() (gas: 124873) -StablePairGas:testGasMint_Initial() (gas: 254060) -StablePairGas:testGasSwap() (gas: 79026) -StablePairGas:testGasSwap_UpdateOracle() (gas: 105438) -StablePairGas:testGasSwap_UpdateOracleClamped() (gas: 102320) -StablePairTest:testAttackWhileRampingDown_LongInterval() (gas: 203058) -StablePairTest:testAttackWhileRampingDown_ShortInterval() (gas: 204368) -StablePairTest:testBurn() (gas: 144854) -StablePairTest:testBurn_DiffDecimalPlaces(uint256) (runs: 256, μ: 5503031, ~: 5502919) -StablePairTest:testBurn_LastInvariantUseReserveInsteadOfBalance() (gas: 264032) +StablePairGas:testGasBurn() (gas: 103119) +StablePairGas:testGasMint() (gas: 124995) +StablePairGas:testGasMint_Initial() (gas: 254110) +StablePairGas:testGasSwap() (gas: 79148) +StablePairGas:testGasSwap_UpdateOracle() (gas: 105499) +StablePairGas:testGasSwap_UpdateOracleClamped() (gas: 102381) +StablePairTest:testAttackWhileRampingDown_LongInterval() (gas: 203169) +StablePairTest:testAttackWhileRampingDown_ShortInterval() (gas: 204490) +StablePairTest:testBurn() (gas: 144915) +StablePairTest:testBurn_DiffDecimalPlaces(uint256) (runs: 259, μ: 5526246, ~: 5526128) +StablePairTest:testBurn_LastInvariantUseReserveInsteadOfBalance() (gas: 264215) StablePairTest:testBurn_Reenter() (gas: 48741) -StablePairTest:testBurn_SucceedEvenIfMintFeeReverts() (gas: 143847) -StablePairTest:testBurn_WhenRampingA(uint256,uint32) (runs: 256, μ: 332644, ~: 332653) -StablePairTest:testBurn_Zero() (gas: 81634) -StablePairTest:testFactoryAmpTooHigh() (gas: 248721) -StablePairTest:testFactoryAmpTooLow() (gas: 244339) +StablePairTest:testBurn_SucceedEvenIfMintFeeReverts() (gas: 143908) +StablePairTest:testBurn_WhenRampingA(uint256,uint32) (runs: 259, μ: 332748, ~: 332775) +StablePairTest:testBurn_Zero() (gas: 81695) +StablePairTest:testFactoryAmpTooHigh() (gas: 248790) +StablePairTest:testFactoryAmpTooLow() (gas: 244408) StablePairTest:testGetCurrentA() (gas: 32256) -StablePairTest:testMint() (gas: 118021) +StablePairTest:testMint() (gas: 118082) StablePairTest:testMintFee_CallableBySelf() (gas: 16698) -StablePairTest:testMintFee_DiffPlatformFees(uint256) (runs: 256, μ: 6927174, ~: 6928433) +StablePairTest:testMintFee_DiffPlatformFees(uint256) (runs: 259, μ: 6952489, ~: 6953741) StablePairTest:testMintFee_NotCallableByOthers() (gas: 8563) -StablePairTest:testMintFee_WhenRampingA_PoolBalanced(uint256) (runs: 256, μ: 6996076, ~: 6996122) -StablePairTest:testMintFee_WhenRampingA_PoolUnbalanced(uint256) (runs: 256, μ: 6409587, ~: 6409406) -StablePairTest:testMint_CalculationOverflowInStableMath() (gas: 5330231) -StablePairTest:testMint_NonOptimalProportion() (gas: 172710) -StablePairTest:testMint_NonOptimalProportion_ThenBurn() (gas: 355157) -StablePairTest:testMint_OnlyTransferOneToken() (gas: 5268670) -StablePairTest:testMint_PlatformFeeOff() (gas: 121084) +StablePairTest:testMintFee_WhenRampingA_PoolBalanced(uint256) (runs: 259, μ: 7021562, ~: 7021601) +StablePairTest:testMintFee_WhenRampingA_PoolUnbalanced(uint256) (runs: 259, μ: 6434071, ~: 6433907) +StablePairTest:testMint_CalculationOverflowInStableMath() (gas: 5353329) +StablePairTest:testMint_NonOptimalProportion() (gas: 172760) +StablePairTest:testMint_NonOptimalProportion_ThenBurn() (gas: 355307) +StablePairTest:testMint_OnlyTransferOneToken() (gas: 5291768) +StablePairTest:testMint_PlatformFeeOff() (gas: 121145) StablePairTest:testMint_Reenter() (gas: 48166) -StablePairTest:testMint_VerySmallAmounts(uint256,uint256) (runs: 256, μ: 5439356, ~: 5446301) -StablePairTest:testMint_WhenRampingA(uint256,uint32) (runs: 256, μ: 357007, ~: 357010) -StablePairTest:testOracle_ClampedPrice_NoDiffWithinLimit() (gas: 165072) -StablePairTest:testOracle_CorrectPrice(uint32) (runs: 256, μ: 5630906, ~: 5630906) -StablePairTest:testOracle_SimplePrices(uint32) (runs: 256, μ: 5636647, ~: 5636647) +StablePairTest:testMint_VerySmallAmounts(uint256,uint256) (runs: 259, μ: 5462858, ~: 5469460) +StablePairTest:testMint_WhenRampingA(uint256,uint32) (runs: 259, μ: 357088, ~: 357110) +StablePairTest:testOracle_ClampedPrice_NoDiffWithinLimit() (gas: 165172) +StablePairTest:testOracle_CorrectPrice(uint32) (runs: 259, μ: 5654215, ~: 5654215) +StablePairTest:testOracle_SimplePrices(uint32) (runs: 259, μ: 5662157, ~: 5662157) StablePairTest:testRampA() (gas: 32529) StablePairTest:testRampA_BreachMaxSpeed() (gas: 24025) StablePairTest:testRampA_BreachMaxSpeed_Halve() (gas: 23564) @@ -180,26 +183,26 @@ StablePairTest:testRampA_MaxSpeed_Halve() (gas: 28985) StablePairTest:testRampA_OnlyFactory() (gas: 8715) StablePairTest:testRampA_SetAtMaximum() (gas: 27400) StablePairTest:testRampA_SetAtMinimum() (gas: 26917) -StablePairTest:testRampA_SwappingDuringRampingDown(uint256,uint256,uint256,uint256) (runs: 256, μ: 578673, ~: 460789) -StablePairTest:testRampA_SwappingDuringRampingUp(uint256,uint256,uint256,uint256) (runs: 256, μ: 578087, ~: 460306) +StablePairTest:testRampA_SwappingDuringRampingDown(uint256,uint256,uint256,uint256) (runs: 259, μ: 581657, ~: 481383) +StablePairTest:testRampA_SwappingDuringRampingUp(uint256,uint256,uint256,uint256) (runs: 259, μ: 581083, ~: 482256) StablePairTest:testStopRampA() (gas: 34818) -StablePairTest:testStopRampA_Early(uint256,uint32) (runs: 256, μ: 43054, ~: 43141) -StablePairTest:testStopRampA_Late(uint256) (runs: 256, μ: 42475, ~: 42569) +StablePairTest:testStopRampA_Early(uint256,uint32) (runs: 259, μ: 43053, ~: 43141) +StablePairTest:testStopRampA_Late(uint256) (runs: 259, μ: 42480, ~: 42569) StablePairTest:testStopRampA_OnlyFactory() (gas: 9181) -StablePairTest:testSwap() (gas: 119639) -StablePairTest:testSwap_BetterPerformanceThanConstantProduct() (gas: 187248) -StablePairTest:testSwap_DiffAs(uint256,uint256,uint256,uint256) (runs: 256, μ: 5565887, ~: 5566757) -StablePairTest:testSwap_DiffSwapFees(uint256) (runs: 256, μ: 5542913, ~: 5543694) +StablePairTest:testSwap() (gas: 119700) +StablePairTest:testSwap_BetterPerformanceThanConstantProduct() (gas: 187370) +StablePairTest:testSwap_DiffAs(uint256,uint256,uint256,uint256) (runs: 259, μ: 5589192, ~: 5589951) +StablePairTest:testSwap_DiffSwapFees(uint256) (runs: 259, μ: 5566120, ~: 5566892) StablePairTest:testSwap_ExactInExceedUint104() (gas: 74746) StablePairTest:testSwap_ExactOutExceedReserves() (gas: 29859) -StablePairTest:testSwap_IncreasingSwapFees(uint256,uint256,uint256) (runs: 256, μ: 389635, ~: 389796) +StablePairTest:testSwap_IncreasingSwapFees(uint256,uint256,uint256) (runs: 259, μ: 389804, ~: 389979) StablePairTest:testSwap_MinInt256() (gas: 19300) StablePairTest:testSwap_Reenter() (gas: 87227) -StablePairTest:testSwap_Token0ExactOut(uint256) (runs: 256, μ: 152750, ~: 137642) -StablePairTest:testSwap_Token1ExactOut(uint256) (runs: 256, μ: 152939, ~: 137779) -StablePairTest:testSwap_VeryLargeLiquidity(uint256) (runs: 256, μ: 5493512, ~: 5491686) -StablePairTest:testSwap_VerySmallLiquidity(uint256,uint256,uint256) (runs: 256, μ: 5534375, ~: 5531042) +StablePairTest:testSwap_Token0ExactOut(uint256) (runs: 259, μ: 154045, ~: 137692) +StablePairTest:testSwap_Token1ExactOut(uint256) (runs: 259, μ: 154256, ~: 137840) +StablePairTest:testSwap_VeryLargeLiquidity(uint256) (runs: 259, μ: 5516743, ~: 5514906) +StablePairTest:testSwap_VerySmallLiquidity(uint256,uint256,uint256) (runs: 259, μ: 5556549, ~: 5551503) StablePairTest:testSwap_ZeroInput() (gas: 10443) -StdMathTest:testPercentDelta() (gas: 3351) -StdMathTest:testPercentDelta_MinusOne() (gas: 3197) -StdMathTest:testPercentDelta_PlusOne() (gas: 3048) \ No newline at end of file +StdMathTest:testPercentDelta() (gas: 3950) +StdMathTest:testPercentDelta_MinusOne() (gas: 3973) +StdMathTest:testPercentDelta_PlusOne() (gas: 3908) \ No newline at end of file diff --git a/script/optimized-deployer-meta b/script/optimized-deployer-meta index 45207267..844edfff 100644 --- a/script/optimized-deployer-meta +++ b/script/optimized-deployer-meta @@ -1,5 +1,5 @@ { - "constant_product_hash": "0xca5638aa898eb1a1ac18f8d0d604a7a9266f3a735b08a462115588b5ee7c9111", + "constant_product_hash": "0x6c945970d4e51553efdac6f867611648fc1bffc7087c383be519a9c61f0946ae", "factory_hash": "0x87b0f73fafcf4bb41e013c8423dc679f6885527007d6c3f1e1834a670cbaadc5", - "stable_hash": "0xabdefb731a70385767ad3c64d191a67f1d4eb3a12f71e533d38ac677f93ef4c5" + "stable_hash": "0xd148178a834d9fb27b4ced5ba5529994087535330d774275b04c9887f5aab3e8" } \ No newline at end of file diff --git a/script/unoptimized-deployer-meta b/script/unoptimized-deployer-meta index b2c35ace..c56a4050 100644 --- a/script/unoptimized-deployer-meta +++ b/script/unoptimized-deployer-meta @@ -1,5 +1,5 @@ { - "constant_product_hash": "0xc2e3d64a67ce9ef6ddb3d62e8ada01f1d4122ad898554a3c42ca632fab578a3b", + "constant_product_hash": "0x65b1cb6f17a949d7ae834c44fdbcf3f07b201d1beb32d6e841e56356dd2e4768", "factory_hash": "0x09a9ce1ed77c95be4842dddd771939e048b8bfe2837863be3a2766b1c13ea5a2", - "stable_hash": "0xe8fe7b9f64660ab15daec6418951b057fb38e38c423751d2dfaa9e25ba21f455" + "stable_hash": "0x581fc45ff91bc2e96c0b3a302b49ea3e5d50751b532a84f03898a128a3a9816b" } \ No newline at end of file diff --git a/src/ReservoirDeployer.sol b/src/ReservoirDeployer.sol index 98633d7e..f8c074dd 100644 --- a/src/ReservoirDeployer.sol +++ b/src/ReservoirDeployer.sol @@ -27,8 +27,8 @@ contract ReservoirDeployer { // Bytecode hashes. bytes32 public constant FACTORY_HASH = bytes32(0x87b0f73fafcf4bb41e013c8423dc679f6885527007d6c3f1e1834a670cbaadc5); bytes32 public constant CONSTANT_PRODUCT_HASH = - bytes32(0xca5638aa898eb1a1ac18f8d0d604a7a9266f3a735b08a462115588b5ee7c9111); - bytes32 public constant STABLE_HASH = bytes32(0xabdefb731a70385767ad3c64d191a67f1d4eb3a12f71e533d38ac677f93ef4c5); + bytes32(0x6c945970d4e51553efdac6f867611648fc1bffc7087c383be519a9c61f0946ae); + bytes32 public constant STABLE_HASH = bytes32(0xd148178a834d9fb27b4ced5ba5529994087535330d774275b04c9887f5aab3e8); // Deployment addresses. GenericFactory public factory;