Skip to content

Commit

Permalink
snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
massun-onibakuchi committed Jun 4, 2024
1 parent 62cdf66 commit 03ee1c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GrimReaperHuffTest:testFuzz_Liquidate(uint256,address) (runs: 257, μ: 390298, ~: 390504)
GrimReaperHuffTest:testLiquidate() (gas: 390431)
GrimReaperHuffTest:testFuzz_Liquidate(uint256,address) (runs: 257, μ: 390297, ~: 390502)
GrimReaperHuffTest:testLiquidate() (gas: 390429)
GrimReaperHuffTest:testOnlyOwner(address) (runs: 257, μ: 20250, ~: 20250)
GrimReaperHuffTest:testRecoverERC20() (gas: 330915)
GrimReaperHuffTest:testRecoverERC20() (gas: 330913)
GrimReaperHuffTest:testRevertIfLiquidationFail() (gas: 8937393460516728344)
GrimReaperSolTest:testFuzz_Liquidate(uint256,address) (runs: 257, μ: 390936, ~: 391328)
GrimReaperSolTest:testLiquidate() (gas: 391254)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ For more information on how to use Foundry, check out the [Foundry Github Reposi
| Solidity Contract | 98783 | 1.005 |
| Assembly | 97679 | 0.303 |
| Assembly (GrimReaper V2) | 97648 | 0.317 |
| Huff Contract | 97599 | 0.234 |
| Huff Contract | 97597 | 0.231 |

| Single Liquidation (Optimizer runs: 10_000_000) | Gas Used | Bytecode Size (kB) |
| ----------------------------------------------- | -------- | ------------------ |
| Solidity Contract | 98127 | 1.308 |
| Assembly | 97089 | 0.330 |
| Assembly (GrimReaper V2) | 97058 | 0.344 |
| Huff Contract | 97021 | 0.234 |
| Huff Contract | 97019 | 0.231 |

> `66270` gas is used for the liquidation logic itself on mock Aave v3 pool.
Expand All @@ -64,6 +64,7 @@ For more information on how to use Foundry, check out the [Foundry Github Reposi
- [ ] Approve once on contract deployment instead of every liquidation
- Replace `jumpi` with other operations
- [x] Use `mload(type(uint256).max)` for `jumpi` if-else-revert pattern (`GrimReaperHuff`)
- [x] Abuse `returndatasize`, `calldatasize`, `chainid` and `msize` for `push` operations

## Acknowledgements

Expand Down

0 comments on commit 03ee1c3

Please sign in to comment.