Skip to content

Commit

Permalink
T
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized committed Aug 31, 2024
1 parent ecbc73b commit bdecb86
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
52 changes: 26 additions & 26 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,15 @@ ERC4337Test:testValidateUserOp() (gas: 484693)
ERC4337Test:test__codesize() (gas: 55947)
ERC4626Test:testDepositWithNoApprovalReverts() (gas: 16954)
ERC4626Test:testDepositWithNotEnoughApprovalReverts() (gas: 90752)
ERC4626Test:testDifferentialFullMulDiv(uint256,uint256,uint256) (runs: 315, μ: 3321, ~: 3107)
ERC4626Test:testDifferentialFullMulDiv(uint256,uint256,uint256) (runs: 315, μ: 3322, ~: 3319)
ERC4626Test:testMetadata() (gas: 14354)
ERC4626Test:testMintWithNoApprovalReverts() (gas: 16928)
ERC4626Test:testMintZero() (gas: 53930)
ERC4626Test:testMultipleMintDepositRedeemWithdraw() (gas: 412871)
ERC4626Test:testRedeemWithNoShareAmountReverts() (gas: 10918)
ERC4626Test:testRedeemWithNotEnoughShareAmountReverts() (gas: 143777)
ERC4626Test:testSingleDepositWithdraw(uint128) (runs: 315, μ: 202556, ~: 202560)
ERC4626Test:testSingleMintRedeem(uint128) (runs: 315, μ: 201522, ~: 201526)
ERC4626Test:testSingleMintRedeem(uint128) (runs: 315, μ: 201522, ~: 201525)
ERC4626Test:testTryGetAssetDecimals() (gas: 30700474)
ERC4626Test:testUseVirtualShares() (gas: 2428448)
ERC4626Test:testVaultInteractionsForSomeoneElse() (gas: 297836)
Expand Down Expand Up @@ -455,7 +455,7 @@ FixedPointMathLibTest:testDivWadOverflowReverts(uint256,uint256) (runs: 315, μ:
FixedPointMathLibTest:testDivWadUp() (gas: 3085)
FixedPointMathLibTest:testDivWadUp(uint256,uint256) (runs: 315, μ: 7149, ~: 1009)
FixedPointMathLibTest:testDivWadUpEdgeCases() (gas: 439)
FixedPointMathLibTest:testDivWadUpOverflowReverts(uint256,uint256) (runs: 315, μ: 22501, ~: 26499)
FixedPointMathLibTest:testDivWadUpOverflowReverts(uint256,uint256) (runs: 315, μ: 22504, ~: 26499)
FixedPointMathLibTest:testDivWadUpZeroDenominatorReverts() (gas: 3261)
FixedPointMathLibTest:testDivWadUpZeroDenominatorReverts(uint256) (runs: 315, μ: 3295, ~: 3295)
FixedPointMathLibTest:testDivWadZeroDenominatorReverts() (gas: 3218)
Expand All @@ -472,7 +472,7 @@ FixedPointMathLibTest:testFullMulDivUp(uint256,uint256,uint256) (runs: 315, μ:
FixedPointMathLibTest:testFullMulDivUpRevertsIfRoundedUpResultOverflowsCase1() (gas: 3694)
FixedPointMathLibTest:testFullMulDivUpRevertsIfRoundedUpResultOverflowsCase2() (gas: 3727)
FixedPointMathLibTest:testGcd() (gas: 4206)
FixedPointMathLibTest:testGcd(uint256,uint256) (runs: 315, μ: 6651, ~: 3007)
FixedPointMathLibTest:testGcd(uint256,uint256) (runs: 315, μ: 6655, ~: 3007)
FixedPointMathLibTest:testIsEven(uint256) (runs: 315, μ: 475, ~: 475)
FixedPointMathLibTest:testLambertW0WadAccuracy() (gas: 7160)
FixedPointMathLibTest:testLambertW0WadAccuracy(uint184) (runs: 315, μ: 2338, ~: 431)
Expand Down Expand Up @@ -500,7 +500,7 @@ FixedPointMathLibTest:testLog10(uint256,uint256) (runs: 315, μ: 2161, ~: 2195)
FixedPointMathLibTest:testLog10Up() (gas: 4369)
FixedPointMathLibTest:testLog2() (gas: 243209)
FixedPointMathLibTest:testLog256() (gas: 22831)
FixedPointMathLibTest:testLog256(uint256,uint256) (runs: 315, μ: 2086, ~: 2152)
FixedPointMathLibTest:testLog256(uint256,uint256) (runs: 315, μ: 2087, ~: 2152)
FixedPointMathLibTest:testLog256Up() (gas: 1293)
FixedPointMathLibTest:testLog2Differential(uint256) (runs: 315, μ: 889, ~: 886)
FixedPointMathLibTest:testLog2Up() (gas: 297368)
Expand All @@ -513,25 +513,25 @@ FixedPointMathLibTest:testMinSigned(int256,int256) (runs: 315, μ: 498, ~: 503)
FixedPointMathLibTest:testMulDiv() (gas: 1890)
FixedPointMathLibTest:testMulDiv(uint256,uint256,uint256) (runs: 315, μ: 1603, ~: 794)
FixedPointMathLibTest:testMulDivEdgeCases() (gas: 741)
FixedPointMathLibTest:testMulDivOverflowReverts(uint256,uint256,uint256) (runs: 315, μ: 20177, ~: 27078)
FixedPointMathLibTest:testMulDivOverflowReverts(uint256,uint256,uint256) (runs: 315, μ: 20173, ~: 27078)
FixedPointMathLibTest:testMulDivUp() (gas: 2148)
FixedPointMathLibTest:testMulDivUp(uint256,uint256,uint256) (runs: 315, μ: 1834, ~: 1121)
FixedPointMathLibTest:testMulDivUpEdgeCases() (gas: 817)
FixedPointMathLibTest:testMulDivUpOverflowReverts(uint256,uint256,uint256) (runs: 315, μ: 20144, ~: 27044)
FixedPointMathLibTest:testMulDivUpOverflowReverts(uint256,uint256,uint256) (runs: 315, μ: 20150, ~: 27044)
FixedPointMathLibTest:testMulDivUpZeroDenominator() (gas: 3234)
FixedPointMathLibTest:testMulDivUpZeroDenominatorReverts(uint256,uint256) (runs: 315, μ: 3357, ~: 3357)
FixedPointMathLibTest:testMulDivZeroDenominatorReverts() (gas: 3256)
FixedPointMathLibTest:testMulDivZeroDenominatorReverts(uint256,uint256) (runs: 315, μ: 3380, ~: 3380)
FixedPointMathLibTest:testMulWad() (gas: 736)
FixedPointMathLibTest:testMulWad(uint256,uint256) (runs: 315, μ: 721, ~: 855)
FixedPointMathLibTest:testMulWadEdgeCases() (gas: 714)
FixedPointMathLibTest:testMulWadOverflowReverts(uint256,uint256) (runs: 315, μ: 18917, ~: 26336)
FixedPointMathLibTest:testMulWadOverflowReverts(uint256,uint256) (runs: 315, μ: 18920, ~: 26336)
FixedPointMathLibTest:testMulWadUp() (gas: 837)
FixedPointMathLibTest:testMulWadUp(uint256,uint256) (runs: 315, μ: 21434, ~: 1065)
FixedPointMathLibTest:testMulWadUpEdgeCases() (gas: 815)
FixedPointMathLibTest:testMulWadUpOverflowReverts(uint256,uint256) (runs: 315, μ: 18958, ~: 26379)
FixedPointMathLibTest:testMulWadUpOverflowReverts(uint256,uint256) (runs: 315, μ: 18957, ~: 26379)
FixedPointMathLibTest:testPackUnpackSci() (gas: 129327)
FixedPointMathLibTest:testPackUnpackSci(uint256) (runs: 315, μ: 30419, ~: 30425)
FixedPointMathLibTest:testPackUnpackSci(uint256) (runs: 315, μ: 30420, ~: 30425)
FixedPointMathLibTest:testRPow() (gas: 3320)
FixedPointMathLibTest:testRPowOverflowReverts() (gas: 4974)
FixedPointMathLibTest:testRawAdd(int256,int256) (runs: 315, μ: 462, ~: 462)
Expand All @@ -546,20 +546,20 @@ FixedPointMathLibTest:testRawSDiv(int256,int256) (runs: 315, μ: 465, ~: 465)
FixedPointMathLibTest:testRawSMod(int256,int256) (runs: 315, μ: 466, ~: 466)
FixedPointMathLibTest:testRawSub(int256,int256) (runs: 315, μ: 463, ~: 463)
FixedPointMathLibTest:testRawSub(uint256,uint256) (runs: 315, μ: 440, ~: 440)
FixedPointMathLibTest:testSDivWad() (gas: 916)
FixedPointMathLibTest:testSDivWad(int256,int256) (runs: 315, μ: 6748, ~: 971)
FixedPointMathLibTest:testSDivWadEdgeCases() (gas: 422)
FixedPointMathLibTest:testSDivWadOverflowReverts(int256,int256) (runs: 315, μ: 22227, ~: 26511)
FixedPointMathLibTest:testSDivWadZeroDenominatorReverts(int256) (runs: 315, μ: 3330, ~: 3330)
FixedPointMathLibTest:testSDivWad() (gas: 865)
FixedPointMathLibTest:testSDivWad(int256,int256) (runs: 315, μ: 6731, ~: 954)
FixedPointMathLibTest:testSDivWadEdgeCases() (gas: 405)
FixedPointMathLibTest:testSDivWadOverflowReverts(int256,int256) (runs: 315, μ: 22219, ~: 26508)
FixedPointMathLibTest:testSDivWadZeroDenominatorReverts(int256) (runs: 315, μ: 3327, ~: 3327)
FixedPointMathLibTest:testSMulWad() (gas: 1032)
FixedPointMathLibTest:testSMulWad(int256,int256) (runs: 315, μ: 876, ~: 1047)
FixedPointMathLibTest:testSMulWadEdgeCases() (gas: 1309)
FixedPointMathLibTest:testSMulWadOverflowRevertsOnCondition1(int256,int256) (runs: 315, μ: 19628, ~: 26556)
FixedPointMathLibTest:testSMulWadOverflowRevertsOnCondition2(int256) (runs: 315, μ: 19328, ~: 25788)
FixedPointMathLibTest:testSMulWadOverflowRevertsOnCondition1(int256,int256) (runs: 315, μ: 19624, ~: 26556)
FixedPointMathLibTest:testSMulWadOverflowRevertsOnCondition2(int256) (runs: 315, μ: 19327, ~: 25788)
FixedPointMathLibTest:testSMulWadOverflowTrickDifferential(int256,int256) (runs: 315, μ: 643, ~: 654)
FixedPointMathLibTest:testSci() (gas: 1838636)
FixedPointMathLibTest:testSci(uint256) (runs: 315, μ: 34285, ~: 38563)
FixedPointMathLibTest:testSci2(uint256) (runs: 315, μ: 955, ~: 955)
FixedPointMathLibTest:testSci(uint256) (runs: 315, μ: 34107, ~: 37866)
FixedPointMathLibTest:testSci2(uint256) (runs: 315, μ: 956, ~: 955)
FixedPointMathLibTest:testSqrt() (gas: 43798)
FixedPointMathLibTest:testSqrt(uint256) (runs: 315, μ: 1047, ~: 1054)
FixedPointMathLibTest:testSqrtBack(uint256) (runs: 315, μ: 9948, ~: 363)
Expand All @@ -572,7 +572,7 @@ FixedPointMathLibTest:testSqrtWadMonotonicallyIncreasing(uint256,uint256) (runs:
FixedPointMathLibTest:testTernary(bool,uint256,uint256) (runs: 315, μ: 518, ~: 514)
FixedPointMathLibTest:testZeroFloorSub(uint256,uint256) (runs: 315, μ: 570, ~: 540)
FixedPointMathLibTest:testZeroFloorSubCasted(uint32,uint32,uint256) (runs: 315, μ: 882, ~: 846)
FixedPointMathLibTest:test__codesize() (gas: 45233)
FixedPointMathLibTest:test__codesize() (gas: 45220)
GasBurnerLibTest:testBurn() (gas: 105035)
GasBurnerLibTest:testBurn(uint256) (runs: 315, μ: 43479, ~: 33806)
GasBurnerLibTest:testBurnPure() (gas: 1700850)
Expand Down Expand Up @@ -804,14 +804,14 @@ LibRLPTest:testComputeAddressForSmallNonces() (gas: 1007)
LibRLPTest:testComputeAddressOriginalForLargeNonces() (gas: 3766)
LibRLPTest:testComputeAddressOriginalForSmallNonces() (gas: 2185)
LibRLPTest:testRLPEncodeAddressDifferential(address) (runs: 315, μ: 237244, ~: 26224)
LibRLPTest:testRLPEncodeAddressViaList(address,address) (runs: 315, μ: 194372, ~: 28079)
LibRLPTest:testRLPEncodeAddressViaList(address,address) (runs: 315, μ: 194371, ~: 28079)
LibRLPTest:testRLPEncodeBool(bool) (runs: 315, μ: 27682, ~: 27818)
LibRLPTest:testRLPEncodeBytes() (gas: 382181)
LibRLPTest:testRLPEncodeBytes2() (gas: 156293)
LibRLPTest:testRLPEncodeBytesDifferential(bytes32) (runs: 315, μ: 273414, ~: 29721)
LibRLPTest:testRLPEncodeList() (gas: 2738950)
LibRLPTest:testRLPEncodeList2() (gas: 803256)
LibRLPTest:testRLPEncodeListDifferential(bytes,uint256) (runs: 315, μ: 431884, ~: 39109)
LibRLPTest:testRLPEncodeListDifferential(bytes,uint256) (runs: 315, μ: 433825, ~: 39250)
LibRLPTest:testRLPEncodeUint() (gas: 1291481)
LibRLPTest:testRLPEncodeUint(uint256) (runs: 315, μ: 99850, ~: 25002)
LibRLPTest:testRLPEncodeUintDifferential(uint256) (runs: 315, μ: 262020, ~: 27106)
Expand Down Expand Up @@ -1157,15 +1157,15 @@ ReentrancyGuardTest:testRevertRecursiveDirectGuardedCall() (gas: 55123)
ReentrancyGuardTest:testRevertRecursiveIndirectGuardedCall() (gas: 56529)
ReentrancyGuardTest:testRevertRemoteCallback() (gas: 56230)
ReentrancyGuardTest:test__codesize() (gas: 4403)
SSTORE2Test:testReadRevertsOnZeroCodeAddress(address) (runs: 315, μ: 93791, ~: 30000)
SSTORE2Test:testReadRevertsOnZeroCodeAddress(address) (runs: 315, μ: 108162, ~: 30000)
SSTORE2Test:testReadSlicing() (gas: 48874)
SSTORE2Test:testWriteRead() (gas: 35880)
SSTORE2Test:testWriteRead(uint256,uint256) (runs: 315, μ: 1113188, ~: 67176)
SSTORE2Test:testWriteReadCounterfactual(bytes,bytes32,address) (runs: 315, μ: 4414484, ~: 108268)
SSTORE2Test:testWriteRead(uint256,uint256) (runs: 315, μ: 1105332, ~: 67277)
SSTORE2Test:testWriteReadCounterfactual(bytes,bytes32,address) (runs: 315, μ: 4107283, ~: 108268)
SSTORE2Test:testWriteReadCustomBounds() (gas: 33936)
SSTORE2Test:testWriteReadCustomStartBound() (gas: 34020)
SSTORE2Test:testWriteReadDeterministic() (gas: 70156)
SSTORE2Test:testWriteReadDeterministic(bytes,bytes32) (runs: 315, μ: 4093496, ~: 96934)
SSTORE2Test:testWriteReadDeterministic(bytes,bytes32) (runs: 315, μ: 3478987, ~: 96934)
SSTORE2Test:testWriteReadEmptyBound() (gas: 33734)
SSTORE2Test:testWriteReadFullBoundedRead() (gas: 35937)
SSTORE2Test:testWriteReadFullStartBound() (gas: 33983)
Expand Down
4 changes: 2 additions & 2 deletions src/utils/FixedPointMathLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ library FixedPointMathLib {
assembly {
z := mul(x, WAD)
// Equivalent to `require(y != 0 && ((x * WAD) / WAD == x))`.
if iszero(and(iszero(iszero(y)), eq(sdiv(z, WAD), x))) {
if iszero(lt(iszero(y), eq(sdiv(z, WAD), x))) {
mstore(0x00, 0x5c43740d) // `SDivWadFailed()`.
revert(0x1c, 0x04)
}
z := sdiv(mul(x, WAD), y)
z := sdiv(z, y)
}
}

Expand Down

0 comments on commit bdecb86

Please sign in to comment.