Vectorized / solady

Optimized Solidity snippets.
MIT License
2.6k stars 346 forks source link

♻️ Very safe transfer #1128

Closed Vectorized closed 1 month ago

Vectorized commented 1 month ago

Description

♻️

Checklist

Ensure you completed all of the steps below before submitting your pull request:

Pull requests with an incomplete checklist will be thrown out.

github-actions[bot] commented 1 month ago

Gas Snapshot Comparison Report

Generated at commit : f53292d49c03b8aeccfebae876829b964fc18201, Compared to commit : 7f72ce187b1340879bd476f1c8a03286636ce787

Contract Name Test Name Main Gas PR Gas Diff
ERC4626Test testDepositWithNoApprovalReverts() 16951 17076 125
testDepositWithNotEnoughApprovalReverts() 90749 90874 125
testMintWithNoApprovalReverts() 16925 17050 125
testMintZero() 53927 53924 -3
testMultipleMintDepositRedeemWithdraw() 412861 412842 -19
testRedeemWithNotEnoughShareAmountReverts() 143774 143771 -3
testTryGetAssetDecimals() 30687274 30755448 68174
testUseVirtualShares() 2427648 2435672 8024
testVaultInteractionsForSomeoneElse() 297831 297821 -10
testVirtualSharesMultipleMintDepositRedeemWithdraw() 1614679 1618669 3990
testWithdrawWithNotEnoughUnderlyingAmountReverts() 144907 144904 -3
testWithdrawZero() 52056 52053 -3
test__codesize() 36903 36923 20
SafeTransferLibTest testApproveWithMissingReturn() 32462 32633 171
testApproveWithNonContract() 2967 - -
testApproveWithRetry() 789740 789930 190
testApproveWithRetryWithNonContract() 2990 - -
testApproveWithReturnsFalseReverts() 10122 10253 131
testApproveWithReturnsTooLittleReverts() 10026 10157 131
testApproveWithReturnsTooMuch() 32913 32932 19
testApproveWithRevertingReverts() 9983 10114 131
testApproveWithStandardERC20() 32348 32367 19
testBalanceOfStandardERC20() 7852 7808 -44
testForceTransferETHToGriever() 1511587 1511700 113
testPermit2OnDAI() 90296 90273 -23
testSimplePermit2AndPermit2TransferFrom() 1136300 1137384 1084
testSimplePermit2AndPermit2TransferFromGas() 141119 141199 80
testTransferAllETHToContractWithoutFallbackReverts() 10782 10793 11
testTransferAllFromWithStandardERC20() 33699 33696 -3
testTransferAllWithStandardERC20() 31014 31011 -3
testTransferETH() 34622 34600 -22
testTransferETHToContractWithoutFallbackReverts() 10851 10873 22
testTransferFromWithMissingReturn() 542551 562108 19557
testTransferFromWithNonContract() 3066 - -
testTransferFromWithReturnsFalseReverts() 508931 528170 19239
testTransferFromWithReturnsTooLittleReverts() 508642 528103 19461
testTransferFromWithReturnsTooMuch() 543464 562742 19278
testTransferFromWithRevertingReverts() 501397 520689 19292
testTransferFromWithStandardERC20() 541672 560961 19289
testTransferWithMissingReturn() 529179 548553 19374
testTransferWithNonContract() 3010 - -
testTransferWithReturnsFalseReverts() 506018 525381 19363
testTransferWithReturnsTooLittleReverts() 505585 525265 19680
testTransferWithReturnsTooMuch() 529956 549119 19163
testTransferWithRevertingReverts() 776822 525153 -251669
testTransferWithStandardERC20() 530079 549269 19190
testTryTransferETH() 148701 148767 66
test__codesize() 65981 67384 1403
testApproveWithNonContractReverts() - 6901 -
testApproveWithRetryWithNonContractReverts() - 7290 -
testTransferFromWithNonContractReverts() - 8184 -
testTransferWithNonContractReverts() - 6908 -
Vectorized commented 1 month ago

@Philogy Help me double check this if you are free. My brain is only 10% now.