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

Tests for the SUSDe Integration #1111

Merged
merged 6 commits into from
Jul 24, 2024
Merged

Conversation

jalextowle
Copy link
Contributor

Resolved Issues

Fixes: #1105.

Description

To integrate with Ethena's SUSDe instance, we will be using the ERC4626Hyperdrive instance contract. To sanity check this idea, this PR adds a comprehensive test suite that can also be used for future ERC4626 integrations.

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]]

  • Tokens
    • Do all approve calls use forceApprove?
    • Do all transfer calls use safeTransfer?
    • Do all transferFrom calls use msg.sender as the from address?
      • If not, is the function access restricted to prevent unauthorized
        token spend?
  • Low-level calls (call, delegatecall, staticcall, transfer, send)
    • Is the returned success boolean checked to handle failed calls?
    • If using delegatecall, are there strict access controls on the
      addresses that can be called? It shouldn't be possible to delegatecall
      arbitrary addresses, so the list of possible targets should either be
      immutable or tightly controlled by an admin.
  • Reentrancy
    • Are functions that make external calls or transfer ether marked as nonReentrant?
      • If not, is there documentation that explains why reentrancy is
        not a concern or how it's mitigated?
  • Gas Optimizations
    • Is the logic as simple as possible?
    • Are the storage values that are used repeatedly cached in stack or
      memory variables?
    • If loops are used, are there guards in place to avoid out-of-gas
      issues?
  • Visibility
    • Are all payable functions restricted to avoid stuck ether?
  • Math
    • Is all of the arithmetic checked or guarded by if-statements that will
      catch underflows?
    • If Safe functions are altered, are potential underflows and
      overflows caught so that a failure flag can be thrown?
    • Are all of the rounding directions clearly documented?
  • Testing
    • Are there new or updated unit or integration tests?
    • Do the tests cover the happy paths?
    • Do the tests cover the unhappy paths?
    • Are there an adequate number of fuzz tests to ensure that we are
      covering the full input space?

@coveralls
Copy link
Collaborator

coveralls commented Jul 22, 2024

Pull Request Test Coverage Report for Build 10081037915

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 91.635%

Totals Coverage Status
Change from base Build 10081030400: 0.04%
Covered Lines: 2147
Relevant Lines: 2343

💛 - Coveralls

Copy link

github-actions bot commented Jul 22, 2024

Hyperdrive Gas Benchmark

Benchmark suite Current: 0c22d92 Previous: 2514eec Deviation Status
addLiquidity: min 33893 gas 33893 gas 0% 🟰
addLiquidity: avg 196952 gas 197021 gas -0.0350%
addLiquidity: max 474728 gas 474728 gas 0% 🟰
checkpoint: min 40316 gas 40316 gas 0% 🟰
checkpoint: avg 144575 gas 144541 gas 0.0235% 🚨
checkpoint: max 256108 gas 256108 gas 0% 🟰
closeLong: min 31384 gas 31384 gas 0% 🟰
closeLong: avg 135966 gas 135870 gas 0.0707% 🚨
closeLong: max 2539399 gas 2539399 gas 0% 🟰
closeShort: min 31327 gas 31327 gas 0% 🟰
closeShort: avg 131233 gas 131250 gas -0.0130%
closeShort: max 271250 gas 271250 gas 0% 🟰
initialize: min 31305 gas 31305 gas 0% 🟰
initialize: avg 352431 gas 352411 gas 0.0057% 🚨
initialize: max 418715 gas 418715 gas 0% 🟰
openLong: min 33370 gas 33370 gas 0% 🟰
openLong: avg 174153 gas 174194 gas -0.0235%
openLong: max 333715 gas 333715 gas 0% 🟰
openShort: min 33936 gas 33936 gas 0% 🟰
openShort: avg 174287 gas 174122 gas 0.0948% 🚨
openShort: max 414867 gas 414993 gas -0.0304%
redeemWithdrawalShares: min 31211 gas 31211 gas 0% 🟰
redeemWithdrawalShares: avg 75460 gas 75583 gas -0.1627%
redeemWithdrawalShares: max 305162 gas 305162 gas 0% 🟰
removeLiquidity: min 31217 gas 31217 gas 0% 🟰
removeLiquidity: avg 215022 gas 214398 gas 0.2910% 🚨
removeLiquidity: max 403566 gas 403566 gas 0% 🟰

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

Copy link
Contributor

@jrhea jrhea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work on this! just some questions possible nits.

@jalextowle jalextowle force-pushed the jalextowle/integration/ethena branch from 5f42c18 to 0c22d92 Compare July 24, 2024 17:12
@jalextowle jalextowle added this pull request to the merge queue Jul 24, 2024
Merged via the queue into main with commit 4ca3f48 Jul 24, 2024
32 checks passed
@jalextowle jalextowle deleted the jalextowle/integration/ethena branch July 24, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ethena Integration Testing
4 participants