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

Add the deployerCoordinatorManager role to the HyperdriveFactory #1022

Merged
merged 2 commits into from
May 13, 2024

Conversation

jalextowle
Copy link
Contributor

@jalextowle jalextowle commented May 11, 2024

Description

This PR adds a new role to the factory that can add and remove deployer coordinators. This will provide some flexibility to governance on mainnet so that they can avoid timelocks every time a deployer coordinator is added.

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 and/or Rust, 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 May 11, 2024

Pull Request Test Coverage Report for Build 9067119689

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 93.303%

Totals Coverage Status
Change from base Build 9039652527: 0.07%
Covered Lines: 1839
Relevant Lines: 1971

💛 - Coveralls

Copy link

github-actions bot commented May 11, 2024

Hyperdrive Gas Benchmark

Benchmark suite Current: 2d167aa Previous: c26ba16 Deviation Status
addLiquidity: min 33827 gas 33827 gas 0% 🟰
addLiquidity: avg 156539 gas 156990 gas -0.2873%
addLiquidity: max 428417 gas 428417 gas 0% 🟰
checkpoint: min 40292 gas 40292 gas 0% 🟰
checkpoint: avg 142301 gas 142359 gas -0.0407%
checkpoint: max 253424 gas 253424 gas 0% 🟰
closeLong: min 31361 gas 31361 gas 0% 🟰
closeLong: avg 135153 gas 135212 gas -0.0436%
closeLong: max 2625796 gas 2625796 gas 0% 🟰
closeShort: min 31349 gas 31349 gas 0% 🟰
closeShort: avg 131644 gas 131726 gas -0.0623%
closeShort: max 262998 gas 262998 gas 0% 🟰
initialize: min 31371 gas 31371 gas 0% 🟰
initialize: avg 330242 gas 330266 gas -0.0073%
initialize: max 396259 gas 396259 gas 0% 🟰
openLong: min 33370 gas 33370 gas 0% 🟰
openLong: avg 173250 gas 173099 gas 0.0872% 🚨
openLong: max 306657 gas 306657 gas 0% 🟰
openShort: min 33936 gas 33936 gas 0% 🟰
openShort: avg 167932 gas 168046 gas -0.0678%
openShort: max 415379 gas 415299 gas 0.0193% 🚨
redeemWithdrawalShares: min 31251 gas 31251 gas 0% 🟰
redeemWithdrawalShares: avg 74691 gas 74263 gas 0.5763% 🚨
redeemWithdrawalShares: max 209828 gas 209828 gas 0% 🟰
removeLiquidity: min 31301 gas 31301 gas 0% 🟰
removeLiquidity: avg 209204 gas 208988 gas 0.1034% 🚨
removeLiquidity: max 403640 gas 403652 gas -0.0030%

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

Copy link
Contributor

@mcclurejt mcclurejt left a comment

Choose a reason for hiding this comment

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

left comment suggestion otherwise LGTM

contracts/src/factory/HyperdriveFactory.sol Outdated Show resolved Hide resolved
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.

lgtm. coverage is saying that we lost this line of coverage? im happy to make a new PR to add it back - just wanted to mention it:

image

@jalextowle jalextowle enabled auto-merge May 13, 2024 17:24
@jalextowle jalextowle added this pull request to the merge queue May 13, 2024
Merged via the queue into main with commit bb6fffe May 13, 2024
30 checks passed
@jalextowle jalextowle deleted the jalextowle/factory/deployer-coordinator-manager branch May 13, 2024 18:25
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.

None yet

4 participants