Use tycho-substreams erc20 abi.

This commit is contained in:
kayibal
2025-02-06 10:15:22 -06:00
committed by Alan Höng
parent 7302989617
commit a7e1dd9397
10 changed files with 6 additions and 2582 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1 @@
#![allow(clippy::all)]
pub mod erc20;

View File

@@ -39,7 +39,8 @@ use std::collections::HashMap;
use substreams::{pb::substreams::StoreDeltas, prelude::*};
use substreams_ethereum::{pb::eth, Event};
use tycho_substreams::{
balances::aggregate_balances_changes, contract::extract_contract_changes_builder, prelude::*,
abi::erc20, balances::aggregate_balances_changes, contract::extract_contract_changes_builder,
prelude::*,
};
/// Find and create all relevant protocol components
@@ -128,7 +129,7 @@ fn map_relative_component_balance(
let res = block
.logs()
.filter_map(|log| {
crate::abi::erc20::events::Transfer::match_and_decode(log).map(|transfer| {
erc20::events::Transfer::match_and_decode(log).map(|transfer| {
let to_addr = hex::encode(transfer.to.as_slice());
let from_addr = hex::encode(transfer.from.as_slice());
let tx = log.receipt.transaction;