-
Notifications
You must be signed in to change notification settings - Fork 49
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
hevm startPrank
overrides msg.sender at all call depth levels, making it inconsistent vs foundry and causing unintended operations
#608
Comments
startPrank
overrides msg.sender at all call depth levels, making it inconsistent vs foundry and causing unintended operations
Right, so So what you are saying would I think mean that when we do another |
So I have a new branch, |
@msooseth EDIT: I think you did just that on the branch, it'll probably work fine now 💯 thanks! From what I understand it should be like this:
|
@GalloDaSballo I opened a draft PR on Echidna that uses @msooseth's hevm branch, if you can try it out and see if it behaves as expected now, that'd be great: crytic/echidna#1331 |
Thank you all, will test it soon |
OK, seems to be fixed with c6c4b44. The corresponding echidna is: You can cone that, go into |
Have tested this release candidate by @elopez : I ran it for 1 Million tests with no reverts In contrast see the previous version failing in less than 50k tests |
Closing as it's now passing and merged. Thanks a lot! :) |
Impact
I have written this repo which shows a full repro
https://github.com/Recon-Fuzz/prank-echidna-vs-foundry
Fundamentally, when using
startPrank
and calling a contract that performs atransferFrom
, echidna (using hevm under the hood), will perform thetransferFrom
with the pranked address instead of the router, causing the transfer to failMitigation
I believe that the prank should only be enforced at the current call level, a nested call should not longer have it's msg.sender altered
The text was updated successfully, but these errors were encountered: