Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/audits 4 #70

Merged
merged 9 commits into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .forge-snapshots/approveRenewable.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
78546
78568
2 changes: 1 addition & 1 deletion .forge-snapshots/approveRenewableAndCall.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
85020
85042
2 changes: 1 addition & 1 deletion .forge-snapshots/deployFunnelForToken.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
152535
152545
Original file line number Diff line number Diff line change
@@ -1 +1 @@
108767
108900
2 changes: 1 addition & 1 deletion .forge-snapshots/executeMetaTransactionTransfer.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
75914
76046
2 changes: 1 addition & 1 deletion .forge-snapshots/permit.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
101400
101311
268 changes: 268 additions & 0 deletions .forge-snapshots/report.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .forge-snapshots/transferFrom.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
43046
43068
2 changes: 1 addition & 1 deletion .forge-snapshots/transferFromAndCall.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
50821
50843
142 changes: 71 additions & 71 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
FunnelTest:testApprove() (gas: 143366)
FunnelTest:testApproveRenewable() (gas: 96870)
FunnelTest:testApproveRenewableAndCall() (gas: 92530)
FunnelTest:testApproveRenewableAndCallRevertNonContract() (gas: 84740)
FunnelTest:testApproveRenewableAndCallRevertNonReceiver() (gas: 85670)
FunnelTest:testApproveRenewableAndCallWithGasSnapshot() (gas: 121012)
FunnelTest:testBaseToken() (gas: 9905)
FunnelTest:testBaseTokenAllowance() (gas: 103961)
FunnelTest:testClearRenewableAllowanceOnNormalApprove() (gas: 143323)
FunnelTest:testExecuteMetaTransactionApproveRenewable() (gas: 211775)
FunnelTest:testExecuteMetaTransactionTransfer() (gas: 127828)
FunnelTest:testFallbackToBaseToken() (gas: 25840)
FunnelTest:testInfiniteApproveTransferFrom() (gas: 132794)
FunnelTest:testInsufficientAllowance() (gas: 21475)
FunnelTest:testInsufficientBaseAllowance() (gas: 113379)
FunnelTest:testOverflow() (gas: 115155)
FunnelTest:testOverflow2() (gas: 115176)
FunnelTest:testOverflow3() (gas: 128616)
FunnelTest:testApprove() (gas: 143454)
FunnelTest:testApproveRenewable() (gas: 96914)
FunnelTest:testApproveRenewableAndCall() (gas: 92552)
FunnelTest:testApproveRenewableAndCallRevertNonContract() (gas: 84762)
FunnelTest:testApproveRenewableAndCallRevertNonReceiver() (gas: 85692)
FunnelTest:testApproveRenewableAndCallWithGasSnapshot() (gas: 121034)
FunnelTest:testBaseToken() (gas: 9927)
FunnelTest:testBaseTokenAllowance() (gas: 104005)
FunnelTest:testClearRenewableAllowanceOnNormalApprove() (gas: 143565)
FunnelTest:testExecuteMetaTransactionApproveRenewable() (gas: 211974)
FunnelTest:testExecuteMetaTransactionTransfer() (gas: 128026)
FunnelTest:testFallbackToBaseToken() (gas: 25751)
FunnelTest:testInfiniteApproveTransferFrom() (gas: 132882)
FunnelTest:testInsufficientAllowance() (gas: 21497)
FunnelTest:testInsufficientBaseAllowance() (gas: 113445)
FunnelTest:testOverflow() (gas: 115199)
FunnelTest:testOverflow2() (gas: 115220)
FunnelTest:testOverflow3() (gas: 128660)
FunnelTest:testOverriddenName() (gas: 20952)
FunnelTest:testOverriddenNameWithNoName() (gas: 2045242)
FunnelTest:testPermit() (gas: 159444)
FunnelTest:testPermitRenewable() (gas: 130905)
FunnelTest:testPermitRenewableContractWallet() (gas: 126685)
FunnelTest:testRecoveryRateCasting() (gas: 85918)
FunnelTest:testRecoveryRateExceeded() (gas: 13452)
FunnelTest:testRecoveryRateExceeded2() (gas: 13492)
FunnelTest:testRenewableAllowanceTransferFrom() (gas: 149827)
FunnelTest:testRenewableMaxAllowance() (gas: 98365)
FunnelTest:testRevertExecuteMetaTransactionBadNonce() (gas: 48705)
FunnelTest:testRevertExecuteMetaTransactionCallFailed() (gas: 55277)
FunnelTest:testRevertExecuteMetaTransactionInvalidSigner() (gas: 41411)
FunnelTest:testRevertExecuteMetaTransactionReplayProtection() (gas: 144440)
FunnelTest:testRevertPermitBadDeadline() (gas: 47105)
FunnelTest:testRevertPermitBadNonce() (gas: 47002)
FunnelTest:testRevertPermitPastDeadline() (gas: 16239)
FunnelTest:testRevertPermitRenewableBadDeadline() (gas: 49183)
FunnelTest:testRevertPermitRenewableBadNonce() (gas: 49146)
FunnelTest:testRevertPermitRenewableContractWalletBadSigner() (gas: 52942)
FunnelTest:testRevertPermitRenewablePastDeadline() (gas: 20595)
FunnelTest:testRevertPermitRenewableReplay() (gas: 126066)
FunnelTest:testRevertPermitReplay() (gas: 123961)
FunnelTest:testOverriddenNameWithNoName() (gas: 2019808)
FunnelTest:testPermit() (gas: 159421)
FunnelTest:testPermitRenewable() (gas: 130993)
FunnelTest:testPermitRenewableContractWallet() (gas: 126663)
FunnelTest:testRecoveryRateCasting() (gas: 85852)
FunnelTest:testRecoveryRateExceeded() (gas: 13474)
FunnelTest:testRecoveryRateExceeded2() (gas: 13514)
FunnelTest:testRenewableAllowanceTransferFrom() (gas: 150025)
FunnelTest:testRenewableMaxAllowance() (gas: 98431)
FunnelTest:testRevertExecuteMetaTransactionBadNonce() (gas: 48751)
FunnelTest:testRevertExecuteMetaTransactionCallFailed() (gas: 55345)
FunnelTest:testRevertExecuteMetaTransactionInvalidSigner() (gas: 41457)
FunnelTest:testRevertExecuteMetaTransactionReplayProtection() (gas: 144663)
FunnelTest:testRevertPermitBadDeadline() (gas: 47038)
FunnelTest:testRevertPermitBadNonce() (gas: 46935)
FunnelTest:testRevertPermitPastDeadline() (gas: 16172)
FunnelTest:testRevertPermitRenewableBadDeadline() (gas: 49227)
FunnelTest:testRevertPermitRenewableBadNonce() (gas: 49190)
FunnelTest:testRevertPermitRenewableContractWalletBadSigner() (gas: 52986)
FunnelTest:testRevertPermitRenewablePastDeadline() (gas: 20639)
FunnelTest:testRevertPermitRenewableReplay() (gas: 126132)
FunnelTest:testRevertPermitReplay() (gas: 123805)
FunnelTest:testSupportInterface() (gas: 5700)
FunnelTest:testSupportsInterfacePayable() (gas: 5770)
FunnelTest:testSupportsInterfaceProxy() (gas: 5852)
FunnelTest:testTransfer() (gas: 62100)
FunnelTest:testTransferFromAndCall() (gas: 137404)
FunnelTest:testTransferFromAndCallRevertNonContract() (gas: 112100)
FunnelTest:testTransferFromAndCallRevertNonReceiver() (gas: 110453)
FunnelTest:testTransferFromAndCallWithGasSnapshot() (gas: 172942)
FunnelTest:testTransferFromWithSnapshot() (gas: 155381)
FunnelTest:testZeroAddressInitialise() (gas: 1787778)
FunnelERC20Test:testApproveFuzzing(uint256) (runs: 256, μ: 117723, ~: 119900)
FunnelERC20Test:testApproveMaxWithTransfer() (gas: 137307)
FunnelERC20Test:testApproveWithTransferFuzzing(uint256,uint256) (runs: 256, μ: 147561, ~: 149022)
FunnelERC20Test:testBalanceOfOnMint(uint256) (runs: 256, μ: 65881, ~: 67015)
FunnelERC20Test:testBalanceOfOnMintLargeAmount() (gas: 66981)
FunnelERC20Test:testBalanceOfOnTransfer(uint256,uint256) (runs: 256, μ: 104936, ~: 107372)
FunnelERC20Test:testBalanceOfOnTransferLargeAmount() (gas: 87476)
FunnelTest:testTransfer() (gas: 62144)
FunnelTest:testTransferFromAndCall() (gas: 137448)
FunnelTest:testTransferFromAndCallRevertNonContract() (gas: 112144)
FunnelTest:testTransferFromAndCallRevertNonReceiver() (gas: 110497)
FunnelTest:testTransferFromAndCallWithGasSnapshot() (gas: 172986)
FunnelTest:testTransferFromWithSnapshot() (gas: 155403)
FunnelTest:testZeroAddressInitialise() (gas: 1762344)
FunnelERC20Test:testApproveFuzzing(uint256) (runs: 256, μ: 117789, ~: 119966)
FunnelERC20Test:testApproveMaxWithTransfer() (gas: 137373)
FunnelERC20Test:testApproveWithTransferFuzzing(uint256,uint256) (runs: 256, μ: 147649, ~: 149110)
FunnelERC20Test:testBalanceOfOnMint(uint256) (runs: 256, μ: 65947, ~: 67081)
FunnelERC20Test:testBalanceOfOnMintLargeAmount() (gas: 67047)
FunnelERC20Test:testBalanceOfOnTransfer(uint256,uint256) (runs: 256, μ: 105090, ~: 107526)
FunnelERC20Test:testBalanceOfOnTransferLargeAmount() (gas: 87630)
FunnelERC20Test:testBalanceOfReflectsSlot(uint256) (runs: 256, μ: 322, ~: 322)
FunnelERC20Test:testFailApproveWithTransferInsufficientApproval() (gas: 99082)
FunnelERC20Test:testFailApprovewithTransferInsufficientBalance() (gas: 106996)
FunnelERC20Test:testFailTransferExceedsBalance(uint256) (runs: 256, μ: 40574, ~: 40682)
FunnelERC20Test:testInitialAllowance() (gas: 25029)
FunnelERC20Test:testTotalSupply(uint256) (runs: 256, μ: 42734, ~: 42933)
FunnelERC20Test:testTransferFullBalance() (gas: 61369)
FunnelERC20Test:testTransferFuzzing(uint256) (runs: 256, μ: 68303, ~: 69678)
FunnelERC20Test:testTransferHalfBalance() (gas: 66255)
FunnelERC20Test:testTransferOneToken() (gas: 64089)
FunnelERC20Test:testTransferZeroTokens() (gas: 41433)
FunnelFactoryTest:testDeployFunnelForDifferentTokens() (gas: 298301)
FunnelFactoryTest:testDeployFunnelForToken() (gas: 190140)
FunnelFactoryTest:testDeployFunnelForTokenRevertsIfAlreadyDeployed() (gas: 156740)
FunnelFactoryTest:testDeployFunnelFromDifferentFactory() (gas: 558192)
FunnelERC20Test:testFailApproveWithTransferInsufficientApproval() (gas: 99126)
FunnelERC20Test:testFailApprovewithTransferInsufficientBalance() (gas: 107040)
FunnelERC20Test:testFailTransferExceedsBalance(uint256) (runs: 256, μ: 40640, ~: 40748)
FunnelERC20Test:testInitialAllowance() (gas: 25051)
FunnelERC20Test:testTotalSupply(uint256) (runs: 256, μ: 42556, ~: 42755)
FunnelERC20Test:testTransferFullBalance() (gas: 61479)
FunnelERC20Test:testTransferFuzzing(uint256) (runs: 256, μ: 68413, ~: 69788)
FunnelERC20Test:testTransferHalfBalance() (gas: 66365)
FunnelERC20Test:testTransferOneToken() (gas: 64199)
FunnelERC20Test:testTransferZeroTokens() (gas: 41543)
FunnelFactoryTest:testDeployFunnelForDifferentTokens() (gas: 298321)
FunnelFactoryTest:testDeployFunnelForToken() (gas: 190150)
FunnelFactoryTest:testDeployFunnelForTokenRevertsIfAlreadyDeployed() (gas: 156750)
FunnelFactoryTest:testDeployFunnelFromDifferentFactory() (gas: 557206)
FunnelFactoryTest:testGetFunnelForTokenRevertsIfNotDeployed() (gas: 12826)
FunnelFactoryTest:testIsFunnelFalseForDeployedFunnelFromDifferentFactory() (gas: 563344)
FunnelFactoryTest:testIsFunnelFalseForDeployedFunnelFromDifferentFactory() (gas: 562402)
FunnelFactoryTest:testIsFunnelFalseForNonFunnel() (gas: 10897)
FunnelFactoryTest:testIsFunnelFalseForUndeployedFunnel() (gas: 8329)
FunnelFactoryTest:testIsFunnelTrueForDeployedFunnel() (gas: 155345)
FunnelFactoryTest:testIsFunnelTrueForDeployedFunnel() (gas: 155377)
FunnelFactoryTest:testNoCodeTokenReverts() (gas: 15454)
FunnelFactoryTest:testTransferFromFunnel() (gas: 291706)
FunnelFactoryTest:testTransferFromFunnel() (gas: 291782)
MockSpenderReceiverTest:testSupportInterfaceReceiver() (gas: 5598)
MockSpenderReceiverTest:testSupportInterfaceSpender() (gas: 6567)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Forge snapshot automatically captures selected function calls on `.forge-snapsho

```sh
forge test --gas-report >> .forge-snapshots/report.txt
forge snapshot # needed for gas checks
```

### Test Coverage
Expand Down
Loading