Fix CronUpkeep so that storage layout matches delegate#304
Conversation
Static analysis results are availableHey @infiloop2, you can view Slither reports in the job summary here or download them as artifact here. |
There was a problem hiding this comment.
Pull request overview
This PR attempts to fix the storage layout alignment between CronUpkeep and CronUpkeepDelegate by moving the s_permissionedForwarder variable to the end of the storage layout in both contracts. However, the fix is incomplete and the storage layouts still do not match.
Key Changes:
- Moved
s_permissionedForwarderfrom its original position (afters_activeCronJobIDs) to after all mappings inCronUpkeep - Added
s_permissionedForwarderto the end of storage inCronUpkeepDelegate
Critical Issue: The delegate is still missing several storage variables that exist in CronUpkeep:
s_pendingOwner(fromConfirmedOwnerparent contract)_paused(fromPausableparent contract)s_handlerSignaturesmapping
For delegatecall to work correctly, the storage layouts must match exactly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
contracts/src/v0.8/automation/upkeeps/CronUpkeepDelegate.sol |
Adds s_permissionedForwarder at the end, but storage layout remains incomplete |
contracts/src/v0.8/automation/upkeeps/CronUpkeep.sol |
Moves s_permissionedForwarder to after all mappings for alignment with delegate |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Followup from #293 that i found in testing. Since cron upkeep also has a delegate contract, their storage layout needs to match, fixing that