fix: mark function visibility and apply formatting#455
Open
0xObsidian wants to merge 3 commits intofarcasterxyz:mainfrom
Open
fix: mark function visibility and apply formatting#4550xObsidian wants to merge 3 commits intofarcasterxyz:mainfrom
0xObsidian wants to merge 3 commits intofarcasterxyz:mainfrom
Conversation
The setStorageRegistry function was missing validation checks for the new address, which could lead to setting invalid contracts or non-contract addresses as the storage registry. Description ---------- - Added zero address check using revert - Added contract existence check - Used revert with custom errors instead of require() for: - Gas efficiency (4-byte selector vs string storage) - Better ABI compatibility via custom errors - Updated registry tests to align with the current implementation - Fixed `assumeNotPrecompile` issue - Ran forge formatting on all modified files in this PR scope Testing the fix ---------------- Fetch this PR branch and from the root: Add `foundry-rs/forge-std` ``` forge install foundry-rs/forge-std ``` Run test ``` forge test --match-test testFuzzSetStorageRegistry -vvv ```
Description ----------- - Added pure/view modifiers to functions that don't modify state - Applied forge fmt for consistent code formatting - Fixed compiler warnings related to state mutability Reason ------ - To prevent accidental state modifications - To make code intentions clearer - To enable better compiler optimizations for read-only calls Breaking changes ---------------- - No introduced changes Testing -------- Fetch this commit branch and run ``` forge coverage -vvv ```
Gas snapshots should reflect current changes from adding proper state mutability modifiers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This PR is to:
Change
pure/viewmodifiers to functions that don't modifyMerge Checklist
Choose all relevant options below by adding an
xnow or at any time before submitting for reviewAdditional Context
Breaking changes
Testing
Fetch this commit branch and run
PR-Codex overview
This PR primarily focuses on improving code readability by formatting function signatures across various files. It enhances clarity without altering the logic or functionality.
Detailed summary
IMigration.sol,Bundler.sol,IEIP712.sol, and others.viewwhere applicable in test files.