refactor: consolidate DummyCaller contracts into single generic implementation#18786
Merged
smartcontracts merged 3 commits intodevelopfrom Jan 15, 2026
Merged
Conversation
…mentation Replaces 7 nearly-identical DummyCaller contracts with a single generic implementation that uses a fallback() function to forward any call. Changes: - Add scripts/libraries/DummyCaller.sol with generic delegatecall forwarder - Update UpgradeOPChain.s.sol to use generic DummyCaller - Update UpgradeSuperchainConfig.s.sol to use generic DummyCaller - Update AddGameType.s.sol to use generic DummyCaller - Update InteropMigration.s.sol to use generic DummyCaller - Remove redundant DummyCallerV1, DummyCallerV2, and DummyCaller contracts The generic DummyCaller reads the target address from storage slot 0, forwards calldata via delegatecall, reverts on failure, and returns on success. This is functionally equivalent to the previous implementations since all callers required success anyway. Closes #18784 Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>
- Use type(DummyCaller).runtimeCode instead of creationCode for vm.etch() - Use low-level calls in _upgrade() to avoid return type mismatches - Get upgradeInput before vm.broadcast() to avoid staticcall errors Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #18786 +/- ##
===========================================
+ Coverage 73.93% 77.03% +3.09%
===========================================
Files 190 135 -55
Lines 11318 7288 -4030
===========================================
- Hits 8368 5614 -2754
+ Misses 2804 1674 -1130
+ Partials 146 0 -146
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
maurelian
approved these changes
Jan 15, 2026
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.
Summary
Replaces 7 nearly-identical
DummyCallercontracts scattered across deployment scripts with a single generic implementation that uses afallback()function to forward any call via delegatecall.The new generic
DummyCallerinscripts/libraries/DummyCaller.sol:Implementation approach:
AddGameType.s.sol) use typed calls directly on the prank addressUpgradeOPChain.s.sol,UpgradeSuperchainConfig.s.sol) use low-levelcall()to avoid ABI decoding issuestype(DummyCaller).runtimeCodeforvm.etch()(notcreationCode)Files changed:
scripts/libraries/DummyCaller.solwith generic implementationUpgradeOPChain.s.sol(removedDummyCallerV1,DummyCallerV2)UpgradeSuperchainConfig.s.sol(removedDummyCaller,DummyCallerV2)AddGameType.s.sol(removedDummyCaller)InteropMigration.s.sol(removedDummyCaller)Closes #18784
Review & Testing Checklist for Human
DummyCaller.solfallback is correct - The inline assembly handles calldatacopy, delegatecall, returndatacopy, and result switching. This is the most critical piece to review.AddGameType.s.solreturn value handling - This script callsIOPContractsManager(prank).addGameType()and expectsAddGameOutput[]return. Confirm the fallback correctly returns raw delegatecall return data that Solidity can decode.UpgradeOPChain.s.solandUpgradeSuperchainConfig.s.soluse_prank.call(data)instead of typed calls to avoid return type mismatches. Verify this is correct.Notes
Requested by: Kelvin Fichter (@smartcontracts)
Link to Devin run: https://app.devin.ai/sessions/0c6ba96a87ff4461b09ef02d3da8c4df
Last update: 2026-01-14 14:41 ET