Skip to content

refactor(audit-low): style + refactor sweep — ~22 LOW findings#231

Closed
hardyjosh wants to merge 1 commit into
fix/audit-low-code-correctnessfrom
fix/audit-low-style-refactor
Closed

refactor(audit-low): style + refactor sweep — ~22 LOW findings#231
hardyjosh wants to merge 1 commit into
fix/audit-low-code-correctnessfrom
fix/audit-low-style-refactor

Conversation

@hardyjosh

Copy link
Copy Markdown
Collaborator

Bulk LOW-severity stylistic / refactor changes that have no behavioural
risk:

Style:

Refactors:

Storage hardening (#116, #218):

  • BasePythOracleAdapter storage groups separated by comment banners
    ("mutable governance" vs "immutable-after-init corporate-action
    config" vs "reserved slots"); ends with a uint256[50] __gap
    reserved-slot array so future base additions don't shift subclass
    slots. Subclass slot positions shift one-time by 50; safe because
    no live deployment exists. Adds vm.load-based storage layout test
    pinning vault at slot 0 and MultiPythOracleAdapter.feedCount at
    the post-gap slot 55.

forge build, forge fmt --check, slither (0 results), and REUSE all
green. Test count delta: 147 → 148 (+1, the new storage layout test).
No behaviour change to user-visible APIs beyond
NonPositivePrice(int256) shape change and storage layout (documented
above).

Closes #114, #115, #116, #117, #119, #122, #123, #124, #125, #126,
#127, #128, #130, #131, #133, #134, #136, #137, #138, #139, #140,
#141, #142, #143, #200, #218.

Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com

hardyjosh commented May 11, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 19b72ad6-2c7c-469d-9ef6-60f3387988da

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/audit-low-style-refactor

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hardyjosh hardyjosh force-pushed the fix/audit-low-style-refactor branch from 3fecffb to 6154ea4 Compare May 11, 2026 16:15
@hardyjosh hardyjosh force-pushed the fix/audit-low-code-correctness branch from 65579be to 03a3149 Compare May 11, 2026 16:15
@hardyjosh hardyjosh force-pushed the fix/audit-low-code-correctness branch from 03a3149 to b1cf23a Compare May 11, 2026 20:42
@hardyjosh hardyjosh force-pushed the fix/audit-low-style-refactor branch 2 times, most recently from 1315d9c to e404e74 Compare May 11, 2026 21:22
@hardyjosh hardyjosh force-pushed the fix/audit-low-style-refactor branch from e404e74 to a0ad72a Compare May 11, 2026 21:52
@hardyjosh hardyjosh force-pushed the fix/audit-low-code-correctness branch from 02a9fe1 to ee0133e Compare May 11, 2026 22:09
@hardyjosh hardyjosh force-pushed the fix/audit-low-style-refactor branch from a0ad72a to 5678933 Compare May 11, 2026 22:10
Bulk LOW-severity stylistic / refactor changes that have no behavioural
risk:

Style:
- #114 #117 #122 #128 #131 #136 #137 #138 #139 #140 #141 #142 #143:
  project-namespaced remapping `st0x.oracle/=src/`; all internal
  imports rewritten to use it so the repo is consumable as a git
  submodule without remapping conflicts.
- #134: LibProdDeploy.sol pragma pinned to =0.8.25.
- #119: MultiZero*/InitializeMultiOracleFailed errors in
  MultiPythOracleAdapterBeaconSetDeployer renamed to match sibling
  deployer naming (ZeroImplementation, ZeroBeaconOwner,
  InitializeAdapterFailed).

Refactors:
- #127: file-level OnlyAdmin / ZeroAdmin / ZeroVault / ZeroRegistry /
  OracleNotFound hoisted to src/lib/LibOracleErrors.sol; 4 consumers
  updated (BasePythOracleAdapter, OracleRegistry, MorphoProtocolAdapter,
  PassthroughProtocolAdapter).
- #130: OracleRegistry extracts _setOracle helper consumed by both
  setOracle and setOracleBulk.
- #124: MultiPythOracleAdapter.initialize bound checks already
  centralised in _setFeeds — no further dedup required (PR #230 #41).
- #125: MorphoProtocolAdapter.NonPositivePrice carries int256 price
  matching BasePythOracleAdapter.
- #126: MorphoProtocolAdapter 1e28 magic number replaced with named
  constants derived from MORPHO_PRICE_SCALE and EXPECTED_ORACLE_DECIMALS
  (SCALE_MULTIPLIER = MORPHO_PRICE_SCALE / 10**EXPECTED_ORACLE_DECIMALS).
- #115: BasePythOracleAdapter int256(price8) cast annotated with
  forge-lint disable + safety comment.
- #123: MultiPythOracleAdapter._tryGetPrice local `p` → `fetchedPrice`
  (named-return is already `price`, so use a distinct name).
- #133: LibCorporateActionsPause local `vault` → `corporateActions`
  to avoid shadowing the priced-vault meaning; also documents the
  discarded tuple-return placeholder.
- #200: LibCorporateActionsPause adds defensive `effectiveTime != 0`
  belt-and-suspenders on top of the NODE_NONE cursor check in both
  pre- and post-window branches.

Storage hardening (#116, #218):
- BasePythOracleAdapter storage groups separated by comment banners
  ("mutable governance" vs "immutable-after-init corporate-action
  config" vs "reserved slots"); ends with a `uint256[50] __gap`
  reserved-slot array so future base additions don't shift subclass
  slots. Subclass slot positions shift one-time by 50; safe because
  no live deployment exists. Adds vm.load-based storage layout test
  pinning `vault` at slot 0 and `MultiPythOracleAdapter.feedCount` at
  the post-gap slot 55.

forge build, forge fmt --check, slither (0 results), and REUSE all
green. Test count delta: 147 → 148 (+1, the new storage layout test).
No behaviour change to user-visible APIs beyond
NonPositivePrice(int256) shape change and storage layout (documented
above).

Closes #114, #115, #116, #117, #119, #122, #123, #124, #125, #126,

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hardyjosh hardyjosh force-pushed the fix/audit-low-style-refactor branch from 5678933 to a57f73a Compare May 11, 2026 22:27
@hardyjosh hardyjosh force-pushed the fix/audit-low-code-correctness branch from ee0133e to 735cfde Compare May 11, 2026 22:27
@hardyjosh

Copy link
Copy Markdown
Collaborator Author

Storage __gap carve-out folded into PR #238 (chore: remove MultiPyth) since the corp-actions stack head is the natural anchor. Remaining style/refactor work (LibOracleErrors hoist, project-namespaced remapping) deferred for Euler launch — defer because most of it is invasive churn touching every file.

@hardyjosh hardyjosh closed this May 26, 2026
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