fix(balancer_v2): skip adding zero address rate_provider entrypoints (#224)

This commit is contained in:
Louise Poole
2025-06-25 17:52:49 +02:00
committed by GitHub
parent 1c6c2c53c7
commit dfa87f662d
4 changed files with 35 additions and 13 deletions

View File

@@ -15,6 +15,7 @@ use tycho_substreams::{
};
pub const VAULT_ADDRESS: &[u8] = &hex!("BA12222222228d8Ba445958a75a0704d566BF2C8");
pub const ZERO_ADDRESS: &[u8] = &[0u8; 20];
#[substreams::handlers::map]
pub fn map_components(block: eth::v2::Block) -> Result<BlockTransactionProtocolComponents> {
@@ -214,6 +215,11 @@ pub fn map_protocol_changes(
if let Some(rate_providers) = rate_providers {
for rate_provider in rate_providers {
if rate_provider == ZERO_ADDRESS {
// Skipped: is not a rate provider
continue;
}
let trace_data = TraceData::Rpc(RpcTraceData {
caller: None,
calldata: hex::decode("679aefce").unwrap(), // getRate()