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

fix: remove redundant getter functions. (OZ N-15) #1050

Closed
wants to merge 3 commits into from

Conversation

MoonBoi9001
Copy link
Member

@MoonBoi9001 MoonBoi9001 commented Sep 30, 2024

This PR is closed, we are going to ignore OZ N-15.

Motivation:

Title:

N-15 Redundant Getter Functions

Details:

When state variables use public visibility in a contract, a getter function for the variable is automatically included.

Throughout the codebase, multiple instances of redundant getter functions were identified:

Within the ProvisionManager contract, the getDelegationRatio and the _getDelegationRatio functions are redundant. Consider removing both or combining them into a public getter.
Within the DisputeManager contract, the getDisputePeriod function is redundant.
Within the SubgraphService contract, the getAllocation function is redundant.
Within the SubgraphService contract, the getLegacyAllocation function is redundant.
Within the Allocation library, the _get function is redundant and the get function could implement its logic.
To improve the overall clarity and readability of the codebase, and save some gas at deployment, consider removing the redundant getter functions.

Review suggestion

  • It might make more sense to look at the induvidual commits instead of the files changed.

Key changes

  • No changes.

Ignored Suggestions

  • Did not remove getDisputePeriod function.
  • Did not remove the getAllocation function.
  • Did not remove the getLegacyAllocationfunction.
  • Did not remove the getDelegationRatio or the _getDelegationRatio functions.
  • Did not remove the _get function.

This comment was marked as outdated.

@MoonBoi9001 MoonBoi9001 force-pushed the fix_oz_n-15 branch 2 times, most recently from e39e11f to 1bbb345 Compare October 1, 2024 16:01
@MoonBoi9001 MoonBoi9001 closed this Oct 2, 2024
@MoonBoi9001 MoonBoi9001 reopened this Oct 2, 2024
@MoonBoi9001 MoonBoi9001 closed this Oct 2, 2024
@MoonBoi9001 MoonBoi9001 deleted the fix_oz_n-15 branch October 2, 2024 17:14
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.

1 participant