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

fix: state diff for broadcasted CREATE2 deployments #7632

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions crates/cheatcodes/src/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1342,15 +1342,6 @@ impl<DB: DatabaseExt> Inspector<DB> for Cheatcodes {
let address = self.allow_cheatcodes_on_create(ecx, call);
// If `recordAccountAccesses` has been called, record the create
if let Some(recorded_account_diffs_stack) = &mut self.recorded_account_diffs_stack {
// If the create scheme is create2, and the caller is the DEFAULT_CREATE2_DEPLOYER then
// we must add 1 to the depth to account for the call to the create2 factory.
let mut depth = ecx.journaled_state.depth();
if let CreateScheme::Create2 { salt: _ } = call.scheme {
if call.caller == DEFAULT_CREATE2_DEPLOYER {
depth += 1;
}
}

// Record the create context as an account access and create a new vector to record all
// subsequent account accesses
recorded_account_diffs_stack.push(vec![AccountAccess {
Expand All @@ -1369,7 +1360,7 @@ impl<DB: DatabaseExt> Inspector<DB> for Cheatcodes {
reverted: false,
deployedCode: Bytes::new(), // updated on create_end
storageAccesses: vec![], // updated on create_end
depth,
depth: ecx.journaled_state.depth(),
}]);
}

Expand Down
Loading