From 93be75e872d1430f72f3c7c1e74de443883687b6 Mon Sep 17 00:00:00 2001 From: t11s Date: Fri, 8 Apr 2022 18:58:15 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=E2=99=82=EF=B8=8F=20Remov?= =?UTF-8?q?e=20DappTools=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dapprc | 14 - .gas-snapshot | 432 +++++++++++++++--------------- .gitattributes | 1 - .github/pull_request_template.md | 3 +- .github/workflows/dapp-tests.yml | 27 -- .github/workflows/forge-tests.yml | 20 -- .github/workflows/tests.yml | 26 ++ .vscode/settings.json | 1 - Makefile | 7 - README.md | 6 - foundry.toml | 6 + shell.nix | 15 -- 12 files changed, 249 insertions(+), 309 deletions(-) delete mode 100644 .dapprc delete mode 100644 .github/workflows/dapp-tests.yml delete mode 100644 .github/workflows/forge-tests.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 Makefile create mode 100644 foundry.toml delete mode 100644 shell.nix diff --git a/.dapprc b/.dapprc deleted file mode 100644 index e5524b4..0000000 --- a/.dapprc +++ /dev/null @@ -1,14 +0,0 @@ -# Basic build/test configuration. -export DAPP_SOLC_VERSION=0.8.10 -export DAPP_BUILD_OPTIMIZE=1 -export DAPP_BUILD_OPTIMIZE_RUNS=1000000 -export DAPP_LINK_TEST_LIBRARIES=0 -export DAPP_TEST_VERBOSITY=1 -export DAPP_TEST_SMTTIMEOUT=500000 - -if [ "$DEEP_FUZZ" = "true" ] -then - export DAPP_TEST_FUZZ_RUNS=10000 # Fuzz for a long time if DEEP_FUZZ is set to true. -else - export DAPP_TEST_FUZZ_RUNS=100 # Only fuzz briefly if DEEP_FUZZ is not set to true. -fi diff --git a/.gas-snapshot b/.gas-snapshot index 042a095..5be0194 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,216 +1,216 @@ -testFailSetAuthorityWithRestrictiveAuthority() (gas: 126002) -testSetAuthorityWithPermissiveAuthority() (gas: 127687) -testFailSetOwnerWithRestrictiveAuthority() (gas: 126166) -testFailCallFunctionAsNonOwner() (gas: 4191) -testSetAuthorityAsOwner() (gas: 23802) -testFailCallFunctionAsOwnerWithOutOfOrderAuthority() (gas: 135733) -testCallFunctionWithPermissiveAuthority() (gas: 125973) -testFailSetAuthorityAsNonOwner() (gas: 6960) -testFailSetOwnerAsOwnerWithOutOfOrderAuthority() (gas: 135873) -testCallFunctionAsOwner() (gas: 21371) -testFailCallFunctionWithRestrictiveAuthority() (gas: 126125) -testSetOwnerWithPermissiveAuthority() (gas: 147508) -testFailSetOwnerAsNonOwner() (gas: 4309) -testSetAuthorityAsOwnerWithOutOfOrderAuthority() (gas: 234329) -testSetOwnerAsOwner() (gas: 3998) -testFromLast20Bytes() (gas: 191) -testFillLast12Bytes() (gas: 223) -testFailDoubleDeploySameBytecode() (gas: 277076930206699) -testDeployERC20() (gas: 860923) -testFailDoubleDeployDifferentBytecode() (gas: 277076930214644) -testFailBoundMinBiggerThanMax() (gas: 309) -testRelApproxEqBothZeroesPasses() (gas: 413) -testBound() (gas: 16777) -testFailSafeBatchTransferFromToRevertingERC1155Recipient() (gas: 1041059) -testMintToEOA() (gas: 30265) -testFailMintToNonERC155Recipient() (gas: 71897) -testFailSafeBatchTransferFromToZero() (gas: 805760) -testBatchMintToERC1155Recipient() (gas: 946375) -testApproveAll() (gas: 26509) -testFailSafeBatchTransferFromWithArrayLengthMismatch() (gas: 681042) -testFailBatchMintToZero() (gas: 127242) -testFailSafeBatchTransferFromToWrongReturnDataERC1155Recipient() (gas: 992983) -testSafeTransferFromToERC1155Recipient() (gas: 1210543) -testFailBatchMintToWrongReturnDataERC1155Recipient() (gas: 314473) -testFailBatchMintToRevertingERC1155Recipient() (gas: 362536) -testBatchBurn() (gas: 146591) -testFailBurnInsufficientBalance() (gas: 30352) -testFailSafeTransferFromToWrongReturnDataERC1155Recipient() (gas: 243471) -testFailMintToRevertingERC155Recipient() (gas: 263148) -testFailSafeBatchTransferFromToNonERC1155Recipient() (gas: 849517) -testFailSafeTransferFromInsufficientBalance() (gas: 579173) -testFailSafeTransferFromToNonERC155Recipient() (gas: 100376) -testFailBatchMintToNonERC1155Recipient() (gas: 171010) -testSafeBatchTransferFromToEOA() (gas: 817022) -testFailSafeTransferFromToRevertingERC1155Recipient() (gas: 291604) -testBatchMintToEOA() (gas: 132842) -testFailBatchBurnInsufficientBalance() (gas: 131673) -testSafeBatchTransferFromToERC1155Recipient() (gas: 1650404) -testFailBalanceOfBatchWithArrayMismatch() (gas: 4794) -testFailSafeBatchTransferInsufficientBalance() (gas: 682003) -testSafeTransferFromToEOA() (gas: 609087) -testMintToERC1155Recipient() (gas: 612041) -testFailBatchMintWithArrayMismatch() (gas: 5118) -testBatchBalanceOf() (gas: 153791) -testFailSafeTransferFromToZero() (gas: 57667) -testFailSafeTransferFromSelfInsufficientBalance() (gas: 29956) -testBurn() (gas: 34098) -testFailBatchBurnWithArrayLengthMismatch() (gas: 131065) -testFailMintToZero() (gas: 29205) -testSafeTransferFromSelf() (gas: 59828) -testFailMintToWrongReturnDataERC155Recipient() (gas: 263102) -testInfiniteApproveTransferFrom() (gas: 387818) -testApprove() (gas: 26558) -testTransferFrom() (gas: 388112) -testFailTransferFromInsufficientBalance() (gas: 359489) -testFailPermitPastDeadline() (gas: 1489) -testFailPermitReplay() (gas: 59085) -testMint() (gas: 49246) -testFailTransferFromInsufficientAllowance() (gas: 359013) -testTransfer() (gas: 75672) -testBurn() (gas: 52470) -testPermit() (gas: 55993) -testFailTransferInsufficientBalance() (gas: 48306) -testFailPermitBadDeadline() (gas: 29724) -testFailPermitBadNonce() (gas: 29674) -testFailRedeemWithNoShareAmount() (gas: 25839) -testFailRedeemWithNotEnoughShareAmount() (gas: 190632) -testFailWithdrawWithNoUnderlyingAmount() (gas: 25792) -testFailMintWithNoApproval() (gas: 6296) -testFailDepositWithNotEnoughApproval() (gas: 77987) -testFailRedeemZero() (gas: 3461) -testFailWithdrawWithNotEnoughUnderlyingAmount() (gas: 190615) -testFailDepositZero() (gas: 3274) -testMultipleMintDepositRedeemWithdraw() (gas: 1446573) -testWithdrawZero() (gas: 43465) -testFailDepositWithNoApproval() (gas: 6351) -testVaultInteractionsForSomeoneElse() (gas: 1287566) -testMintZero() (gas: 45598) -testSafeTransferFromToERC721Recipient() (gas: 885703) -testFailSafeMintToERC721RecipientWithWrongReturnDataWithData() (gas: 163605) -testApprove() (gas: 73904) -testFailBurnUnMinted() (gas: 3379) -testFailSafeTransferFromToERC721RecipientWithWrongReturnDataWithData() (gas: 191740) -testFailDoubleMint() (gas: 48808) -testApproveAll() (gas: 26585) -testFailApproveUnAuthorized() (gas: 51054) -testFailSafeTransferFromToRevertingERC721RecipientWithData() (gas: 237450) -testFailSafeMintToNonERC721RecipientWithData() (gas: 93740) -testFailTransferFromWrongFrom() (gas: 48838) -testFailSafeMintToRevertingERC721Recipient() (gas: 208477) -testTransferFrom() (gas: 530630) -testFailSafeMintToNonERC721Recipient() (gas: 92893) -testFailDoubleBurn() (gas: 54465) -testFailSafeMintToERC721RecipientWithWrongReturnData() (gas: 162744) -testFailSafeTransferFromToNonERC721Recipient() (gas: 121141) -testMint() (gas: 49778) -testFailApproveUnMinted() (gas: 5672) -testFailTransferFromToZero() (gas: 48903) -testSafeMintToERC721Recipient() (gas: 385391) -testSafeTransferFromToEOA() (gas: 533049) -testSafeMintToEOA() (gas: 52413) -testApproveBurn() (gas: 79785) -testFailSafeTransferFromToERC721RecipientWithWrongReturnData() (gas: 190988) -testTransferFromApproveAll() (gas: 530281) -testFailTransferFromUnOwned() (gas: 3500) -testFailSafeTransferFromToNonERC721RecipientWithData() (gas: 121921) -testBurn() (gas: 55481) -testFailSafeMintToRevertingERC721RecipientWithData() (gas: 209269) -testFailMintToZero() (gas: 1253) -testFailTransferFromNotOwner() (gas: 53372) -testSafeMintToERC721RecipientWithData() (gas: 406553) -testFailSafeTransferFromToRevertingERC721Recipient() (gas: 236721) -testSafeTransferFromToERC721RecipientWithData() (gas: 906865) -testTransferFromSelf() (gas: 80050) -testMulWadDown() (gas: 821) -testDivWadDownEdgeCases() (gas: 423) -testFailDivWadUpZeroDenominator() (gas: 342) -testDivWadUp() (gas: 981) -testMulWadDownEdgeCases() (gas: 886) -testFailMulDivUpZeroDenominator() (gas: 317) -testMulDivUpEdgeCases() (gas: 846) -testDivWadUpEdgeCases() (gas: 482) -testFailDivWadDownZeroDenominator() (gas: 362) -testRPow() (gas: 2142) -testMulDivDownEdgeCases() (gas: 751) -testSqrt() (gas: 2537) -testDivWadDown() (gas: 864) -testMulDivDown() (gas: 1861) -testMulWadUpEdgeCases() (gas: 1002) -testMulWadUp() (gas: 959) -testFailMulDivDownZeroDenominator() (gas: 316) -testMulDivUp() (gas: 2273) -testSetRoles() (gas: 33023) -testCanCallWithCustomAuthorityOverridesPublicCapability() (gas: 295417) -testCanCallPublicCapability() (gas: 39631) -testSetTargetCustomAuthority() (gas: 31736) -testCanCallWithCustomAuthorityOverridesUserWithRole() (gas: 334265) -testCanCallWithAuthorizedRole() (gas: 97461) -testSetRoleCapabilities() (gas: 32997) -testCanCallWithCustomAuthority() (gas: 466959) -testSetPublicCapabilities() (gas: 31468) -testNoReentrancy() (gas: 1015) -testProtectedCall() (gas: 23649) -testFailUnprotectedCall() (gas: 30515) -testSetRoles() (gas: 32998) -testCanCallPublicCapability() (gas: 38436) -testCanCallWithAuthorizedRole() (gas: 96267) -testSetRoleCapabilities() (gas: 34588) -testSetPublicCapabilities() (gas: 33244) -testWriteRead() (gas: 53511) -testWriteReadFullStartBound() (gas: 34725) -testFailWriteReadEmptyOutOfBounds() (gas: 34432) -testWriteReadFullBoundedRead() (gas: 53708) -testFailReadInvalidPointer() (gas: 2905) -testFailWriteReadOutOfStartBound() (gas: 34346) -testFailReadInvalidPointerCustomStartBound() (gas: 2982) -testWriteReadEmptyBound() (gas: 34639) -testFailWriteReadOutOfBounds() (gas: 34453) -testWriteReadCustomBounds() (gas: 34853) -testWriteReadCustomStartBound() (gas: 34768) -testFailReadInvalidPointerCustomBounds() (gas: 3143) -testSafeCastTo248() (gas: 427) -testSafeCastTo128() (gas: 449) -testSafeCastTo32() (gas: 471) -testFailSafeCastTo192() (gas: 344) -testSafeCastTo192() (gas: 471) -testFailSafeCastTo96() (gas: 321) -testSafeCastTo96() (gas: 469) -testSafeCastTo224() (gas: 491) -testFailSafeCastTo8() (gas: 296) -testFailSafeCastTo64() (gas: 321) -testSafeCastTo64() (gas: 470) -testFailSafeCastTo248() (gas: 365) -testFailSafeCastTo224() (gas: 343) -testFailSafeCastTo128() (gas: 321) -testSafeCastTo160() (gas: 470) -testFailSafeCastTo160() (gas: 342) -testFailSafeCastTo32() (gas: 364) -testSafeCastTo8() (gas: 469) -testFailTransferWithReturnsFalse() (gas: 4032) -testFailTransferFromWithReverting() (gas: 5045) -testApproveWithStandardERC20() (gas: 26339) -testTransferFromWithReturnsTooMuch() (gas: 58018) -testFailTransferFromWithReturnsFalse() (gas: 8950) -testApproveWithNonContract() (gas: 3014) -testApproveWithMissingReturn() (gas: 26274) -testFailTransferWithReturnsTooLittle() (gas: 3973) -testApproveWithReturnsTooMuch() (gas: 26655) -testTransferFromWithMissingReturn() (gas: 57195) -testTransferWithStandardERC20() (gas: 27422) -testFailTransferFromWithReturnsTooLittle() (gas: 8788) -testTransferFromWithStandardERC20() (gas: 57282) -testTransferFromWithNonContract() (gas: 3036) -testFailApproveWithReturnsTooLittle() (gas: 1069) -testTransferWithMissingReturn() (gas: 27368) -testFailApproveWithReturnsFalse() (gas: 1126) -testTransferETH() (gas: 34637) -testTransferWithNonContract() (gas: 2990) -testTransferWithReturnsTooMuch() (gas: 27793) -testFailTransferETHToContractWithoutFallback() (gas: 7244) -testFailApproveWithReverting() (gas: 1024) -testFailTransferWithReverting() (gas: 4016) -testPartialWithdraw() (gas: 68781) -testDeposit() (gas: 58760) -testFallbackDeposit() (gas: 59024) -testWithdraw() (gas: 68715) +AuthTest:testCallFunctionAsOwner() (gas: 29871) +AuthTest:testCallFunctionWithPermissiveAuthority() (gas: 124249) +AuthTest:testFailCallFunctionAsNonOwner() (gas: 15491) +AuthTest:testFailCallFunctionAsOwnerWithOutOfOrderAuthority() (gas: 136021) +AuthTest:testFailCallFunctionWithRestrictiveAuthority() (gas: 129201) +AuthTest:testFailSetAuthorityAsNonOwner() (gas: 18260) +AuthTest:testFailSetAuthorityWithRestrictiveAuthority() (gas: 129078) +AuthTest:testFailSetOwnerAsNonOwner() (gas: 15609) +AuthTest:testFailSetOwnerAsOwnerWithOutOfOrderAuthority() (gas: 136161) +AuthTest:testFailSetOwnerWithRestrictiveAuthority() (gas: 129242) +AuthTest:testSetAuthorityAsOwner() (gas: 32302) +AuthTest:testSetAuthorityAsOwnerWithOutOfOrderAuthority() (gas: 226396) +AuthTest:testSetAuthorityWithPermissiveAuthority() (gas: 125963) +AuthTest:testSetOwnerAsOwner() (gas: 15298) +AuthTest:testSetOwnerWithPermissiveAuthority() (gas: 127884) +Bytes32AddressLibTest:testFillLast12Bytes() (gas: 223) +Bytes32AddressLibTest:testFromLast20Bytes() (gas: 191) +CREATE3Test:testDeployERC20() (gas: 852410) +CREATE3Test:testFailDoubleDeployDifferentBytecode() (gas: 9079256848778914164) +CREATE3Test:testFailDoubleDeploySameBytecode() (gas: 9079256848778906218) +DSTestPlusTest:testBound() (gas: 16777) +DSTestPlusTest:testFailBoundMinBiggerThanMax() (gas: 309) +DSTestPlusTest:testRelApproxEqBothZeroesPasses() (gas: 413) +ERC1155Test:testApproveAll() (gas: 31009) +ERC1155Test:testBatchBalanceOf() (gas: 158291) +ERC1155Test:testBatchBurn() (gas: 151091) +ERC1155Test:testBatchMintToEOA() (gas: 137342) +ERC1155Test:testBatchMintToERC1155Recipient() (gas: 942662) +ERC1155Test:testBurn() (gas: 38598) +ERC1155Test:testFailBalanceOfBatchWithArrayMismatch() (gas: 9294) +ERC1155Test:testFailBatchBurnInsufficientBalance() (gas: 136173) +ERC1155Test:testFailBatchBurnWithArrayLengthMismatch() (gas: 135565) +ERC1155Test:testFailBatchMintToNonERC1155Recipient() (gas: 167304) +ERC1155Test:testFailBatchMintToRevertingERC1155Recipient() (gas: 358823) +ERC1155Test:testFailBatchMintToWrongReturnDataERC1155Recipient() (gas: 310755) +ERC1155Test:testFailBatchMintToZero() (gas: 131742) +ERC1155Test:testFailBatchMintWithArrayMismatch() (gas: 9618) +ERC1155Test:testFailBurnInsufficientBalance() (gas: 34852) +ERC1155Test:testFailMintToNonERC155Recipient() (gas: 68191) +ERC1155Test:testFailMintToRevertingERC155Recipient() (gas: 259435) +ERC1155Test:testFailMintToWrongReturnDataERC155Recipient() (gas: 259389) +ERC1155Test:testFailMintToZero() (gas: 33705) +ERC1155Test:testFailSafeBatchTransferFromToNonERC1155Recipient() (gas: 837593) +ERC1155Test:testFailSafeBatchTransferFromToRevertingERC1155Recipient() (gas: 1029131) +ERC1155Test:testFailSafeBatchTransferFromToWrongReturnDataERC1155Recipient() (gas: 981047) +ERC1155Test:testFailSafeBatchTransferFromToZero() (gas: 802042) +ERC1155Test:testFailSafeBatchTransferFromWithArrayLengthMismatch() (gas: 677324) +ERC1155Test:testFailSafeBatchTransferInsufficientBalance() (gas: 678285) +ERC1155Test:testFailSafeTransferFromInsufficientBalance() (gas: 575455) +ERC1155Test:testFailSafeTransferFromSelfInsufficientBalance() (gas: 34456) +ERC1155Test:testFailSafeTransferFromToNonERC155Recipient() (gas: 96670) +ERC1155Test:testFailSafeTransferFromToRevertingERC1155Recipient() (gas: 287891) +ERC1155Test:testFailSafeTransferFromToWrongReturnDataERC1155Recipient() (gas: 239747) +ERC1155Test:testFailSafeTransferFromToZero() (gas: 62167) +ERC1155Test:testMintToEOA() (gas: 34765) +ERC1155Test:testMintToERC1155Recipient() (gas: 608328) +ERC1155Test:testSafeBatchTransferFromToEOA() (gas: 813304) +ERC1155Test:testSafeBatchTransferFromToERC1155Recipient() (gas: 1638477) +ERC1155Test:testSafeTransferFromSelf() (gas: 64328) +ERC1155Test:testSafeTransferFromToEOA() (gas: 605369) +ERC1155Test:testSafeTransferFromToERC1155Recipient() (gas: 1198616) +ERC20Test:testApprove() (gas: 31058) +ERC20Test:testBurn() (gas: 56970) +ERC20Test:testFailPermitBadDeadline() (gas: 36924) +ERC20Test:testFailPermitBadNonce() (gas: 36874) +ERC20Test:testFailPermitPastDeadline() (gas: 8589) +ERC20Test:testFailPermitReplay() (gas: 66285) +ERC20Test:testFailTransferFromInsufficientAllowance() (gas: 355300) +ERC20Test:testFailTransferFromInsufficientBalance() (gas: 355776) +ERC20Test:testFailTransferInsufficientBalance() (gas: 52806) +ERC20Test:testInfiniteApproveTransferFrom() (gas: 364205) +ERC20Test:testMint() (gas: 53746) +ERC20Test:testPermit() (gas: 63193) +ERC20Test:testTransfer() (gas: 60272) +ERC20Test:testTransferFrom() (gas: 344599) +ERC4626Test:testFailDepositWithNoApproval() (gas: 13351) +ERC4626Test:testFailDepositWithNotEnoughApproval() (gas: 86987) +ERC4626Test:testFailDepositZero() (gas: 7774) +ERC4626Test:testFailMintWithNoApproval() (gas: 13296) +ERC4626Test:testFailRedeemWithNoShareAmount() (gas: 32339) +ERC4626Test:testFailRedeemWithNotEnoughShareAmount() (gas: 203632) +ERC4626Test:testFailRedeemZero() (gas: 7961) +ERC4626Test:testFailWithdrawWithNoUnderlyingAmount() (gas: 32292) +ERC4626Test:testFailWithdrawWithNotEnoughUnderlyingAmount() (gas: 203615) +ERC4626Test:testMintZero() (gas: 54598) +ERC4626Test:testMultipleMintDepositRedeemWithdraw() (gas: 1283937) +ERC4626Test:testVaultInteractionsForSomeoneElse() (gas: 1124924) +ERC4626Test:testWithdrawZero() (gas: 52465) +ERC721Test:testApprove() (gas: 78404) +ERC721Test:testApproveAll() (gas: 31085) +ERC721Test:testApproveBurn() (gas: 63216) +ERC721Test:testBurn() (gas: 43772) +ERC721Test:testFailApproveUnAuthorized() (gas: 55554) +ERC721Test:testFailApproveUnMinted() (gas: 10172) +ERC721Test:testFailBurnUnMinted() (gas: 7879) +ERC721Test:testFailDoubleBurn() (gas: 58965) +ERC721Test:testFailDoubleMint() (gas: 53308) +ERC721Test:testFailMintToZero() (gas: 5753) +ERC721Test:testFailSafeMintToERC721RecipientWithWrongReturnData() (gas: 159032) +ERC721Test:testFailSafeMintToERC721RecipientWithWrongReturnDataWithData() (gas: 159893) +ERC721Test:testFailSafeMintToNonERC721Recipient() (gas: 89187) +ERC721Test:testFailSafeMintToNonERC721RecipientWithData() (gas: 90034) +ERC721Test:testFailSafeMintToRevertingERC721Recipient() (gas: 204765) +ERC721Test:testFailSafeMintToRevertingERC721RecipientWithData() (gas: 205557) +ERC721Test:testFailSafeTransferFromToERC721RecipientWithWrongReturnData() (gas: 187276) +ERC721Test:testFailSafeTransferFromToERC721RecipientWithWrongReturnDataWithData() (gas: 188028) +ERC721Test:testFailSafeTransferFromToNonERC721Recipient() (gas: 117435) +ERC721Test:testFailSafeTransferFromToNonERC721RecipientWithData() (gas: 118215) +ERC721Test:testFailSafeTransferFromToRevertingERC721Recipient() (gas: 233009) +ERC721Test:testFailSafeTransferFromToRevertingERC721RecipientWithData() (gas: 233738) +ERC721Test:testFailTransferFromNotOwner() (gas: 57872) +ERC721Test:testFailTransferFromToZero() (gas: 53403) +ERC721Test:testFailTransferFromUnOwned() (gas: 8000) +ERC721Test:testFailTransferFromWrongFrom() (gas: 53338) +ERC721Test:testMint() (gas: 54278) +ERC721Test:testSafeMintToEOA() (gas: 56913) +ERC721Test:testSafeMintToERC721Recipient() (gas: 381679) +ERC721Test:testSafeMintToERC721RecipientWithData() (gas: 402841) +ERC721Test:testSafeTransferFromToEOA() (gas: 509430) +ERC721Test:testSafeTransferFromToERC721Recipient() (gas: 853875) +ERC721Test:testSafeTransferFromToERC721RecipientWithData() (gas: 875037) +ERC721Test:testTransferFrom() (gas: 487111) +ERC721Test:testTransferFromApproveAll() (gas: 506662) +ERC721Test:testTransferFromSelf() (gas: 64650) +FixedPointMathLibTest:testDivWadDown() (gas: 864) +FixedPointMathLibTest:testDivWadDownEdgeCases() (gas: 423) +FixedPointMathLibTest:testDivWadUp() (gas: 981) +FixedPointMathLibTest:testDivWadUpEdgeCases() (gas: 482) +FixedPointMathLibTest:testFailDivWadDownZeroDenominator() (gas: 362) +FixedPointMathLibTest:testFailDivWadUpZeroDenominator() (gas: 342) +FixedPointMathLibTest:testFailMulDivDownZeroDenominator() (gas: 316) +FixedPointMathLibTest:testFailMulDivUpZeroDenominator() (gas: 317) +FixedPointMathLibTest:testMulDivDown() (gas: 1861) +FixedPointMathLibTest:testMulDivDownEdgeCases() (gas: 751) +FixedPointMathLibTest:testMulDivUp() (gas: 2273) +FixedPointMathLibTest:testMulDivUpEdgeCases() (gas: 846) +FixedPointMathLibTest:testMulWadDown() (gas: 821) +FixedPointMathLibTest:testMulWadDownEdgeCases() (gas: 886) +FixedPointMathLibTest:testMulWadUp() (gas: 959) +FixedPointMathLibTest:testMulWadUpEdgeCases() (gas: 1002) +FixedPointMathLibTest:testRPow() (gas: 2142) +FixedPointMathLibTest:testSqrt() (gas: 2537) +MultiRolesAuthorityTest:testCanCallPublicCapability() (gas: 34292) +MultiRolesAuthorityTest:testCanCallWithAuthorizedRole() (gas: 80556) +MultiRolesAuthorityTest:testCanCallWithCustomAuthority() (gas: 422681) +MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesPublicCapability() (gas: 247674) +MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesUserWithRole() (gas: 256845) +MultiRolesAuthorityTest:testSetPublicCapabilities() (gas: 27762) +MultiRolesAuthorityTest:testSetRoleCapabilities() (gas: 28985) +MultiRolesAuthorityTest:testSetRoles() (gas: 29006) +MultiRolesAuthorityTest:testSetTargetCustomAuthority() (gas: 27976) +ReentrancyGuardTest:testFailUnprotectedCall() (gas: 41815) +ReentrancyGuardTest:testNoReentrancy() (gas: 7515) +ReentrancyGuardTest:testProtectedCall() (gas: 32949) +RolesAuthorityTest:testCanCallPublicCapability() (gas: 33336) +RolesAuthorityTest:testCanCallWithAuthorizedRole() (gas: 79601) +RolesAuthorityTest:testSetPublicCapabilities() (gas: 29183) +RolesAuthorityTest:testSetRoleCapabilities() (gas: 30258) +RolesAuthorityTest:testSetRoles() (gas: 28986) +SSTORE2Test:testFailReadInvalidPointer() (gas: 2905) +SSTORE2Test:testFailReadInvalidPointerCustomBounds() (gas: 3143) +SSTORE2Test:testFailReadInvalidPointerCustomStartBound() (gas: 2982) +SSTORE2Test:testFailWriteReadEmptyOutOfBounds() (gas: 34432) +SSTORE2Test:testFailWriteReadOutOfBounds() (gas: 34453) +SSTORE2Test:testFailWriteReadOutOfStartBound() (gas: 34346) +SSTORE2Test:testWriteRead() (gas: 53511) +SSTORE2Test:testWriteReadCustomBounds() (gas: 34853) +SSTORE2Test:testWriteReadCustomStartBound() (gas: 34768) +SSTORE2Test:testWriteReadEmptyBound() (gas: 34639) +SSTORE2Test:testWriteReadFullBoundedRead() (gas: 53708) +SSTORE2Test:testWriteReadFullStartBound() (gas: 34725) +SafeCastLibTest:testFailSafeCastTo128() (gas: 321) +SafeCastLibTest:testFailSafeCastTo160() (gas: 342) +SafeCastLibTest:testFailSafeCastTo192() (gas: 344) +SafeCastLibTest:testFailSafeCastTo224() (gas: 343) +SafeCastLibTest:testFailSafeCastTo248() (gas: 365) +SafeCastLibTest:testFailSafeCastTo32() (gas: 364) +SafeCastLibTest:testFailSafeCastTo64() (gas: 321) +SafeCastLibTest:testFailSafeCastTo8() (gas: 296) +SafeCastLibTest:testFailSafeCastTo96() (gas: 321) +SafeCastLibTest:testSafeCastTo128() (gas: 449) +SafeCastLibTest:testSafeCastTo160() (gas: 470) +SafeCastLibTest:testSafeCastTo192() (gas: 471) +SafeCastLibTest:testSafeCastTo224() (gas: 491) +SafeCastLibTest:testSafeCastTo248() (gas: 427) +SafeCastLibTest:testSafeCastTo32() (gas: 471) +SafeCastLibTest:testSafeCastTo64() (gas: 470) +SafeCastLibTest:testSafeCastTo8() (gas: 469) +SafeCastLibTest:testSafeCastTo96() (gas: 469) +SafeTransferLibTest:testApproveWithMissingReturn() (gas: 30774) +SafeTransferLibTest:testApproveWithNonContract() (gas: 3014) +SafeTransferLibTest:testApproveWithReturnsTooMuch() (gas: 31155) +SafeTransferLibTest:testApproveWithStandardERC20() (gas: 30839) +SafeTransferLibTest:testFailApproveWithReturnsFalse() (gas: 5626) +SafeTransferLibTest:testFailApproveWithReturnsTooLittle() (gas: 5569) +SafeTransferLibTest:testFailApproveWithReverting() (gas: 5524) +SafeTransferLibTest:testFailTransferETHToContractWithoutFallback() (gas: 7244) +SafeTransferLibTest:testFailTransferFromWithReturnsFalse() (gas: 13650) +SafeTransferLibTest:testFailTransferFromWithReturnsTooLittle() (gas: 13488) +SafeTransferLibTest:testFailTransferFromWithReverting() (gas: 9745) +SafeTransferLibTest:testFailTransferWithReturnsFalse() (gas: 8532) +SafeTransferLibTest:testFailTransferWithReturnsTooLittle() (gas: 8473) +SafeTransferLibTest:testFailTransferWithReverting() (gas: 8516) +SafeTransferLibTest:testTransferETH() (gas: 34637) +SafeTransferLibTest:testTransferFromWithMissingReturn() (gas: 49144) +SafeTransferLibTest:testTransferFromWithNonContract() (gas: 3036) +SafeTransferLibTest:testTransferFromWithReturnsTooMuch() (gas: 49802) +SafeTransferLibTest:testTransferFromWithStandardERC20() (gas: 47613) +SafeTransferLibTest:testTransferWithMissingReturn() (gas: 36668) +SafeTransferLibTest:testTransferWithNonContract() (gas: 2990) +SafeTransferLibTest:testTransferWithReturnsTooMuch() (gas: 37093) +SafeTransferLibTest:testTransferWithStandardERC20() (gas: 36722) +WETHTest:testDeposit() (gas: 63260) +WETHTest:testFallbackDeposit() (gas: 63524) +WETHTest:testPartialWithdraw() (gas: 73281) +WETHTest:testWithdraw() (gas: 54360) diff --git a/.gitattributes b/.gitattributes index 745230d..e664563 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,2 @@ *.sol linguist-language=Solidity -.dapprc linguist-language=Shell .gas-snapshot linguist-language=Julia \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4f03af8..5cca391 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,9 +6,8 @@ Describe the changes made in your pull request here. Ensure you completed **all of the steps** below before submitting your pull request: -- [ ] Ran `dapp snapshot`? +- [ ] Ran `forge snapshot`? - [ ] Ran `npm run lint`? - [ ] Ran `forge test`? -- [ ] Ran `dapp test`? _Pull requests with an incomplete checklist will be thrown out._ diff --git a/.github/workflows/dapp-tests.yml b/.github/workflows/dapp-tests.yml deleted file mode 100644 index e3a8df5..0000000 --- a/.github/workflows/dapp-tests.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Dapp Tests - -on: [push, pull_request] - -jobs: - dapp-tests: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - - uses: cachix/install-nix-action@v13 - - uses: cachix/cachix-action@v10 - with: - name: dapp - - - name: Install dependencies - run: nix-shell --run 'make' - - - name: Check gas snapshots - run: nix-shell --run 'dapp check-snapshot' - - - name: Run tests - run: nix-shell --run 'dapp test' - env: - # Only fuzz deeply if we're pushing to main or this is a PR to main: - DEEP_FUZZ: ${{ github.ref == 'refs/heads/main' || github.base_ref == 'main' }} diff --git a/.github/workflows/forge-tests.yml b/.github/workflows/forge-tests.yml deleted file mode 100644 index 6c5ef5a..0000000 --- a/.github/workflows/forge-tests.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Forge Tests - -on: [push, pull_request] - -jobs: - forge-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 - with: - version: nightly - - - name: Install dependencies - run: forge install - - - name: Run forge tests - run: forge test diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..ac035ba --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,26 @@ +name: Tests + +on: [push, pull_request] + +jobs: + forge-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install Foundry + uses: onbjerg/foundry-toolchain@v1 + with: + version: nightly + + - name: Install dependencies + run: forge install + + - name: Check gas snapshots + run: forge snapshot --check + + - name: Run tests + run: forge test + env: + # Only fuzz intensely if we're running this action on a push to main or for a PR going into main: + FOUNDRY_PROFILE: ${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && "intense" }} diff --git a/.vscode/settings.json b/.vscode/settings.json index c06f7e0..74939be 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,7 +4,6 @@ "solidity.compileUsingRemoteVersion": "v0.8.10", "search.exclude": { "lib": true }, "files.associations": { - ".dapprc": "shellscript", ".gas-snapshot": "julia" } } diff --git a/Makefile b/Makefile deleted file mode 100644 index 6833b64..0000000 --- a/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: solc install update -# Install proper solc version. -solc:; nix-env -f https://github.com/dapphub/dapptools/archive/master.tar.gz -iA solc-static-versions.solc_0_8_10 -# Install npm dependencies. -install:; npm install -# Install dapp dependencies. -update:; dapp update diff --git a/README.md b/README.md index 05d7481..9ceea6d 100644 --- a/README.md +++ b/README.md @@ -41,12 +41,6 @@ We **do not give any warranties** and **will not be liable for any loss** incurr ## Installation -To install with [**DappTools**](https://github.com/dapphub/dapptools): - -```sh -dapp install rari-capital/solmate -``` - To install with [**Foundry**](https://github.com/gakonst/foundry): ```sh diff --git a/foundry.toml b/foundry.toml new file mode 100644 index 0000000..24f20d6 --- /dev/null +++ b/foundry.toml @@ -0,0 +1,6 @@ +[default] +optimizer = true +optimizer_runs = 1000000 + +[intense] +fuzz_runs = 100000 diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 83edb3d..0000000 --- a/shell.nix +++ /dev/null @@ -1,15 +0,0 @@ -let - pkgs = import (builtins.fetchGit rec { - name = "dapptools-${rev}"; - url = https://github.com/dapphub/dapptools; - rev = "fb9476ded759da44c449eb391cc67bfb0df61112"; - }) {}; - -in - pkgs.mkShell { - src = null; - name = "rari-capital-solmate"; - buildInputs = with pkgs; [ - pkgs.dapp - ]; - }