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: update function visibility (OZ N-16) #1051

Merged
merged 5 commits into from
Oct 2, 2024
Merged

fix: update function visibility (OZ N-16) #1051

merged 5 commits into from
Oct 2, 2024

Conversation

MoonBoi9001
Copy link
Member

@MoonBoi9001 MoonBoi9001 commented Oct 1, 2024

Motivation:

Title:

N-16 Function Visibility Overly Permissive

Details:

Throughout the codebase, multiple instances of functions with unnecessarily permissive visibility were identified:

The _verifyAllocationProof function in AllocationManager.sol with internal visibility could be limited to private.
The _getDelegatedTokensAvailable function in HorizonStakingBase.sol with internal visibility could be limited to private.
The _receiveIndexerStake and _receiveDelegation functions in HorizonStakingExtension with internal visibility could be made private.
The _deposit function in PaymentsEscrow.sol with internal visibility could be limited to private.
The acceptDispute and drawDispute functions in DisputeManager.sol with public visibility could be limited to external.
To better convey the intended use of functions, consider changing a function's visibility to be only as permissive as required.

Key changes

Copy link

fix: update function visibility (OZ N-16)

Generated at commit: 32b39657bb2b462ac4c02068dba688318788ce65

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
4
0
15
40
61
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

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.51%. Comparing base (374f57d) to head (32b3965).
Report is 45 commits behind head on horizon.

Additional details and impacted files
@@           Coverage Diff            @@
##           horizon    #1051   +/-   ##
========================================
  Coverage    92.51%   92.51%           
========================================
  Files           46       46           
  Lines         2392     2392           
  Branches       428      428           
========================================
  Hits          2213     2213           
  Misses         179      179           
Flag Coverage Δ
unittests 92.51% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MoonBoi9001 MoonBoi9001 marked this pull request as ready for review October 1, 2024 16:30
Copy link
Contributor

@tmigone tmigone left a comment

Choose a reason for hiding this comment

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

🌞

@MoonBoi9001 MoonBoi9001 merged commit 41f85c8 into horizon Oct 2, 2024
13 of 15 checks passed
@MoonBoi9001 MoonBoi9001 deleted the fix_oz_n-16 branch October 2, 2024 09:09
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