Skip to content

refactor: consolidate duplicate decimals() into IDecimalsMinimal - #197

Open
thedavidmeister wants to merge 6 commits into
mainfrom
2026-06-18-issue-78-102-interface-integrity
Open

refactor: consolidate duplicate decimals() into IDecimalsMinimal#197
thedavidmeister wants to merge 6 commits into
mainfrom
2026-06-18-issue-78-102-interface-integrity

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Introduces IDecimalsMinimal (a single decimals() interface) and makes IERC4626Minimal inherit from it, eliminating the IERC20MetadataMinimal declaration that duplicated the same decimals() selector (closes Redundant decimals() declared in two interfaces; IERC20MetadataMinimal is leaky #78)
  • Both the vault (share decimals) and the underlying asset (asset decimals) are now cast through IDecimalsMinimal where only decimals() is needed, and through IERC4626Minimal where vault-specific methods are needed
  • No ABI change, no bytecode change

Test plan

  • forge build passes
  • copy-artifacts passes (interface change is bytecode-neutral)
  • Non-fork tests pass

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Streamlined the ERC-4626 minimal interface setup to avoid duplicated decimals() definitions, while keeping the same behavior for vault scale and return values.
  • Chores
    • Pinned the Solidity compiler version to 0.8.25 to improve build stability and consistency.

Replace the separate IERC20MetadataMinimal (which declared only decimals())
with a shared IDecimalsMinimal interface used for both vault share decimals
and underlying asset decimals. IERC4626Minimal inherits IDecimalsMinimal,
removing the duplicated declaration. No ABI or bytecode change.

Closes #78

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Jun 18, 2026
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 34df6cc7-3690-475a-8a14-8fe31b483c18

📥 Commits

Reviewing files that changed from the base of the PR and between 6abb277 and 5731d5d.

📒 Files selected for processing (1)
  • src/lib/erc4626/LibERC4626.sol

Walkthrough

LibERC4626.sol pins the Solidity pragma to =0.8.25, consolidates the shared decimals() signature in IDecimalsMinimal, updates IERC4626Minimal inheritance, removes IERC20MetadataMinimal, and changes _vaultScales to use the new interface.

Changes

ERC-4626 decimals interface deduplication

Layer / File(s) Summary
IDecimalsMinimal introduction and _vaultScales update
src/lib/erc4626/LibERC4626.sol
Pragma is pinned to =0.8.25. IDecimalsMinimal provides decimals(), IERC4626Minimal inherits it, and IERC20MetadataMinimal is removed. _vaultScales now reads asset decimals through IDecimalsMinimal.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the core change: consolidating the duplicate decimals() interface into a shared minimal interface.
Linked Issues check ✅ Passed The PR matches issue #78 by removing the redundant IERC20MetadataMinimal and reusing a shared decimals-only interface without changing behavior.
Out of Scope Changes check ✅ Passed The changes stay focused on the decimals() interface cleanup in LibERC4626.sol and do not introduce unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-06-18-issue-78-102-interface-integrity

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.

thedavidmeister and others added 4 commits June 18, 2026 05:24
Split MockERC20 into test/utils/MockERC20.sol; update base imports.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Remove double blank line in MockERC4626.sol introduced by merge conflict resolution.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thedavidmeister thedavidmeister added the human:needs-work Human reviewer: needs rework label Jul 6, 2026
Co-Authored-By: Claude <noreply@anthropic.com>
@thedavidmeister thedavidmeister added ai:needs-work Needs rework — the producer's inbox (vetter verdict or human ruling) and removed human:needs-work Human reviewer: needs rework labels Jul 30, 2026
@thedavidmeister

Copy link
Copy Markdown
Contributor Author

🤖 ai:vetter
vet-protocol 4
lens source@5731d5db246928d7c1a0851908d5d664b0b31d71 + audit skill invoked at pr:197
Reviewed 5731d5d: needs-work — #78: QA evidence block missing from the PR body, and the diff pins pragma solidity =0.8.25 on library/interface-only LibERC4626.sol (convention: ^ for library/abstract; every sibling src lib floats) — the IDecimalsMinimal consolidation itself is sound with no dangling IERC20MetadataMinimal references.
cost 185 — missing QA block + pragma convention violation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:needs-work Needs rework — the producer's inbox (vetter verdict or human ruling)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redundant decimals() declared in two interfaces; IERC20MetadataMinimal is leaky

1 participant