From aebc05f1e440c95a4a3c70486ad1183e715692fd Mon Sep 17 00:00:00 2001 From: t11s Date: Fri, 9 Feb 2024 17:40:08 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Transient=20Reentrancy=20Guard=20(#?= =?UTF-8?q?409)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gas-snapshot | 761 +++++++++++++++--------- src/test/TransientReentrancyGuard.t.sol | 52 ++ src/utils/TransientReentrancyGuard.sol | 39 ++ 3 files changed, 580 insertions(+), 272 deletions(-) create mode 100644 src/test/TransientReentrancyGuard.t.sol create mode 100644 src/utils/TransientReentrancyGuard.sol diff --git a/.gas-snapshot b/.gas-snapshot index fbb08090..ca897148 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,274 +1,491 @@ -AuthTest:testCallFunctionAsOwner() (gas: 29828) -AuthTest:testCallFunctionWithPermissiveAuthority() (gas: 124270) -AuthTest:testFailCallFunctionAsNonOwner() (gas: 15491) -AuthTest:testFailCallFunctionAsOwnerWithOutOfOrderAuthority() (gas: 136042) -AuthTest:testFailCallFunctionWithRestrictiveAuthority() (gas: 129178) -AuthTest:testFailSetAuthorityAsNonOwner() (gas: 18304) -AuthTest:testFailSetAuthorityWithRestrictiveAuthority() (gas: 129078) -AuthTest:testFailSetOwnerAsNonOwner() (gas: 15587) -AuthTest:testFailSetOwnerAsOwnerWithOutOfOrderAuthority() (gas: 136118) -AuthTest:testFailSetOwnerWithRestrictiveAuthority() (gas: 129264) -AuthTest:testSetAuthorityAsOwner() (gas: 32235) -AuthTest:testSetAuthorityAsOwnerWithOutOfOrderAuthority() (gas: 226463) -AuthTest:testSetAuthorityWithPermissiveAuthority() (gas: 125918) -AuthTest:testSetOwnerAsOwner() (gas: 15276) -AuthTest:testSetOwnerWithPermissiveAuthority() (gas: 127906) -Bytes32AddressLibTest:testFillLast12Bytes() (gas: 223) -Bytes32AddressLibTest:testFromLast20Bytes() (gas: 191) -CREATE3Test:testDeployERC20() (gas: 852410) -CREATE3Test:testFailDoubleDeployDifferentBytecode() (gas: 9079256848778914164) -CREATE3Test:testFailDoubleDeploySameBytecode() (gas: 9079256848778906218) -DSTestPlusTest:testBound() (gas: 14208) -DSTestPlusTest:testBrutalizeMemory() (gas: 823) -DSTestPlusTest:testFailBoundMinBiggerThanMax() (gas: 287) -DSTestPlusTest:testMeasuringGas() (gas: 24600) -DSTestPlusTest:testRelApproxEqBothZeroesPasses() (gas: 391) -ERC1155Test:testApproveAll() (gas: 31053) -ERC1155Test:testBatchBalanceOf() (gas: 157552) -ERC1155Test:testBatchBurn() (gas: 151044) -ERC1155Test:testBatchMintToEOA() (gas: 137286) -ERC1155Test:testBatchMintToERC1155Recipient() (gas: 942660) -ERC1155Test:testBurn() (gas: 38569) -ERC1155Test:testFailBalanceOfBatchWithArrayMismatch() (gas: 7933) -ERC1155Test:testFailBatchBurnInsufficientBalance() (gas: 136170) -ERC1155Test:testFailBatchBurnWithArrayLengthMismatch() (gas: 135536) -ERC1155Test:testFailBatchMintToNonERC1155Recipient() (gas: 167311) -ERC1155Test:testFailBatchMintToRevertingERC1155Recipient() (gas: 358854) -ERC1155Test:testFailBatchMintToWrongReturnDataERC1155Recipient() (gas: 310733) -ERC1155Test:testFailBatchMintToZero() (gas: 131709) -ERC1155Test:testFailBatchMintWithArrayMismatch() (gas: 9621) -ERC1155Test:testFailBurnInsufficientBalance() (gas: 34823) -ERC1155Test:testFailMintToNonERC155Recipient() (gas: 68192) -ERC1155Test:testFailMintToRevertingERC155Recipient() (gas: 259413) -ERC1155Test:testFailMintToWrongReturnDataERC155Recipient() (gas: 259412) -ERC1155Test:testFailMintToZero() (gas: 33698) -ERC1155Test:testFailSafeBatchTransferFromToNonERC1155Recipient() (gas: 321348) -ERC1155Test:testFailSafeBatchTransferFromToRevertingERC1155Recipient() (gas: 512927) -ERC1155Test:testFailSafeBatchTransferFromToWrongReturnDataERC1155Recipient() (gas: 464850) -ERC1155Test:testFailSafeBatchTransferFromToZero() (gas: 286521) -ERC1155Test:testFailSafeBatchTransferFromWithArrayLengthMismatch() (gas: 162646) -ERC1155Test:testFailSafeBatchTransferInsufficientBalance() (gas: 163526) -ERC1155Test:testFailSafeTransferFromInsufficientBalance() (gas: 63260) -ERC1155Test:testFailSafeTransferFromSelfInsufficientBalance() (gas: 34320) -ERC1155Test:testFailSafeTransferFromToNonERC155Recipient() (gas: 96510) -ERC1155Test:testFailSafeTransferFromToRevertingERC1155Recipient() (gas: 287732) -ERC1155Test:testFailSafeTransferFromToWrongReturnDataERC1155Recipient() (gas: 239598) -ERC1155Test:testFailSafeTransferFromToZero() (gas: 62007) -ERC1155Test:testMintToEOA() (gas: 34736) -ERC1155Test:testMintToERC1155Recipient() (gas: 608327) -ERC1155Test:testSafeBatchTransferFromToEOA() (gas: 297808) -ERC1155Test:testSafeBatchTransferFromToERC1155Recipient() (gas: 1122267) -ERC1155Test:testSafeTransferFromSelf() (gas: 64148) -ERC1155Test:testSafeTransferFromToEOA() (gas: 93154) -ERC1155Test:testSafeTransferFromToERC1155Recipient() (gas: 686493) -ERC1155BTest:testApproveAll() (gas: 30947) -ERC1155BTest:testBatchBalanceOf() (gas: 157205) -ERC1155BTest:testBatchBurn() (gas: 114460) -ERC1155BTest:testBatchMintToEOA() (gas: 135755) -ERC1155BTest:testBatchMintToERC1155Recipient() (gas: 941538) -ERC1155BTest:testBurn() (gas: 26502) -ERC1155BTest:testFailBalanceOfBatchWithArrayMismatch() (gas: 7933) -ERC1155BTest:testFailBatchBurnInsufficientBalance() (gas: 10052) -ERC1155BTest:testFailBatchMintToNonERC1155Recipient() (gas: 166023) -ERC1155BTest:testFailBatchMintToRevertingERC1155Recipient() (gas: 357584) -ERC1155BTest:testFailBatchMintToWrongReturnDataERC1155Recipient() (gas: 309459) -ERC1155BTest:testFailBatchMintToZero() (gas: 30941) -ERC1155BTest:testFailBurnInsufficientBalance() (gas: 7768) -ERC1155BTest:testFailMintToNonERC1155Recipient() (gas: 68217) -ERC1155BTest:testFailMintToRevertingERC1155Recipient() (gas: 259420) -ERC1155BTest:testFailMintToWrongReturnDataERC1155Recipient() (gas: 259419) -ERC1155BTest:testFailMintToZero() (gas: 13759) -ERC1155BTest:testFailSafeBatchTransferFromToNonERC1155Recipient() (gas: 722319) -ERC1155BTest:testFailSafeBatchTransferFromToRevertingERC1155Recipient() (gas: 913812) -ERC1155BTest:testFailSafeBatchTransferFromToWrongReturnDataERC1155Recipient() (gas: 865731) -ERC1155BTest:testFailSafeBatchTransferFromToZero() (gas: 687469) -ERC1155BTest:testFailSafeBatchTransferFromWithArrayLengthMismatch() (gas: 674842) -ERC1155BTest:testFailSafeBatchTransferInsufficientBalance() (gas: 552088) -ERC1155BTest:testFailSafeTransferFromInsufficientBalance() (gas: 549469) -ERC1155BTest:testFailSafeTransferFromSelfInsufficientBalance() (gas: 8381) -ERC1155BTest:testFailSafeTransferFromToNonERC1155Recipient() (gas: 74192) -ERC1155BTest:testFailSafeTransferFromToRevertingERC1155Recipient() (gas: 265392) -ERC1155BTest:testFailSafeTransferFromToWrongReturnDataERC1155Recipient() (gas: 217251) -ERC1155BTest:testFailSafeTransferFromToZero() (gas: 8362) -ERC1155BTest:testMintToEOA() (gas: 34635) -ERC1155BTest:testMintToERC1155Recipient() (gas: 608188) -ERC1155BTest:testSafeBatchTransferFromToEOA() (gas: 698163) -ERC1155BTest:testSafeBatchTransferFromToERC1155Recipient() (gas: 1522381) -ERC1155BTest:testSafeTransferFromSelf() (gas: 41761) -ERC1155BTest:testSafeTransferFromToEOA() (gas: 582817) -ERC1155BTest:testSafeTransferFromToERC1155Recipient() (gas: 1175925) -ERC20Test:testApprove() (gas: 31080) -ERC20Test:testBurn() (gas: 57014) -ERC20Test:testFailPermitBadDeadline() (gas: 36924) -ERC20Test:testFailPermitBadNonce() (gas: 36874) -ERC20Test:testFailPermitPastDeadline() (gas: 10938) -ERC20Test:testFailPermitReplay() (gas: 66285) -ERC20Test:testFailTransferFromInsufficientAllowance() (gas: 80837) -ERC20Test:testFailTransferFromInsufficientBalance() (gas: 81336) -ERC20Test:testFailTransferInsufficientBalance() (gas: 52784) -ERC20Test:testInfiniteApproveTransferFrom() (gas: 89748) -ERC20Test:testMint() (gas: 53768) -ERC20Test:testPermit() (gas: 63237) -ERC20Test:testTransfer() (gas: 60228) -ERC20Test:testTransferFrom() (gas: 83821) -ERC4626Test:testFailDepositWithNoApproval() (gas: 13345) -ERC4626Test:testFailDepositWithNotEnoughApproval() (gas: 86963) -ERC4626Test:testFailDepositZero() (gas: 7790) -ERC4626Test:testFailMintWithNoApproval() (gas: 13246) -ERC4626Test:testFailRedeemWithNoShareAmount() (gas: 32333) -ERC4626Test:testFailRedeemWithNotEnoughShareAmount() (gas: 203599) -ERC4626Test:testFailRedeemZero() (gas: 7955) -ERC4626Test:testFailWithdrawWithNoUnderlyingAmount() (gas: 32286) -ERC4626Test:testFailWithdrawWithNotEnoughUnderlyingAmount() (gas: 203539) -ERC4626Test:testMintZero() (gas: 54520) -ERC4626Test:testMultipleMintDepositRedeemWithdraw() (gas: 411122) -ERC4626Test:testVaultInteractionsForSomeoneElse() (gas: 286084) -ERC4626Test:testWithdrawZero() (gas: 52352) -ERC721Test:testApprove() (gas: 78427) -ERC721Test:testApproveAll() (gas: 31086) -ERC721Test:testApproveBurn() (gas: 65584) -ERC721Test:testBurn() (gas: 46124) -ERC721Test:testFailApproveUnAuthorized() (gas: 55598) -ERC721Test:testFailApproveUnMinted() (gas: 10194) -ERC721Test:testFailBalanceOfZeroAddress() (gas: 5576) -ERC721Test:testFailBurnUnMinted() (gas: 7857) -ERC721Test:testFailDoubleBurn() (gas: 58986) -ERC721Test:testFailDoubleMint() (gas: 53286) -ERC721Test:testFailMintToZero() (gas: 5754) -ERC721Test:testFailOwnerOfUnminted() (gas: 7631) -ERC721Test:testFailSafeMintToERC721RecipientWithWrongReturnData() (gas: 159028) -ERC721Test:testFailSafeMintToERC721RecipientWithWrongReturnDataWithData() (gas: 159825) -ERC721Test:testFailSafeMintToNonERC721Recipient() (gas: 89204) -ERC721Test:testFailSafeMintToNonERC721RecipientWithData() (gas: 89990) -ERC721Test:testFailSafeMintToRevertingERC721Recipient() (gas: 204738) -ERC721Test:testFailSafeMintToRevertingERC721RecipientWithData() (gas: 205556) -ERC721Test:testFailSafeTransferFromToERC721RecipientWithWrongReturnData() (gas: 187272) -ERC721Test:testFailSafeTransferFromToERC721RecipientWithWrongReturnDataWithData() (gas: 187722) -ERC721Test:testFailSafeTransferFromToNonERC721Recipient() (gas: 117409) -ERC721Test:testFailSafeTransferFromToNonERC721RecipientWithData() (gas: 117889) -ERC721Test:testFailSafeTransferFromToRevertingERC721Recipient() (gas: 232982) -ERC721Test:testFailSafeTransferFromToRevertingERC721RecipientWithData() (gas: 233391) -ERC721Test:testFailTransferFromNotOwner() (gas: 57894) -ERC721Test:testFailTransferFromToZero() (gas: 53359) -ERC721Test:testFailTransferFromUnOwned() (gas: 7999) -ERC721Test:testFailTransferFromWrongFrom() (gas: 53382) -ERC721Test:testMint() (gas: 54360) -ERC721Test:testSafeMintToEOA() (gas: 56974) -ERC721Test:testSafeMintToERC721Recipient() (gas: 381730) -ERC721Test:testSafeMintToERC721RecipientWithData() (gas: 402853) -ERC721Test:testSafeTransferFromToEOA() (gas: 95627) -ERC721Test:testSafeTransferFromToERC721Recipient() (gas: 440223) -ERC721Test:testSafeTransferFromToERC721RecipientWithData() (gas: 461042) -ERC721Test:testTransferFrom() (gas: 86347) -ERC721Test:testTransferFromApproveAll() (gas: 92897) -ERC721Test:testTransferFromSelf() (gas: 64820) -FixedPointMathLibTest:testDivWadDown() (gas: 831) +AuthTest:testCallFunctionAsOwner() (gas: 29820) +AuthTest:testCallFunctionWithPermissiveAuthority() (gas: 122664) +AuthTest:testFailCallFunctionAsNonOwner() (gas: 15472) +AuthTest:testFailCallFunctionAsOwnerWithOutOfOrderAuthority() (gas: 134230) +AuthTest:testFailCallFunctionWithRestrictiveAuthority() (gas: 127567) +AuthTest:testFailFuzzCallFunctionAsNonOwner(address) (runs: 256, μ: 15635, ~: 15635) +AuthTest:testFailFuzzCallFunctionWithRestrictiveAuthority(address) (runs: 256, μ: 127708, ~: 127708) +AuthTest:testFailFuzzSetAuthorityAsNonOwner(address,address) (runs: 256, μ: 15988, ~: 15988) +AuthTest:testFailFuzzSetAuthorityWithRestrictiveAuthority(address,address) (runs: 256, μ: 127777, ~: 127777) +AuthTest:testFailFuzzSetOwnerAsNonOwner(address,address) (runs: 256, μ: 15837, ~: 15837) +AuthTest:testFailFuzzSetOwnerAsOwnerWithOutOfOrderAuthority(address) (runs: 256, μ: 134532, ~: 134532) +AuthTest:testFailFuzzSetOwnerWithRestrictiveAuthority(address,address) (runs: 256, μ: 127957, ~: 127957) +AuthTest:testFailSetAuthorityAsNonOwner() (gas: 15784) +AuthTest:testFailSetAuthorityWithRestrictiveAuthority() (gas: 127467) +AuthTest:testFailSetOwnerAsNonOwner() (gas: 15568) +AuthTest:testFailSetOwnerAsOwnerWithOutOfOrderAuthority() (gas: 134305) +AuthTest:testFailSetOwnerWithRestrictiveAuthority() (gas: 127653) +AuthTest:testFuzzCallFunctionWithPermissiveAuthority(address) (runs: 256, μ: 127612, ~: 127631) +AuthTest:testFuzzSetAuthorityAsOwner(address) (runs: 256, μ: 32417, ~: 32417) +AuthTest:testFuzzSetAuthorityWithPermissiveAuthority(address,address) (runs: 256, μ: 129427, ~: 129427) +AuthTest:testFuzzSetOwnerAsOwner(address) (runs: 256, μ: 15456, ~: 15456) +AuthTest:testFuzzSetOwnerWithPermissiveAuthority(address,address) (runs: 256, μ: 129367, ~: 129386) +AuthTest:testSetAuthorityAsOwner() (gas: 32225) +AuthTest:testSetAuthorityAsOwnerWithOutOfOrderAuthority() (gas: 223085) +AuthTest:testSetAuthorityWithPermissiveAuthority() (gas: 124311) +AuthTest:testSetOwnerAsOwner() (gas: 15263) +AuthTest:testSetOwnerWithPermissiveAuthority() (gas: 126299) +Bytes32AddressLibTest:testFillLast12Bytes() (gas: 222) +Bytes32AddressLibTest:testFromLast20Bytes() (gas: 190) +CREATE3Test:testDeployERC20() (gas: 838566) +CREATE3Test:testFailDoubleDeployDifferentBytecode() (gas: 9079256848778913899) +CREATE3Test:testFailDoubleDeploySameBytecode() (gas: 9079256848778906143) +CREATE3Test:testFailFuzzDoubleDeployDifferentBytecode(bytes32,bytes,bytes) (runs: 256, μ: 5795341072053839733, ~: 8937393460516727571) +CREATE3Test:testFailFuzzDoubleDeploySameBytecode(bytes32,bytes) (runs: 256, μ: 5725517685643553963, ~: 8937393460516728746) +CREATE3Test:testFuzzDeployERC20(bytes32,string,string,uint8) (runs: 256, μ: 884745, ~: 884757) +DSTestPlusTest:testBound() (gas: 14272) +DSTestPlusTest:testBrutalizeMemory() (gas: 817) +DSTestPlusTest:testFailBoundMinBiggerThanMax() (gas: 285) +DSTestPlusTest:testFailFuzzBoundMinBiggerThanMax(uint256,uint256,uint256) (runs: 256, μ: 500, ~: 502) +DSTestPlusTest:testFuzzBound(uint256,uint256,uint256) (runs: 256, μ: 2768, ~: 2774) +DSTestPlusTest:testMeasuringGas() (gas: 24613) +DSTestPlusTest:testRelApproxEqBothZeroesPasses() (gas: 397) +ERC1155BTest:testApproveAll() (gas: 30937) +ERC1155BTest:testBatchBalanceOf() (gas: 157123) +ERC1155BTest:testBatchBurn() (gas: 114392) +ERC1155BTest:testBatchMintToEOA() (gas: 135702) +ERC1155BTest:testBatchMintToERC1155Recipient() (gas: 981458) +ERC1155BTest:testBurn() (gas: 26484) +ERC1155BTest:testFailBalanceOfBatchWithArrayMismatch() (gas: 7917) +ERC1155BTest:testFailBatchBurnInsufficientBalance() (gas: 10036) +ERC1155BTest:testFailBatchMintToNonERC1155Recipient() (gas: 165777) +ERC1155BTest:testFailBatchMintToRevertingERC1155Recipient() (gas: 350351) +ERC1155BTest:testFailBatchMintToWrongReturnDataERC1155Recipient() (gas: 304443) +ERC1155BTest:testFailBatchMintToZero() (gas: 28405) +ERC1155BTest:testFailBurnInsufficientBalance() (gas: 7760) +ERC1155BTest:testFailMintToNonERC1155Recipient() (gas: 67998) +ERC1155BTest:testFailMintToRevertingERC1155Recipient() (gas: 252217) +ERC1155BTest:testFailMintToWrongReturnDataERC1155Recipient() (gas: 252216) +ERC1155BTest:testFailMintToZero() (gas: 11246) +ERC1155BTest:testFailSafeBatchTransferFromToNonERC1155Recipient() (gas: 706891) +ERC1155BTest:testFailSafeBatchTransferFromToRevertingERC1155Recipient() (gas: 891400) +ERC1155BTest:testFailSafeBatchTransferFromToWrongReturnDataERC1155Recipient() (gas: 845536) +ERC1155BTest:testFailSafeBatchTransferFromToZero() (gas: 669763) +ERC1155BTest:testFailSafeBatchTransferFromWithArrayLengthMismatch() (gas: 659674) +ERC1155BTest:testFailSafeBatchTransferInsufficientBalance() (gas: 536963) +ERC1155BTest:testFailSafeTransferFromInsufficientBalance() (gas: 534358) +ERC1155BTest:testFailSafeTransferFromSelfInsufficientBalance() (gas: 8369) +ERC1155BTest:testFailSafeTransferFromToNonERC1155Recipient() (gas: 73953) +ERC1155BTest:testFailSafeTransferFromToRevertingERC1155Recipient() (gas: 258169) +ERC1155BTest:testFailSafeTransferFromToWrongReturnDataERC1155Recipient() (gas: 212245) +ERC1155BTest:testFailSafeTransferFromToZero() (gas: 8350) +ERC1155BTest:testMintToEOA() (gas: 34620) +ERC1155BTest:testMintToERC1155Recipient() (gas: 648881) +ERC1155BTest:testSafeBatchTransferFromToEOA() (gas: 682915) +ERC1155BTest:testSafeBatchTransferFromToERC1155Recipient() (gas: 1547106) +ERC1155BTest:testSafeTransferFromSelf() (gas: 41721) +ERC1155BTest:testSafeTransferFromToEOA() (gas: 567678) +ERC1155BTest:testSafeTransferFromToERC1155Recipient() (gas: 1201505) +ERC1155Test:testApproveAll() (gas: 31043) +ERC1155Test:testBatchBalanceOf() (gas: 157479) +ERC1155Test:testBatchBurn() (gas: 150991) +ERC1155Test:testBatchMintToEOA() (gas: 137239) +ERC1155Test:testBatchMintToERC1155Recipient() (gas: 982585) +ERC1155Test:testBurn() (gas: 38560) +ERC1155Test:testFailBalanceOfBatchWithArrayMismatch() (gas: 7917) +ERC1155Test:testFailBatchBurnInsufficientBalance() (gas: 136125) +ERC1155Test:testFailBatchBurnWithArrayLengthMismatch() (gas: 135493) +ERC1155Test:testFailBatchMintToNonERC1155Recipient() (gas: 167071) +ERC1155Test:testFailBatchMintToRevertingERC1155Recipient() (gas: 351627) +ERC1155Test:testFailBatchMintToWrongReturnDataERC1155Recipient() (gas: 305726) +ERC1155Test:testFailBatchMintToZero() (gas: 129179) +ERC1155Test:testFailBatchMintWithArrayMismatch() (gas: 9599) +ERC1155Test:testFailBurnInsufficientBalance() (gas: 34813) +ERC1155Test:testFailFuzzBalanceOfBatchWithArrayMismatch(address[],uint256[]) (runs: 256, μ: 58008, ~: 58774) +ERC1155Test:testFailFuzzBatchBurnInsufficientBalance(address,uint256[],uint256[],uint256[],bytes) (runs: 256, μ: 1401703, ~: 589548) +ERC1155Test:testFailFuzzBatchBurnWithArrayLengthMismatch(address,uint256[],uint256[],uint256[],bytes) (runs: 256, μ: 86132, ~: 76405) +ERC1155Test:testFailFuzzBatchMintToNonERC1155Recipient(uint256[],uint256[],bytes) (runs: 256, μ: 3185493, ~: 2668585) +ERC1155Test:testFailFuzzBatchMintToRevertingERC1155Recipient(uint256[],uint256[],bytes) (runs: 256, μ: 3370046, ~: 2853136) +ERC1155Test:testFailFuzzBatchMintToWrongReturnDataERC1155Recipient(uint256[],uint256[],bytes) (runs: 256, μ: 3324166, ~: 2807257) +ERC1155Test:testFailFuzzBatchMintToZero(uint256[],uint256[],bytes) (runs: 256, μ: 3123488, ~: 2605508) +ERC1155Test:testFailFuzzBatchMintWithArrayMismatch(address,uint256[],uint256[],bytes) (runs: 256, μ: 66403, ~: 66465) +ERC1155Test:testFailFuzzBurnInsufficientBalance(address,uint256,uint256,uint256,bytes) (runs: 256, μ: 35147, ~: 38181) +ERC1155Test:testFailFuzzMintToNonERC155Recipient(uint256,uint256,bytes) (runs: 256, μ: 68208, ~: 68890) +ERC1155Test:testFailFuzzMintToRevertingERC155Recipient(uint256,uint256,bytes) (runs: 256, μ: 252441, ~: 253123) +ERC1155Test:testFailFuzzMintToWrongReturnDataERC155Recipient(uint256,uint256,bytes) (runs: 256, μ: 252463, ~: 253145) +ERC1155Test:testFailFuzzMintToZero(uint256,uint256,bytes) (runs: 256, μ: 31314, ~: 32044) +ERC1155Test:testFailFuzzSafeBatchTransferFromToNonERC1155Recipient(uint256[],uint256[],uint256[],bytes,bytes) (runs: 256, μ: 3541335, ~: 2961230) +ERC1155Test:testFailFuzzSafeBatchTransferFromToRevertingERC1155Recipient(uint256[],uint256[],uint256[],bytes,bytes) (runs: 256, μ: 3725895, ~: 3145784) +ERC1155Test:testFailFuzzSafeBatchTransferFromToWrongReturnDataERC1155Recipient(uint256[],uint256[],uint256[],bytes,bytes) (runs: 256, μ: 3680014, ~: 3099906) +ERC1155Test:testFailFuzzSafeBatchTransferFromToZero(uint256[],uint256[],uint256[],bytes,bytes) (runs: 256, μ: 3503972, ~: 2923813) +ERC1155Test:testFailFuzzSafeBatchTransferFromWithArrayLengthMismatch(address,uint256[],uint256[],uint256[],bytes,bytes) (runs: 256, μ: 79071, ~: 76639) +ERC1155Test:testFailFuzzSafeBatchTransferInsufficientBalance(address,uint256[],uint256[],uint256[],bytes,bytes) (runs: 256, μ: 1805127, ~: 647144) +ERC1155Test:testFailFuzzSafeTransferFromInsufficientBalance(address,uint256,uint256,uint256,bytes,bytes) (runs: 256, μ: 62851, ~: 67305) +ERC1155Test:testFailFuzzSafeTransferFromSelfInsufficientBalance(address,uint256,uint256,uint256,bytes,bytes) (runs: 256, μ: 35616, ~: 38441) +ERC1155Test:testFailFuzzSafeTransferFromToNonERC155Recipient(uint256,uint256,uint256,bytes,bytes) (runs: 256, μ: 96370, ~: 100283) +ERC1155Test:testFailFuzzSafeTransferFromToRevertingERC1155Recipient(uint256,uint256,uint256,bytes,bytes) (runs: 256, μ: 280577, ~: 284490) +ERC1155Test:testFailFuzzSafeTransferFromToWrongReturnDataERC1155Recipient(uint256,uint256,uint256,bytes,bytes) (runs: 256, μ: 234638, ~: 238551) +ERC1155Test:testFailFuzzSafeTransferFromToZero(uint256,uint256,uint256,bytes,bytes) (runs: 256, μ: 59557, ~: 63473) +ERC1155Test:testFailMintToNonERC155Recipient() (gas: 67978) +ERC1155Test:testFailMintToRevertingERC155Recipient() (gas: 252215) +ERC1155Test:testFailMintToWrongReturnDataERC155Recipient() (gas: 252214) +ERC1155Test:testFailMintToZero() (gas: 31190) +ERC1155Test:testFailSafeBatchTransferFromToNonERC1155Recipient() (gas: 321099) +ERC1155Test:testFailSafeBatchTransferFromToRevertingERC1155Recipient() (gas: 505691) +ERC1155Test:testFailSafeBatchTransferFromToWrongReturnDataERC1155Recipient() (gas: 459830) +ERC1155Test:testFailSafeBatchTransferFromToZero() (gas: 283994) +ERC1155Test:testFailSafeBatchTransferFromWithArrayLengthMismatch() (gas: 162592) +ERC1155Test:testFailSafeBatchTransferInsufficientBalance() (gas: 163472) +ERC1155Test:testFailSafeTransferFromInsufficientBalance() (gas: 63239) +ERC1155Test:testFailSafeTransferFromSelfInsufficientBalance() (gas: 34297) +ERC1155Test:testFailSafeTransferFromToNonERC155Recipient() (gas: 96289) +ERC1155Test:testFailSafeTransferFromToRevertingERC1155Recipient() (gas: 280527) +ERC1155Test:testFailSafeTransferFromToWrongReturnDataERC1155Recipient() (gas: 234610) +ERC1155Test:testFailSafeTransferFromToZero() (gas: 59492) +ERC1155Test:testFuzzApproveAll(address,bool) (runs: 256, μ: 22805, ~: 31343) +ERC1155Test:testFuzzBatchBalanceOf(address[],uint256[],uint256[],bytes) (runs: 256, μ: 3542457, ~: 2926682) +ERC1155Test:testFuzzBatchBurn(address,uint256[],uint256[],uint256[],bytes) (runs: 256, μ: 3623036, ~: 3043733) +ERC1155Test:testFuzzBatchMintToEOA(address,uint256[],uint256[],bytes) (runs: 256, μ: 3056089, ~: 2515633) +ERC1155Test:testFuzzBatchMintToERC1155Recipient(uint256[],uint256[],bytes) (runs: 256, μ: 7362382, ~: 6420706) +ERC1155Test:testFuzzBurn(address,uint256,uint256,bytes,uint256) (runs: 256, μ: 40402, ~: 42070) +ERC1155Test:testFuzzMintToEOA(address,uint256,uint256,bytes) (runs: 256, μ: 35331, ~: 35837) +ERC1155Test:testFuzzMintToERC1155Recipient(uint256,uint256,bytes) (runs: 256, μ: 678703, ~: 672019) +ERC1155Test:testFuzzSafeBatchTransferFromToEOA(address,uint256[],uint256[],uint256[],bytes,bytes) (runs: 256, μ: 5007136, ~: 4004697) +ERC1155Test:testFuzzSafeBatchTransferFromToERC1155Recipient(uint256[],uint256[],uint256[],bytes,bytes) (runs: 256, μ: 7737773, ~: 6601105) +ERC1155Test:testFuzzSafeTransferFromSelf(uint256,uint256,bytes,uint256,address,bytes) (runs: 256, μ: 64147, ~: 68471) +ERC1155Test:testFuzzSafeTransferFromToEOA(uint256,uint256,bytes,uint256,address,bytes) (runs: 256, μ: 93877, ~: 97364) +ERC1155Test:testFuzzSafeTransferFromToERC1155Recipient(uint256,uint256,bytes,uint256,bytes) (runs: 256, μ: 757169, ~: 753330) +ERC1155Test:testMintToEOA() (gas: 34726) +ERC1155Test:testMintToERC1155Recipient() (gas: 649024) +ERC1155Test:testSafeBatchTransferFromToEOA() (gas: 297744) +ERC1155Test:testSafeBatchTransferFromToERC1155Recipient() (gas: 1162187) +ERC1155Test:testSafeTransferFromSelf() (gas: 64127) +ERC1155Test:testSafeTransferFromToEOA() (gas: 93135) +ERC1155Test:testSafeTransferFromToERC1155Recipient() (gas: 727206) +ERC20Invariants:invariantBalanceSum() (runs: 256, calls: 3840, reverts: 2336) +ERC20Test:invariantMetadata() (runs: 256, calls: 3840, reverts: 2603) +ERC20Test:testApprove() (gas: 31071) +ERC20Test:testBurn() (gas: 57007) +ERC20Test:testFailFuzzBurnInsufficientBalance(address,uint256,uint256) (runs: 256, μ: 52049, ~: 55453) +ERC20Test:testFailFuzzPermitBadDeadline(uint256,address,uint256,uint256) (runs: 256, μ: 31762, ~: 37146) +ERC20Test:testFailFuzzPermitBadNonce(uint256,address,uint256,uint256,uint256) (runs: 256, μ: 32109, ~: 37135) +ERC20Test:testFailFuzzPermitPastDeadline(uint256,address,uint256,uint256) (runs: 256, μ: 11956, ~: 13140) +ERC20Test:testFailFuzzPermitReplay(uint256,address,uint256,uint256) (runs: 256, μ: 55887, ~: 66560) +ERC20Test:testFailFuzzTransferFromInsufficientAllowance(address,uint256,uint256) (runs: 256, μ: 79520, ~: 83392) +ERC20Test:testFailFuzzTransferFromInsufficientBalance(address,uint256,uint256) (runs: 256, μ: 79395, ~: 83943) +ERC20Test:testFailFuzzTransferInsufficientBalance(address,uint256,uint256) (runs: 256, μ: 51940, ~: 55338) +ERC20Test:testFailPermitBadDeadline() (gas: 36901) +ERC20Test:testFailPermitBadNonce() (gas: 36847) +ERC20Test:testFailPermitPastDeadline() (gas: 10930) +ERC20Test:testFailPermitReplay() (gas: 66245) +ERC20Test:testFailTransferFromInsufficientAllowance() (gas: 80826) +ERC20Test:testFailTransferFromInsufficientBalance() (gas: 81331) +ERC20Test:testFailTransferInsufficientBalance() (gas: 52780) +ERC20Test:testFuzzApprove(address,uint256) (runs: 256, μ: 29905, ~: 31227) +ERC20Test:testFuzzBurn(address,uint256,uint256) (runs: 256, μ: 57908, ~: 59679) +ERC20Test:testFuzzMetadata(string,string,uint8) (runs: 256, μ: 832653, ~: 826936) +ERC20Test:testFuzzMint(address,uint256) (runs: 256, μ: 51428, ~: 53916) +ERC20Test:testFuzzPermit(uint248,address,uint256,uint256) (runs: 256, μ: 62467, ~: 63478) +ERC20Test:testFuzzTransfer(address,uint256) (runs: 256, μ: 57942, ~: 60430) +ERC20Test:testFuzzTransferFrom(address,uint256,uint256) (runs: 256, μ: 86993, ~: 92814) +ERC20Test:testInfiniteApproveTransferFrom() (gas: 89725) +ERC20Test:testMint() (gas: 53759) +ERC20Test:testPermit() (gas: 63202) +ERC20Test:testTransfer() (gas: 60218) +ERC20Test:testTransferFrom() (gas: 83808) +ERC4626Test:invariantMetadata() (runs: 256, calls: 3840, reverts: 2920) +ERC4626Test:testFailDepositWithNoApproval() (gas: 13335) +ERC4626Test:testFailDepositWithNotEnoughApproval() (gas: 86944) +ERC4626Test:testFailDepositZero() (gas: 7785) +ERC4626Test:testFailMintWithNoApproval() (gas: 13232) +ERC4626Test:testFailRedeemWithNoShareAmount() (gas: 32326) +ERC4626Test:testFailRedeemWithNotEnoughShareAmount() (gas: 203581) +ERC4626Test:testFailRedeemZero() (gas: 7949) +ERC4626Test:testFailWithdrawWithNoUnderlyingAmount() (gas: 32275) +ERC4626Test:testFailWithdrawWithNotEnoughUnderlyingAmount() (gas: 203517) +ERC4626Test:testFuzzMetadata(string,string) (runs: 256, μ: 1426162, ~: 1426681) +ERC4626Test:testFuzzSingleDepositWithdraw(uint128) (runs: 256, μ: 201323, ~: 201334) +ERC4626Test:testFuzzSingleMintRedeem(uint128) (runs: 256, μ: 201291, ~: 201302) +ERC4626Test:testMintZero() (gas: 54488) +ERC4626Test:testMultipleMintDepositRedeemWithdraw() (gas: 410676) +ERC4626Test:testVaultInteractionsForSomeoneElse() (gas: 285997) +ERC4626Test:testWithdrawZero() (gas: 52318) +ERC721Test:invariantMetadata() (runs: 256, calls: 3840, reverts: 2181) +ERC721Test:testApprove() (gas: 78410) +ERC721Test:testApproveAll() (gas: 31076) +ERC721Test:testApproveBurn() (gas: 65556) +ERC721Test:testBurn() (gas: 46104) +ERC721Test:testFailApproveUnAuthorized() (gas: 55583) +ERC721Test:testFailApproveUnMinted() (gas: 10185) +ERC721Test:testFailBalanceOfZeroAddress() (gas: 5569) +ERC721Test:testFailBurnUnMinted() (gas: 7849) +ERC721Test:testFailDoubleBurn() (gas: 58966) +ERC721Test:testFailDoubleMint() (gas: 53272) +ERC721Test:testFailFuzzApproveUnAuthorized(address,uint256,address) (runs: 256, μ: 55908, ~: 55909) +ERC721Test:testFailFuzzApproveUnMinted(uint256,address) (runs: 256, μ: 10363, ~: 10363) +ERC721Test:testFailFuzzBurnUnMinted(uint256) (runs: 256, μ: 7895, ~: 7895) +ERC721Test:testFailFuzzDoubleBurn(uint256,address) (runs: 256, μ: 59143, ~: 59143) +ERC721Test:testFailFuzzDoubleMint(uint256,address) (runs: 256, μ: 53481, ~: 53481) +ERC721Test:testFailFuzzMintToZero(uint256) (runs: 256, μ: 5802, ~: 5802) +ERC721Test:testFailFuzzOwnerOfUnminted(uint256) (runs: 256, μ: 7704, ~: 7704) +ERC721Test:testFailFuzzSafeMintToERC721RecipientWithWrongReturnData(uint256) (runs: 256, μ: 156725, ~: 156725) +ERC721Test:testFailFuzzSafeMintToERC721RecipientWithWrongReturnDataWithData(uint256,bytes) (runs: 256, μ: 157825, ~: 157770) +ERC721Test:testFailFuzzSafeMintToNonERC721Recipient(uint256) (runs: 256, μ: 89049, ~: 89049) +ERC721Test:testFailFuzzSafeMintToNonERC721RecipientWithData(uint256,bytes) (runs: 256, μ: 90178, ~: 90122) +ERC721Test:testFailFuzzSafeMintToRevertingERC721Recipient(uint256) (runs: 256, μ: 200418, ~: 200418) +ERC721Test:testFailFuzzSafeMintToRevertingERC721RecipientWithData(uint256,bytes) (runs: 256, μ: 201515, ~: 201460) +ERC721Test:testFailFuzzSafeTransferFromToERC721RecipientWithWrongReturnData(uint256) (runs: 256, μ: 184922, ~: 184922) +ERC721Test:testFailFuzzSafeTransferFromToERC721RecipientWithWrongReturnDataWithData(uint256,bytes) (runs: 256, μ: 185648, ~: 185644) +ERC721Test:testFailFuzzSafeTransferFromToNonERC721Recipient(uint256) (runs: 256, μ: 117293, ~: 117293) +ERC721Test:testFailFuzzSafeTransferFromToNonERC721RecipientWithData(uint256,bytes) (runs: 256, μ: 118007, ~: 118003) +ERC721Test:testFailFuzzSafeTransferFromToRevertingERC721Recipient(uint256) (runs: 256, μ: 228660, ~: 228660) +ERC721Test:testFailFuzzSafeTransferFromToRevertingERC721RecipientWithData(uint256,bytes) (runs: 256, μ: 229362, ~: 229358) +ERC721Test:testFailFuzzTransferFromNotOwner(address,address,uint256) (runs: 256, μ: 57575, ~: 58187) +ERC721Test:testFailFuzzTransferFromToZero(uint256) (runs: 256, μ: 53446, ~: 53446) +ERC721Test:testFailFuzzTransferFromUnOwned(address,address,uint256) (runs: 256, μ: 8264, ~: 8229) +ERC721Test:testFailFuzzTransferFromWrongFrom(address,address,address,uint256) (runs: 256, μ: 53156, ~: 53714) +ERC721Test:testFailMintToZero() (gas: 5746) +ERC721Test:testFailOwnerOfUnminted() (gas: 7625) +ERC721Test:testFailSafeMintToERC721RecipientWithWrongReturnData() (gas: 156627) +ERC721Test:testFailSafeMintToERC721RecipientWithWrongReturnDataWithData() (gas: 157395) +ERC721Test:testFailSafeMintToNonERC721Recipient() (gas: 88991) +ERC721Test:testFailSafeMintToNonERC721RecipientWithData() (gas: 89748) +ERC721Test:testFailSafeMintToRevertingERC721Recipient() (gas: 200318) +ERC721Test:testFailSafeMintToRevertingERC721RecipientWithData() (gas: 201107) +ERC721Test:testFailSafeTransferFromToERC721RecipientWithWrongReturnData() (gas: 184864) +ERC721Test:testFailSafeTransferFromToERC721RecipientWithWrongReturnDataWithData() (gas: 185311) +ERC721Test:testFailSafeTransferFromToNonERC721Recipient() (gas: 117189) +ERC721Test:testFailSafeTransferFromToNonERC721RecipientWithData() (gas: 117666) +ERC721Test:testFailSafeTransferFromToRevertingERC721Recipient() (gas: 228555) +ERC721Test:testFailSafeTransferFromToRevertingERC721RecipientWithData() (gas: 228961) +ERC721Test:testFailTransferFromNotOwner() (gas: 57877) +ERC721Test:testFailTransferFromToZero() (gas: 53343) +ERC721Test:testFailTransferFromUnOwned() (gas: 7990) +ERC721Test:testFailTransferFromWrongFrom() (gas: 53367) +ERC721Test:testFuzzApprove(address,uint256) (runs: 256, μ: 78622, ~: 78622) +ERC721Test:testFuzzApproveAll(address,bool) (runs: 256, μ: 22838, ~: 31376) +ERC721Test:testFuzzApproveBurn(address,uint256) (runs: 256, μ: 65422, ~: 65556) +ERC721Test:testFuzzBurn(address,uint256) (runs: 256, μ: 46145, ~: 46158) +ERC721Test:testFuzzMetadata(string,string) (runs: 256, μ: 1288827, ~: 1289171) +ERC721Test:testFuzzMint(address,uint256) (runs: 256, μ: 54515, ~: 54515) +ERC721Test:testFuzzSafeMintToEOA(uint256,address) (runs: 256, μ: 57119, ~: 57342) +ERC721Test:testFuzzSafeMintToERC721Recipient(uint256) (runs: 256, μ: 418437, ~: 419526) +ERC721Test:testFuzzSafeMintToERC721RecipientWithData(uint256,bytes) (runs: 256, μ: 472331, ~: 463252) +ERC721Test:testFuzzSafeTransferFromToEOA(uint256,address) (runs: 256, μ: 95257, ~: 96003) +ERC721Test:testFuzzSafeTransferFromToERC721Recipient(uint256) (runs: 256, μ: 476974, ~: 478063) +ERC721Test:testFuzzSafeTransferFromToERC721RecipientWithData(uint256,bytes) (runs: 256, μ: 530499, ~: 521472) +ERC721Test:testFuzzTransferFrom(uint256,address) (runs: 256, μ: 86434, ~: 86446) +ERC721Test:testFuzzTransferFromApproveAll(uint256,address) (runs: 256, μ: 93171, ~: 93171) +ERC721Test:testFuzzTransferFromSelf(uint256,address) (runs: 256, μ: 65049, ~: 65050) +ERC721Test:testMint() (gas: 54344) +ERC721Test:testSafeMintToEOA() (gas: 56958) +ERC721Test:testSafeMintToERC721Recipient() (gas: 419441) +ERC721Test:testSafeMintToERC721RecipientWithData() (gas: 440475) +ERC721Test:testSafeTransferFromToEOA() (gas: 95585) +ERC721Test:testSafeTransferFromToERC721Recipient() (gas: 477909) +ERC721Test:testSafeTransferFromToERC721RecipientWithData() (gas: 498665) +ERC721Test:testTransferFrom() (gas: 86312) +ERC721Test:testTransferFromApproveAll() (gas: 92855) +ERC721Test:testTransferFromSelf() (gas: 64786) +FixedPointMathLibTest:testDivWadDown() (gas: 838) FixedPointMathLibTest:testDivWadDownEdgeCases() (gas: 435) -FixedPointMathLibTest:testDivWadUp() (gas: 949) +FixedPointMathLibTest:testDivWadUp() (gas: 957) FixedPointMathLibTest:testDivWadUpEdgeCases() (gas: 450) -FixedPointMathLibTest:testExpWad() (gas: 7303) -FixedPointMathLibTest:testFailDivWadDownZeroDenominator() (gas: 330) -FixedPointMathLibTest:testFailDivWadUpZeroDenominator() (gas: 309) -FixedPointMathLibTest:testFailMulDivDownZeroDenominator() (gas: 338) -FixedPointMathLibTest:testFailMulDivUpZeroDenominator() (gas: 296) -FixedPointMathLibTest:testFuzzLog2() (gas: 315757) -FixedPointMathLibTest:testLnWad() (gas: 2416) -FixedPointMathLibTest:testLnWadBig() (gas: 2392) -FixedPointMathLibTest:testLnWadNegative() (gas: 232) -FixedPointMathLibTest:testLnWadOverflow() (gas: 209) -FixedPointMathLibTest:testLnWadSmall() (gas: 3142) -FixedPointMathLibTest:testLog2() (gas: 1755) -FixedPointMathLibTest:testMulDivDown() (gas: 1883) -FixedPointMathLibTest:testMulDivDownEdgeCases() (gas: 729) -FixedPointMathLibTest:testMulDivUp() (gas: 2250) -FixedPointMathLibTest:testMulDivUpEdgeCases() (gas: 846) -FixedPointMathLibTest:testMulWadDown() (gas: 844) -FixedPointMathLibTest:testMulWadDownEdgeCases() (gas: 887) -FixedPointMathLibTest:testMulWadUp() (gas: 1003) -FixedPointMathLibTest:testMulWadUpEdgeCases() (gas: 981) -FixedPointMathLibTest:testRPow() (gas: 2142) -FixedPointMathLibTest:testSqrt() (gas: 2091) -LibBitmapTest:testBitmapGet() (gas: 7806) -LibBitmapTest:testBitmapSet() (gas: 28649) -LibBitmapTest:testBitmapSetTo() (gas: 20672) -MerkleProofTest:testValidProofSupplied() (gas: 2217) -MerkleProofTest:testVerifyEmptyMerkleProofSuppliedLeafAndRootDifferent() (gas: 1498) -MerkleProofTest:testVerifyEmptyMerkleProofSuppliedLeafAndRootSame() (gas: 1492) -MerkleProofTest:testVerifyInvalidProofSupplied() (gas: 2236) -MultiRolesAuthorityTest:testCanCallPublicCapability() (gas: 34293) -MultiRolesAuthorityTest:testCanCallWithAuthorizedRole() (gas: 80575) -MultiRolesAuthorityTest:testCanCallWithCustomAuthority() (gas: 422681) -MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesPublicCapability() (gas: 247696) -MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesUserWithRole() (gas: 256828) -MultiRolesAuthorityTest:testSetPublicCapabilities() (gas: 27762) -MultiRolesAuthorityTest:testSetRoleCapabilities() (gas: 28968) -MultiRolesAuthorityTest:testSetRoles() (gas: 28971) -MultiRolesAuthorityTest:testSetTargetCustomAuthority() (gas: 27976) -OwnedTest:testCallFunctionAsNonOwner() (gas: 11311) -OwnedTest:testCallFunctionAsOwner() (gas: 10479) -OwnedTest:testSetOwner() (gas: 13035) -ReentrancyGuardTest:testFailUnprotectedCall() (gas: 46167) -ReentrancyGuardTest:testNoReentrancy() (gas: 7515) -ReentrancyGuardTest:testProtectedCall() (gas: 33470) -RolesAuthorityTest:testCanCallPublicCapability() (gas: 33319) -RolesAuthorityTest:testCanCallWithAuthorizedRole() (gas: 79584) -RolesAuthorityTest:testSetPublicCapabilities() (gas: 29183) -RolesAuthorityTest:testSetRoleCapabilities() (gas: 30276) -RolesAuthorityTest:testSetRoles() (gas: 28951) -SSTORE2Test:testFailReadInvalidPointer() (gas: 2905) -SSTORE2Test:testFailReadInvalidPointerCustomBounds() (gas: 3098) -SSTORE2Test:testFailReadInvalidPointerCustomStartBound() (gas: 3004) -SSTORE2Test:testFailWriteReadEmptyOutOfBounds() (gas: 34448) -SSTORE2Test:testFailWriteReadOutOfBounds() (gas: 34426) -SSTORE2Test:testFailWriteReadOutOfStartBound() (gas: 34317) -SSTORE2Test:testWriteRead() (gas: 53497) -SSTORE2Test:testWriteReadCustomBounds() (gas: 34869) -SSTORE2Test:testWriteReadCustomStartBound() (gas: 34784) -SSTORE2Test:testWriteReadEmptyBound() (gas: 34677) -SSTORE2Test:testWriteReadFullBoundedRead() (gas: 53716) -SSTORE2Test:testWriteReadFullStartBound() (gas: 34764) -SafeCastLibTest:testFailSafeCastTo128() (gas: 364) -SafeCastLibTest:testFailSafeCastTo160() (gas: 320) -SafeCastLibTest:testFailSafeCastTo192() (gas: 344) -SafeCastLibTest:testFailSafeCastTo224() (gas: 320) -SafeCastLibTest:testFailSafeCastTo248() (gas: 343) -SafeCastLibTest:testFailSafeCastTo32() (gas: 319) -SafeCastLibTest:testFailSafeCastTo64() (gas: 364) -SafeCastLibTest:testFailSafeCastTo8() (gas: 339) -SafeCastLibTest:testFailSafeCastTo96() (gas: 365) -SafeCastLibTest:testSafeCastTo128() (gas: 471) -SafeCastLibTest:testSafeCastTo160() (gas: 469) -SafeCastLibTest:testSafeCastTo192() (gas: 471) -SafeCastLibTest:testSafeCastTo224() (gas: 470) -SafeCastLibTest:testSafeCastTo248() (gas: 449) -SafeCastLibTest:testSafeCastTo32() (gas: 493) -SafeCastLibTest:testSafeCastTo64() (gas: 448) -SafeCastLibTest:testSafeCastTo8() (gas: 468) -SafeCastLibTest:testSafeCastTo96() (gas: 448) -SafeTransferLibTest:testApproveWithMissingReturn() (gas: 30759) -SafeTransferLibTest:testApproveWithNonContract() (gas: 3032) -SafeTransferLibTest:testApproveWithReturnsTooMuch() (gas: 31117) -SafeTransferLibTest:testApproveWithStandardERC20() (gas: 30845) -SafeTransferLibTest:testFailApproveWithReturnsFalse() (gas: 5610) -SafeTransferLibTest:testFailApproveWithReturnsTooLittle() (gas: 5553) -SafeTransferLibTest:testFailApproveWithReverting() (gas: 5575) -SafeTransferLibTest:testFailTransferETHToContractWithoutFallback() (gas: 7266) -SafeTransferLibTest:testFailTransferFromWithReturnsFalse() (gas: 13640) -SafeTransferLibTest:testFailTransferFromWithReturnsTooLittle() (gas: 13545) -SafeTransferLibTest:testFailTransferFromWithReverting() (gas: 9779) -SafeTransferLibTest:testFailTransferWithReturnsFalse() (gas: 8560) -SafeTransferLibTest:testFailTransferWithReturnsTooLittle() (gas: 8479) -SafeTransferLibTest:testFailTransferWithReverting() (gas: 8500) -SafeTransferLibTest:testTransferETH() (gas: 34636) -SafeTransferLibTest:testTransferFromWithMissingReturn() (gas: 49200) -SafeTransferLibTest:testTransferFromWithNonContract() (gas: 3002) -SafeTransferLibTest:testTransferFromWithReturnsTooMuch() (gas: 49825) -SafeTransferLibTest:testTransferFromWithStandardERC20() (gas: 47618) -SafeTransferLibTest:testTransferWithMissingReturn() (gas: 36671) -SafeTransferLibTest:testTransferWithNonContract() (gas: 3053) -SafeTransferLibTest:testTransferWithReturnsTooMuch() (gas: 37074) -SafeTransferLibTest:testTransferWithStandardERC20() (gas: 36745) -WETHTest:testDeposit() (gas: 63238) -WETHTest:testFallbackDeposit() (gas: 63546) -WETHTest:testPartialWithdraw() (gas: 73259) -WETHTest:testWithdraw() (gas: 54360) +FixedPointMathLibTest:testExpWad() (gas: 7268) +FixedPointMathLibTest:testFailDivWadDownZeroDenominator() (gas: 326) +FixedPointMathLibTest:testFailDivWadUpZeroDenominator() (gas: 305) +FixedPointMathLibTest:testFailFuzzDivWadDownOverflow(uint256,uint256) (runs: 256, μ: 439, ~: 416) +FixedPointMathLibTest:testFailFuzzDivWadDownZeroDenominator(uint256) (runs: 256, μ: 401, ~: 401) +FixedPointMathLibTest:testFailFuzzDivWadUpOverflow(uint256,uint256) (runs: 256, μ: 394, ~: 371) +FixedPointMathLibTest:testFailFuzzDivWadUpZeroDenominator(uint256) (runs: 256, μ: 423, ~: 423) +FixedPointMathLibTest:testFailFuzzMulDivDownOverflow(uint256,uint256,uint256) (runs: 256, μ: 481, ~: 455) +FixedPointMathLibTest:testFailFuzzMulDivDownZeroDenominator(uint256,uint256) (runs: 256, μ: 392, ~: 392) +FixedPointMathLibTest:testFailFuzzMulDivUpOverflow(uint256,uint256,uint256) (runs: 256, μ: 437, ~: 411) +FixedPointMathLibTest:testFailFuzzMulDivUpZeroDenominator(uint256,uint256) (runs: 256, μ: 435, ~: 435) +FixedPointMathLibTest:testFailFuzzMulWadDownOverflow(uint256,uint256) (runs: 256, μ: 401, ~: 362) +FixedPointMathLibTest:testFailFuzzMulWadUpOverflow(uint256,uint256) (runs: 256, μ: 443, ~: 404) +FixedPointMathLibTest:testFailMulDivDownZeroDenominator() (gas: 335) +FixedPointMathLibTest:testFailMulDivUpZeroDenominator() (gas: 293) +FixedPointMathLibTest:testFuzzDivWadDown(uint256,uint256) (runs: 256, μ: 655, ~: 765) +FixedPointMathLibTest:testFuzzDivWadUp(uint256,uint256) (runs: 256, μ: 795, ~: 976) +FixedPointMathLibTest:testFuzzLog2() (gas: 302294) +FixedPointMathLibTest:testFuzzMulDivDown(uint256,uint256,uint256) (runs: 256, μ: 680, ~: 791) +FixedPointMathLibTest:testFuzzMulDivUp(uint256,uint256,uint256) (runs: 256, μ: 851, ~: 1092) +FixedPointMathLibTest:testFuzzMulWadDown(uint256,uint256) (runs: 256, μ: 682, ~: 814) +FixedPointMathLibTest:testFuzzMulWadUp(uint256,uint256) (runs: 256, μ: 808, ~: 1069) +FixedPointMathLibTest:testFuzzSqrt(uint256) (runs: 256, μ: 1020, ~: 1038) +FixedPointMathLibTest:testLnWad() (gas: 2405) +FixedPointMathLibTest:testLnWadBig() (gas: 2382) +FixedPointMathLibTest:testLnWadNegative() (gas: 231) +FixedPointMathLibTest:testLnWadOverflow() (gas: 208) +FixedPointMathLibTest:testLnWadSmall() (gas: 3129) +FixedPointMathLibTest:testLog2() (gas: 1749) +FixedPointMathLibTest:testMulDivDown() (gas: 1882) +FixedPointMathLibTest:testMulDivDownEdgeCases() (gas: 722) +FixedPointMathLibTest:testMulDivUp() (gas: 2249) +FixedPointMathLibTest:testMulDivUpEdgeCases() (gas: 839) +FixedPointMathLibTest:testMulWadDown() (gas: 851) +FixedPointMathLibTest:testMulWadDownEdgeCases() (gas: 889) +FixedPointMathLibTest:testMulWadUp() (gas: 1011) +FixedPointMathLibTest:testMulWadUpEdgeCases() (gas: 983) +FixedPointMathLibTest:testRPow() (gas: 2137) +FixedPointMathLibTest:testSqrt() (gas: 2088) +LibBitmapTest:testBitmapGet() (gas: 7801) +LibBitmapTest:testBitmapGet(uint256) (runs: 256, μ: 7827, ~: 7827) +LibBitmapTest:testBitmapSet() (gas: 28639) +LibBitmapTest:testBitmapSet(uint256) (runs: 256, μ: 28667, ~: 28667) +LibBitmapTest:testBitmapSetTo() (gas: 20656) +LibBitmapTest:testBitmapSetTo(uint256,bool) (runs: 256, μ: 21097, ~: 28949) +MerkleProofTest:testValidProofSupplied() (gas: 2201) +MerkleProofTest:testVerifyEmptyMerkleProofSuppliedLeafAndRootDifferent() (gas: 1486) +MerkleProofTest:testVerifyEmptyMerkleProofSuppliedLeafAndRootSame() (gas: 1481) +MerkleProofTest:testVerifyInvalidProofSupplied() (gas: 2219) +MultiRolesAuthorityTest:testCanCallPublicCapability() (gas: 34263) +MultiRolesAuthorityTest:testCanCallWithAuthorizedRole() (gas: 80500) +MultiRolesAuthorityTest:testCanCallWithCustomAuthority() (gas: 416279) +MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesPublicCapability() (gas: 244437) +MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesUserWithRole() (gas: 254174) +MultiRolesAuthorityTest:testFuzzCanCallPublicCapability(address,address,bytes4) (runs: 256, μ: 34410, ~: 34381) +MultiRolesAuthorityTest:testFuzzCanCallWithAuthorizedRole(address,uint8,address,bytes4) (runs: 256, μ: 80749, ~: 80720) +MultiRolesAuthorityTest:testFuzzCanCallWithCustomAuthority(address,address,bytes4) (runs: 256, μ: 416750, ~: 416750) +MultiRolesAuthorityTest:testFuzzCanCallWithCustomAuthorityOverridesPublicCapability(address,address,bytes4) (runs: 256, μ: 244898, ~: 244898) +MultiRolesAuthorityTest:testFuzzCanCallWithCustomAuthorityOverridesUserWithRole(address,uint8,address,bytes4) (runs: 256, μ: 254507, ~: 254480) +MultiRolesAuthorityTest:testFuzzSetPublicCapabilities(bytes4) (runs: 256, μ: 27849, ~: 27846) +MultiRolesAuthorityTest:testFuzzSetRoleCapabilities(uint8,bytes4) (runs: 256, μ: 29119, ~: 29116) +MultiRolesAuthorityTest:testFuzzSetRoles(address,uint8) (runs: 256, μ: 29106, ~: 29092) +MultiRolesAuthorityTest:testFuzzSetTargetCustomAuthority(address,address) (runs: 256, μ: 27992, ~: 27992) +MultiRolesAuthorityTest:testSetPublicCapabilities() (gas: 27738) +MultiRolesAuthorityTest:testSetRoleCapabilities() (gas: 28939) +MultiRolesAuthorityTest:testSetRoles() (gas: 28942) +MultiRolesAuthorityTest:testSetTargetCustomAuthority() (gas: 27951) +OwnedTest:testCallFunctionAsNonOwner() (gas: 11294) +OwnedTest:testCallFunctionAsNonOwner(address) (runs: 256, μ: 16165, ~: 16240) +OwnedTest:testCallFunctionAsOwner() (gas: 10472) +OwnedTest:testSetOwner() (gas: 13024) +OwnedTest:testSetOwner(address) (runs: 256, μ: 13083, ~: 13158) +ReentrancyGuardTest:invariantReentrancyStatusAlways1() (runs: 256, calls: 3840, reverts: 280) +ReentrancyGuardTest:testFailUnprotectedCall() (gas: 46076) +ReentrancyGuardTest:testNoReentrancy() (gas: 7508) +ReentrancyGuardTest:testProtectedCall() (gas: 33453) +RolesAuthorityTest:testCanCallPublicCapability() (gas: 33289) +RolesAuthorityTest:testCanCallWithAuthorizedRole() (gas: 79514) +RolesAuthorityTest:testFuzzCanCallPublicCapability(address,address,bytes4) (runs: 256, μ: 33472, ~: 33445) +RolesAuthorityTest:testFuzzCanCallWithAuthorizedRole(address,uint8,address,bytes4) (runs: 256, μ: 79802, ~: 79775) +RolesAuthorityTest:testFuzzSetPublicCapabilities(address,bytes4) (runs: 256, μ: 29289, ~: 29271) +RolesAuthorityTest:testFuzzSetRoleCapabilities(uint8,address,bytes4) (runs: 256, μ: 30442, ~: 30425) +RolesAuthorityTest:testFuzzSetRoles(address,uint8) (runs: 256, μ: 29127, ~: 29113) +RolesAuthorityTest:testSetPublicCapabilities() (gas: 29157) +RolesAuthorityTest:testSetRoleCapabilities() (gas: 30244) +RolesAuthorityTest:testSetRoles() (gas: 28922) +SSTORE2Test:testFailFuzzReadInvalidPointer(address,bytes) (runs: 256, μ: 3828, ~: 3891) +SSTORE2Test:testFailFuzzReadInvalidPointerCustomBounds(address,uint256,uint256,bytes) (runs: 256, μ: 4090, ~: 4157) +SSTORE2Test:testFailFuzzReadInvalidPointerCustomStartBound(address,uint256,bytes) (runs: 256, μ: 3952, ~: 3990) +SSTORE2Test:testFailFuzzWriteReadCustomBoundsOutOfRange(bytes,uint256,uint256,bytes) (runs: 256, μ: 46187, ~: 43562) +SSTORE2Test:testFailFuzzWriteReadCustomStartBoundOutOfRange(bytes,uint256,bytes) (runs: 256, μ: 45965, ~: 43407) +SSTORE2Test:testFailReadInvalidPointer() (gas: 2908) +SSTORE2Test:testFailReadInvalidPointerCustomBounds() (gas: 3107) +SSTORE2Test:testFailReadInvalidPointerCustomStartBound() (gas: 3012) +SSTORE2Test:testFailWriteReadEmptyOutOfBounds() (gas: 34383) +SSTORE2Test:testFailWriteReadOutOfBounds() (gas: 34361) +SSTORE2Test:testFailWriteReadOutOfStartBound() (gas: 34251) +SSTORE2Test:testFuzzWriteRead(bytes,bytes) (runs: 256, μ: 43912, ~: 41456) +SSTORE2Test:testFuzzWriteReadCustomBounds(bytes,uint256,uint256,bytes) (runs: 256, μ: 26881, ~: 5896) +SSTORE2Test:testFuzzWriteReadCustomStartBound(bytes,uint256,bytes) (runs: 256, μ: 46451, ~: 44027) +SSTORE2Test:testWriteRead() (gas: 53449) +SSTORE2Test:testWriteReadCustomBounds() (gas: 34812) +SSTORE2Test:testWriteReadCustomStartBound() (gas: 34722) +SSTORE2Test:testWriteReadEmptyBound() (gas: 34620) +SSTORE2Test:testWriteReadFullBoundedRead() (gas: 53678) +SSTORE2Test:testWriteReadFullStartBound() (gas: 34701) +SafeCastLibTest:testFailFuzzSafeCastTo128(uint256) (runs: 256, μ: 372, ~: 372) +SafeCastLibTest:testFailFuzzSafeCastTo160(uint256) (runs: 256, μ: 416, ~: 416) +SafeCastLibTest:testFailFuzzSafeCastTo192(uint256) (runs: 256, μ: 395, ~: 395) +SafeCastLibTest:testFailFuzzSafeCastTo224(uint256) (runs: 256, μ: 394, ~: 394) +SafeCastLibTest:testFailFuzzSafeCastTo248(uint256) (runs: 256, μ: 438, ~: 438) +SafeCastLibTest:testFailFuzzSafeCastTo32(uint256) (runs: 256, μ: 395, ~: 395) +SafeCastLibTest:testFailFuzzSafeCastTo64(uint256) (runs: 256, μ: 373, ~: 373) +SafeCastLibTest:testFailFuzzSafeCastTo8(uint256) (runs: 256, μ: 435, ~: 435) +SafeCastLibTest:testFailFuzzSafeCastTo96(uint256) (runs: 256, μ: 437, ~: 437) +SafeCastLibTest:testFailSafeCastTo128() (gas: 358) +SafeCastLibTest:testFailSafeCastTo160() (gas: 314) +SafeCastLibTest:testFailSafeCastTo192() (gas: 338) +SafeCastLibTest:testFailSafeCastTo224() (gas: 314) +SafeCastLibTest:testFailSafeCastTo248() (gas: 337) +SafeCastLibTest:testFailSafeCastTo32() (gas: 313) +SafeCastLibTest:testFailSafeCastTo64() (gas: 358) +SafeCastLibTest:testFailSafeCastTo8() (gas: 333) +SafeCastLibTest:testFailSafeCastTo96() (gas: 359) +SafeCastLibTest:testFuzzSafeCastTo128(uint256) (runs: 256, μ: 2736, ~: 2736) +SafeCastLibTest:testFuzzSafeCastTo160(uint256) (runs: 256, μ: 2736, ~: 2736) +SafeCastLibTest:testFuzzSafeCastTo192(uint256) (runs: 256, μ: 2714, ~: 2714) +SafeCastLibTest:testFuzzSafeCastTo224(uint256) (runs: 256, μ: 2713, ~: 2713) +SafeCastLibTest:testFuzzSafeCastTo248(uint256) (runs: 256, μ: 2713, ~: 2713) +SafeCastLibTest:testFuzzSafeCastTo32(uint256) (runs: 256, μ: 2736, ~: 2736) +SafeCastLibTest:testFuzzSafeCastTo64(uint256) (runs: 256, μ: 2735, ~: 2735) +SafeCastLibTest:testFuzzSafeCastTo8(uint256) (runs: 256, μ: 2714, ~: 2714) +SafeCastLibTest:testFuzzSafeCastTo96(uint256) (runs: 256, μ: 2714, ~: 2714) +SafeCastLibTest:testSafeCastTo128() (gas: 468) +SafeCastLibTest:testSafeCastTo160() (gas: 466) +SafeCastLibTest:testSafeCastTo192() (gas: 468) +SafeCastLibTest:testSafeCastTo224() (gas: 467) +SafeCastLibTest:testSafeCastTo248() (gas: 446) +SafeCastLibTest:testSafeCastTo32() (gas: 490) +SafeCastLibTest:testSafeCastTo64() (gas: 445) +SafeCastLibTest:testSafeCastTo8() (gas: 465) +SafeCastLibTest:testSafeCastTo96() (gas: 445) +SafeTransferLibTest:testApproveWithMissingReturn() (gas: 30745) +SafeTransferLibTest:testApproveWithNonContract() (gas: 3025) +SafeTransferLibTest:testApproveWithReturnsTooMuch() (gas: 31101) +SafeTransferLibTest:testApproveWithStandardERC20() (gas: 30832) +SafeTransferLibTest:testFailApproveWithReturnsFalse() (gas: 5600) +SafeTransferLibTest:testFailApproveWithReturnsTooLittle() (gas: 5542) +SafeTransferLibTest:testFailApproveWithReverting() (gas: 5565) +SafeTransferLibTest:testFailFuzzApproveWithGarbage(address,uint256,bytes,bytes) (runs: 256, μ: 85010, ~: 77942) +SafeTransferLibTest:testFailFuzzApproveWithReturnsFalse(address,uint256,bytes) (runs: 256, μ: 6449, ~: 6444) +SafeTransferLibTest:testFailFuzzApproveWithReturnsTooLittle(address,uint256,bytes) (runs: 256, μ: 6413, ~: 6408) +SafeTransferLibTest:testFailFuzzApproveWithReturnsTwo(address,uint256,bytes) (runs: 256, μ: 6444, ~: 6439) +SafeTransferLibTest:testFailFuzzApproveWithReverting(address,uint256,bytes) (runs: 256, μ: 6349, ~: 6344) +SafeTransferLibTest:testFailFuzzTransferETHToContractWithoutFallback(uint256,bytes) (runs: 256, μ: 7728, ~: 8025) +SafeTransferLibTest:testFailFuzzTransferFromWithGarbage(address,address,uint256,bytes,bytes) (runs: 256, μ: 119972, ~: 117291) +SafeTransferLibTest:testFailFuzzTransferFromWithReturnsFalse(address,address,uint256,bytes) (runs: 256, μ: 14560, ~: 14554) +SafeTransferLibTest:testFailFuzzTransferFromWithReturnsTooLittle(address,address,uint256,bytes) (runs: 256, μ: 14461, ~: 14455) +SafeTransferLibTest:testFailFuzzTransferFromWithReturnsTwo(address,address,uint256,bytes) (runs: 256, μ: 14551, ~: 14545) +SafeTransferLibTest:testFailFuzzTransferFromWithReverting(address,address,uint256,bytes) (runs: 256, μ: 10689, ~: 10683) +SafeTransferLibTest:testFailFuzzTransferWithGarbage(address,uint256,bytes,bytes) (runs: 256, μ: 90778, ~: 83935) +SafeTransferLibTest:testFailFuzzTransferWithReturnsFalse(address,uint256,bytes) (runs: 256, μ: 9370, ~: 9365) +SafeTransferLibTest:testFailFuzzTransferWithReturnsTooLittle(address,uint256,bytes) (runs: 256, μ: 9314, ~: 9309) +SafeTransferLibTest:testFailFuzzTransferWithReturnsTwo(address,uint256,bytes) (runs: 256, μ: 9365, ~: 9360) +SafeTransferLibTest:testFailFuzzTransferWithReverting(address,uint256,bytes) (runs: 256, μ: 9293, ~: 9288) +SafeTransferLibTest:testFailTransferETHToContractWithoutFallback() (gas: 7261) +SafeTransferLibTest:testFailTransferFromWithReturnsFalse() (gas: 13612) +SafeTransferLibTest:testFailTransferFromWithReturnsTooLittle() (gas: 13515) +SafeTransferLibTest:testFailTransferFromWithReverting() (gas: 9764) +SafeTransferLibTest:testFailTransferWithReturnsFalse() (gas: 8545) +SafeTransferLibTest:testFailTransferWithReturnsTooLittle() (gas: 8463) +SafeTransferLibTest:testFailTransferWithReverting() (gas: 8485) +SafeTransferLibTest:testFuzzApproveWithGarbage(address,uint256,bytes,bytes) (runs: 256, μ: 2949, ~: 2179) +SafeTransferLibTest:testFuzzApproveWithMissingReturn(address,uint256,bytes) (runs: 256, μ: 30826, ~: 31598) +SafeTransferLibTest:testFuzzApproveWithNonContract(address,address,uint256,bytes) (runs: 256, μ: 4145, ~: 4171) +SafeTransferLibTest:testFuzzApproveWithReturnsTooMuch(address,uint256,bytes) (runs: 256, μ: 31181, ~: 31953) +SafeTransferLibTest:testFuzzApproveWithStandardERC20(address,uint256,bytes) (runs: 256, μ: 30935, ~: 31707) +SafeTransferLibTest:testFuzzTransferETH(address,uint256,bytes) (runs: 256, μ: 36207, ~: 37994) +SafeTransferLibTest:testFuzzTransferFromWithGarbage(address,address,uint256,bytes,bytes) (runs: 256, μ: 3391, ~: 2309) +SafeTransferLibTest:testFuzzTransferFromWithMissingReturn(address,address,uint256,bytes) (runs: 256, μ: 48957, ~: 49539) +SafeTransferLibTest:testFuzzTransferFromWithNonContract(address,address,address,uint256,bytes) (runs: 256, μ: 4190, ~: 4229) +SafeTransferLibTest:testFuzzTransferFromWithReturnsTooMuch(address,address,uint256,bytes) (runs: 256, μ: 49617, ~: 50195) +SafeTransferLibTest:testFuzzTransferFromWithStandardERC20(address,address,uint256,bytes) (runs: 256, μ: 47453, ~: 48047) +SafeTransferLibTest:testFuzzTransferWithGarbage(address,uint256,bytes,bytes) (runs: 256, μ: 3037, ~: 2200) +SafeTransferLibTest:testFuzzTransferWithMissingReturn(address,uint256,bytes) (runs: 256, μ: 36571, ~: 37583) +SafeTransferLibTest:testFuzzTransferWithNonContract(address,address,uint256,bytes) (runs: 256, μ: 4144, ~: 4170) +SafeTransferLibTest:testFuzzTransferWithReturnsTooMuch(address,uint256,bytes) (runs: 256, μ: 36907, ~: 37919) +SafeTransferLibTest:testFuzzTransferWithStandardERC20(address,uint256,bytes) (runs: 256, μ: 36538, ~: 37550) +SafeTransferLibTest:testTransferETH() (gas: 34632) +SafeTransferLibTest:testTransferFromWithMissingReturn() (gas: 49194) +SafeTransferLibTest:testTransferFromWithNonContract() (gas: 2995) +SafeTransferLibTest:testTransferFromWithReturnsTooMuch() (gas: 49816) +SafeTransferLibTest:testTransferFromWithStandardERC20() (gas: 47612) +SafeTransferLibTest:testTransferWithMissingReturn() (gas: 36663) +SafeTransferLibTest:testTransferWithNonContract() (gas: 3046) +SafeTransferLibTest:testTransferWithReturnsTooMuch() (gas: 37064) +SafeTransferLibTest:testTransferWithStandardERC20() (gas: 36738) +TransientReentrancyGuardTest:testFailUnprotectedCall() (gas: 44078) +TransientReentrancyGuardTest:testNoReentrancy() (gas: 5622) +TransientReentrancyGuardTest:testProtectedCall() (gas: 28767) +WETHInvariants:invariantTotalSupplyEqualsBalance() (runs: 256, calls: 3840, reverts: 1827) +WETHTest:testDeposit() (gas: 63223) +WETHTest:testFallbackDeposit() (gas: 63531) +WETHTest:testFuzzDeposit(uint256) (runs: 256, μ: 62708, ~: 65615) +WETHTest:testFuzzFallbackDeposit(uint256) (runs: 256, μ: 62963, ~: 65870) +WETHTest:testFuzzWithdraw(uint256,uint256) (runs: 256, μ: 75388, ~: 78099) +WETHTest:testPartialWithdraw() (gas: 73256) +WETHTest:testWithdraw() (gas: 54352) \ No newline at end of file diff --git a/src/test/TransientReentrancyGuard.t.sol b/src/test/TransientReentrancyGuard.t.sol new file mode 100644 index 00000000..cacc1260 --- /dev/null +++ b/src/test/TransientReentrancyGuard.t.sol @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import {DSTestPlus} from "./utils/DSTestPlus.sol"; + +import {TransientReentrancyGuard} from "../utils/TransientReentrancyGuard.sol"; + +contract RiskyContract is TransientReentrancyGuard { + uint256 public enterTimes; + + function unprotectedCall() public { + enterTimes++; + + if (enterTimes > 1) return; + + this.protectedCall(); + } + + function protectedCall() public nonReentrant { + enterTimes++; + + if (enterTimes > 1) return; + + this.protectedCall(); + } + + function overprotectedCall() public nonReentrant {} +} + +contract TransientReentrancyGuardTest is DSTestPlus { + RiskyContract riskyContract; + + function setUp() public { + riskyContract = new RiskyContract(); + } + + function testFailUnprotectedCall() public { + riskyContract.unprotectedCall(); + + assertEq(riskyContract.enterTimes(), 1); + } + + function testProtectedCall() public { + try riskyContract.protectedCall() { + fail("Reentrancy Guard Failed To Stop Attacker"); + } catch {} + } + + function testNoReentrancy() public { + riskyContract.overprotectedCall(); + } +} diff --git a/src/utils/TransientReentrancyGuard.sol b/src/utils/TransientReentrancyGuard.sol new file mode 100644 index 00000000..f25766aa --- /dev/null +++ b/src/utils/TransientReentrancyGuard.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.24; + +/// @notice Gas optimized reentrancy protection for smart contracts. Leverages Cancun transient storage. +/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/TransientReentrancyGuard.sol) +/// @author Modified from Soledge (https://github.com/Vectorized/soledge/blob/main/src/utils/ReentrancyGuard.sol) +abstract contract TransientReentrancyGuard { + /// Warning: Be careful to avoid collisions with this hand picked slot! + uint256 private constant REENTRANCY_GUARD_SLOT = 0x1FACE81BADDEADBEEF; + + + modifier nonReentrant() virtual { + bool noReentrancy; + + /// @solidity memory-safe-assembly + assembly { + noReentrancy := iszero(tload(REENTRANCY_GUARD_SLOT)) + + // Any non-zero value would work, but + // ADDRESS is cheap and certainly not 0. + // Wastes a bit of gas doing this before + // require in the revert path, but we're + // only optimizing for the happy path here. + tstore(REENTRANCY_GUARD_SLOT, address()) + } + + require(noReentrancy, "REENTRANCY"); + + _; + + /// @solidity memory-safe-assembly + assembly { + // Need to set back to zero, as transient + // storage is only cleared at the end of the + // tx, not the end of the outermost call frame. + tstore(REENTRANCY_GUARD_SLOT, 0) + } + } +}