Skip to content
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

feat(cheatcodes): add delegatecall to pranking #8863

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

EdwardJES
Copy link
Contributor

@EdwardJES EdwardJES commented Sep 13, 2024

Motivation

Closes #824. Currently there is no easy way to test delegate calls using foundry tests.

Solution

  • Add a delegate_call flag to the prank.
  • ....

@@ -833,6 +833,19 @@ impl Cheatcodes {

// Apply our prank
if let Some(prank) = &self.prank {
// Apply delegate call. call.caller will not equal prank.prank_caller
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @zerosnacks, my understanding is a little fuzzy here. It seems in the case of a delegate call that call.caller == prank.prank_caller will not be true. Is it suitable to have this here? Ty.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @DaniPopes would you have more context on this?

@EdwardJES EdwardJES changed the title feat(cheatcodes): add delegatecall to pranking [WIP] feat(cheatcodes): add delegatecall to pranking Sep 13, 2024
@zerosnacks
Copy link
Member

Hi @EdwardJES thanks for your PR - my apologies that it has taken a while to respond

@EdwardJES EdwardJES marked this pull request as ready for review September 27, 2024 00:44
@EdwardJES EdwardJES changed the title [WIP] feat(cheatcodes): add delegatecall to pranking feat(cheatcodes): add delegatecall to pranking Sep 30, 2024
@EdwardJES
Copy link
Contributor Author

gentle bump on this @zerosnacks, @DaniPopes . Thank you 🙏

@grandizzy grandizzy self-assigned this Nov 5, 2024
@grandizzy
Copy link
Collaborator

@EdwardJES is there anything waiting from us to unblock the PR or can we start the review? thank you!

@EdwardJES
Copy link
Contributor Author

@grandizzy all good to go, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

feat(cheatcodes): add vm.delegatePrank to execute a delegatecall in the context of the pranked address
4 participants