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

Remove unused HooksConfigLib arguments #698

Merged
merged 8 commits into from
Jul 1, 2024
Merged

Conversation

EndymionJkb
Copy link
Collaborator

@EndymionJkb EndymionJkb commented Jun 28, 2024

Description

Little one to address a consequence of merging Hooks and Pool configs and remove distracting warnings. Saves a little gas, too.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Dependency changes
  • Code refactor / cleanup
  • Documentation or wording changes
  • Other

Checklist:

  • The diff is legible and has no extraneous changes
  • Complex code has been commented, including external interfaces
  • Tests have 100% code coverage
  • The base branch is either main, or there's a description of how to merge

Issue Resolution

Copy link
Contributor

@jubeira jubeira left a comment

Choose a reason for hiding this comment

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

Why not just remove the argument and make a regular library call?

I'd just do HooksConfigLib.callComputeDynamicSwapFeeHook(swapParams, staticSwapFeePercentage, ...);

@EndymionJkb
Copy link
Collaborator Author

Why not just remove the argument and make a regular library call?

I'd just do HooksConfigLib.callComputeDynamicSwapFeeHook(swapParams, staticSwapFeePercentage, ...);

I had it like that originally, but didn't want to break the pattern of the others (since some do use the argument). Can see what it looks like that way.

@EndymionJkb EndymionJkb changed the title Suppress HooksConfigLib warnings (and explain) Remove unused HooksConfigLib arguments Jun 29, 2024
@EndymionJkb EndymionJkb requested a review from jubeira June 29, 2024 15:27
Copy link

openzeppelin-code bot commented Jul 1, 2024

Remove unused HooksConfigLib arguments

Generated at commit: a4c9a8149f79fcda17c53c850f0abdd53fe3c0f5

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
2
0
11
37
52
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

Copy link
Contributor

@jubeira jubeira left a comment

Choose a reason for hiding this comment

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

I think this looks better, thanks @EndymionJkb.

I don't think 'breaking the pattern' is an issue here; this looks preferable compared to having unused function arguments for the sake of using the syntax sugar for libraries.

@EndymionJkb EndymionJkb merged commit b24dfc7 into main Jul 1, 2024
12 checks passed
@EndymionJkb EndymionJkb deleted the hook-config-args branch July 1, 2024 16:07
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.

2 participants