From 33e5f6a23612d94eecc4210d5a5dee10794583ea Mon Sep 17 00:00:00 2001 From: Florian Pellissier <111426680+flopell@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:18:58 +0200 Subject: [PATCH] fix(substreams): Fix storage changes indexing for DELEGATECALL --- substreams/crates/tycho-substreams/src/contract.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/substreams/crates/tycho-substreams/src/contract.rs b/substreams/crates/tycho-substreams/src/contract.rs index 250da36..84bf079 100644 --- a/substreams/crates/tycho-substreams/src/contract.rs +++ b/substreams/crates/tycho-substreams/src/contract.rs @@ -131,7 +131,11 @@ pub fn extract_contract_changes bool>( block_tx .calls .iter() - .filter(|call| !call.state_reverted && inclusion_predicate(&call.address)) + .filter(|call| { + !call.state_reverted && inclusion_predicate(&call.address) || + inclusion_predicate(&call.caller) // In the context of DELEGATECALL + // call.caller changes it's own state + }) .for_each(|call| { storage_changes.extend(call.storage_changes.iter()); balance_changes.extend(call.balance_changes.iter());