delvtech / hyperdrive

An automated market maker for fixed and variable yield with on-demand terms.
Apache License 2.0
28 stars 3 forks source link

Jalextowle/audit 06 10 2024/spearbit 10 #1062

Closed jalextowle closed 3 months ago

jalextowle commented 3 months ago

Resolved Issues

Fixes: https://github.com/spearbit-audits/delv-week-review/issues/10

Description

Used openzeppelin's abs function. This addresses the concern from the issue without resorting to returning an invalid value.

Review Checklists

Please check each item before approving the pull request. While going through the checklist, it is recommended to leave comments on items that are referenced in the checklist to make sure that they are reviewed. If there are multiple reviewers, copy the checklists into sections titled ## [Reviewer Name]. If the PR doesn't touch Solidity, the corresponding checklist can be removed.

[[Reviewer Name]]

coveralls commented 3 months ago

Pull Request Test Coverage Report for Build 9557569371

Details


Files with Coverage Reduction New Missed Lines %
contracts/src/libraries/LPMath.sol 1 83.14%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 9557401375: -0.05%
Covered Lines: 1969
Relevant Lines: 2137

💛 - Coveralls
github-actions[bot] commented 3 months ago

Hyperdrive Gas Benchmark

Benchmark suite Current: 02d7e20548f49457dfe4d81b639937e7ad9bdf48 Previous: 41f0a714171b485d422e3dabf82ec59cae9b3994 Deviation Status
addLiquidity: min 33937 gas 33937 gas 0% 🟰
addLiquidity: avg 155445 gas 155380 gas 0.0418% 🚨
addLiquidity: max 429244 gas 429437 gas -0.0449%
checkpoint: min 40316 gas 40316 gas 0% 🟰
checkpoint: avg 144769 gas 144623 gas 0.1010% 🚨
checkpoint: max 255931 gas 255830 gas 0.0395% 🚨
closeLong: min 31361 gas 31361 gas 0% 🟰
closeLong: avg 135955 gas 136434 gas -0.3511%
closeLong: max 2539376 gas 2621435 gas -3.1303%
closeShort: min 31327 gas 31327 gas 0% 🟰
closeShort: avg 131159 gas 132600 gas -1.0867%
closeShort: max 400822 gas 402622 gas -0.4471%
initialize: min 31349 gas 31349 gas 0% 🟰
initialize: avg 333404 gas 333287 gas 0.0351% 🚨
initialize: max 400023 gas 399922 gas 0.0253% 🚨
openLong: min 33370 gas 33370 gas 0% 🟰
openLong: avg 173237 gas 174232 gas -0.5711%
openLong: max 334107 gas 335241 gas -0.3383%
openShort: min 33936 gas 33936 gas 0% 🟰
openShort: avg 168484 gas 169118 gas -0.3749%
openShort: max 415043 gas 415910 gas -0.2085%
redeemWithdrawalShares: min 31251 gas 31251 gas 0% 🟰
redeemWithdrawalShares: avg 75312 gas 75250 gas 0.0824% 🚨
redeemWithdrawalShares: max 305734 gas 305633 gas 0.0330% 🚨
removeLiquidity: min 31301 gas 31301 gas 0% 🟰
removeLiquidity: avg 215168 gas 215104 gas 0.0298% 🚨
removeLiquidity: max 403861 gas 404194 gas -0.0824%

This comment was automatically generated by workflow using github-action-benchmark.