-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Use vm.prank(address,bool) for delegateCall, remove DelegateCaller contract #18331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
c200575 to
047fc5f
Compare
was expecting foundry to override the CALL to a delegatcall for some reason.
7c3d72d to
4c9b710
Compare
de18884 to
ed9fcd6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #18331 +/- ##
===========================================
+ Coverage 74.91% 79.77% +4.86%
===========================================
Files 181 126 -55
Lines 10930 6899 -4031
===========================================
- Hits 8188 5504 -2684
+ Misses 2598 1395 -1203
+ Partials 144 0 -144
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Adds a prankDelegateCall() helper function to eliminate repetitive code pattern for handling Foundry's requirement that addresses have at least one byte of code to prank delegatecalls. This helper combines vm.etch() and vm.prank(_, true) into a single reusable function.
ed9fcd6 to
fb6c122
Compare
|
Keeping in draft so as not to block #18079. |
Prevents merge conflicts with other inflight work
| vm.etch(_caller, hex"00"); | ||
| } | ||
| vm.prank(_caller, true); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created this as a free function here because I couldn't really find an appropriate place to put it, and it wasn't needed in ForkLive (the only other file that used DelegateCaller).
I could move it into CommonTest if preferred, but it doesn't quite match the nature of the existing functions there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with having it here as I dont know where I would put it
Removes the usage of DelegateCaller. The pattern established is much nicer.
However DelegateCaller is not deleted here, so as not to conflict with #18079 which makes use of it.