From e8bde64a23283e870c86f63acdb006cf794344f5 Mon Sep 17 00:00:00 2001 From: Zizou <111426680+zizou0x@users.noreply.github.com> Date: Wed, 14 May 2025 10:57:22 +0200 Subject: [PATCH] fix: update `tycho-substreams` version in all vm packages (#206) This is needed after https://github.com/propeller-heads/tycho-protocol-sdk/pull/201 Co-authored-by: zizou <111426680+flopell@users.noreply.github.com> --- substreams/Cargo.lock | 94 ++-- substreams/ethereum-ambient/Cargo.toml | 8 +- .../src/modules/3_map_changes.rs | 1 + substreams/ethereum-ambient/substreams.yaml | 6 +- substreams/ethereum-balancer-v2/Cargo.toml | 4 +- substreams/ethereum-balancer-v2/build.rs | 8 +- .../src/pool_factories.rs | 432 +++++++++--------- .../ethereum-balancer-v2/substreams.yaml | 2 +- substreams/ethereum-curve/Cargo.toml | 4 +- .../ethereum-curve/src/pool_factories.rs | 42 -- substreams/ethereum-curve/src/pools.rs | 6 - substreams/ethereum-curve/substreams.yaml | 2 +- substreams/ethereum-sfrax/Cargo.toml | 4 +- substreams/ethereum-sfrax/src/modules.rs | 2 +- substreams/ethereum-sfrax/substreams.yaml | 2 +- substreams/ethereum-sfraxeth/Cargo.toml | 4 +- substreams/ethereum-sfraxeth/src/modules.rs | 12 +- substreams/ethereum-sfraxeth/substreams.yaml | 4 +- .../ethereum-template-factory/Cargo.toml | 2 +- substreams/ethereum-template-factory/build.rs | 8 +- .../ethereum-template-singleton/Cargo.toml | 2 +- .../ethereum-template-singleton/build.rs | 8 +- 22 files changed, 296 insertions(+), 361 deletions(-) diff --git a/substreams/Cargo.lock b/substreams/Cargo.lock index d7d0b69..58fc8e2 100644 --- a/substreams/Cargo.lock +++ b/substreams/Cargo.lock @@ -220,9 +220,27 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "ethereum-ambient" +version = "0.6.1" +dependencies = [ + "anyhow", + "bytes", + "ethabi 18.0.0", + "hex", + "hex-literal 0.4.1", + "num-bigint", + "prost 0.11.9", + "quote", + "substreams", + "substreams-ethereum", + "tiny-keccak", + "tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)", +] + [[package]] name = "ethereum-balancer-v2" -version = "0.2.4" +version = "0.2.5" dependencies = [ "anyhow", "bytes", @@ -236,12 +254,12 @@ dependencies = [ "prost-types 0.12.6", "substreams", "substreams-ethereum", - "tycho-substreams 0.2.0 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=b8aeaa3)", + "tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)", ] [[package]] name = "ethereum-curve" -version = "0.3.2" +version = "0.3.3" dependencies = [ "anyhow", "bytes", @@ -257,7 +275,7 @@ dependencies = [ "serde_qs", "substreams", "substreams-ethereum", - "tycho-substreams 0.2.0 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=b8aeaa3)", + "tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)", ] [[package]] @@ -300,6 +318,26 @@ dependencies = [ [[package]] name = "ethereum-sfrax" +version = "0.1.2" +dependencies = [ + "anyhow", + "ethabi 17.2.0", + "getrandom", + "hex", + "hex-literal 0.4.1", + "itertools 0.12.1", + "num-bigint", + "num-traits", + "prost 0.11.9", + "prost-types 0.11.9", + "regex", + "substreams", + "substreams-ethereum", + "tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)", +] + +[[package]] +name = "ethereum-sfraxeth" version = "0.1.1" dependencies = [ "anyhow", @@ -315,27 +353,7 @@ dependencies = [ "regex", "substreams", "substreams-ethereum", - "tycho-substreams 0.2.0 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=b8aeaa3)", -] - -[[package]] -name = "ethereum-sfraxeth" -version = "0.1.0" -dependencies = [ - "anyhow", - "ethabi 17.2.0", - "getrandom", - "hex", - "hex-literal 0.4.1", - "itertools 0.12.1", - "num-bigint", - "num-traits", - "prost 0.11.9", - "prost-types 0.11.9", - "regex", - "substreams", - "substreams-ethereum", - "tycho-substreams 0.2.0 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=b8aeaa3)", + "tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)", ] [[package]] @@ -352,7 +370,7 @@ dependencies = [ "serde-sibor", "substreams", "substreams-ethereum", - "tycho-substreams 0.2.0 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=3c08359)", + "tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)", ] [[package]] @@ -370,7 +388,7 @@ dependencies = [ "serde_qs", "substreams", "substreams-ethereum", - "tycho-substreams 0.2.0 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=3c08359)", + "tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)", ] [[package]] @@ -1375,24 +1393,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "substreams-ethereum-ambient" -version = "0.5.2" -dependencies = [ - "anyhow", - "bytes", - "ethabi 18.0.0", - "hex", - "hex-literal 0.4.1", - "num-bigint", - "prost 0.11.9", - "quote", - "substreams", - "substreams-ethereum", - "tiny-keccak", - "tycho-substreams 0.2.0 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=f90c33b)", -] - [[package]] name = "substreams-ethereum-core" version = "0.9.13" @@ -1646,8 +1646,7 @@ dependencies = [ [[package]] name = "tycho-substreams" -version = "0.2.0" -source = "git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=f90c33b#f90c33bcc229a1bca1fe86ee6fc4024cbdc25aeb" +version = "0.2.1" dependencies = [ "ethabi 18.0.0", "hex", @@ -1663,6 +1662,7 @@ dependencies = [ [[package]] name = "tycho-substreams" version = "0.2.1" +source = "git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021#52d502198e9aa964814ef5f139df0886c3eb7bb0" dependencies = [ "ethabi 18.0.0", "hex", diff --git a/substreams/ethereum-ambient/Cargo.toml b/substreams/ethereum-ambient/Cargo.toml index 927ed47..0964756 100644 --- a/substreams/ethereum-ambient/Cargo.toml +++ b/substreams/ethereum-ambient/Cargo.toml @@ -1,14 +1,14 @@ [package] -name = "substreams-ethereum-ambient" -version = "0.5.2" +name = "ethereum-ambient" +version = "0.6.1" edition = "2021" [lib] -name = "substreams_ethereum_ambient" +name = "ethereum_ambient" crate-type = ["cdylib"] [dependencies] -tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "f90c33b" } +tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "52d5021" } substreams = "0.5.22" substreams-ethereum = "0.9.9" prost = "0.11" diff --git a/substreams/ethereum-ambient/src/modules/3_map_changes.rs b/substreams/ethereum-ambient/src/modules/3_map_changes.rs index ca96013..13b2a0a 100644 --- a/substreams/ethereum-ambient/src/modules/3_map_changes.rs +++ b/substreams/ethereum-ambient/src/modules/3_map_changes.rs @@ -47,6 +47,7 @@ impl From for ContractChange { .map(|(slot, value)| ContractSlot { slot, value: value.new_value }) .collect(), change: value.change.into(), + token_balances: Vec::new(), } } } diff --git a/substreams/ethereum-ambient/substreams.yaml b/substreams/ethereum-ambient/substreams.yaml index f0db72c..c7852fa 100644 --- a/substreams/ethereum-ambient/substreams.yaml +++ b/substreams/ethereum-ambient/substreams.yaml @@ -1,7 +1,7 @@ specVersion: v0.1.0 package: - name: "substreams_ethereum_ambient" - version: v0.6.0 + name: "ethereum_ambient" + version: v0.6.1 protobuf: files: @@ -14,7 +14,7 @@ protobuf: binaries: default: type: wasm/rust-v1 - file: ../target/wasm32-unknown-unknown/release/substreams_ethereum_ambient.wasm + file: ../target/wasm32-unknown-unknown/release/ethereum_ambient.wasm modules: - name: map_pool_changes diff --git a/substreams/ethereum-balancer-v2/Cargo.toml b/substreams/ethereum-balancer-v2/Cargo.toml index 5ab6dc7..c9ac915 100644 --- a/substreams/ethereum-balancer-v2/Cargo.toml +++ b/substreams/ethereum-balancer-v2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethereum-balancer-v2" -version = "0.2.4" +version = "0.2.5" edition = "2021" [lib] @@ -19,7 +19,7 @@ bytes = "1.5.0" anyhow = "1.0.75" num-bigint = "0.4.4" itertools = "0.12.0" -tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "b8aeaa3" } +tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "52d5021" } [build-dependencies] anyhow = "1" diff --git a/substreams/ethereum-balancer-v2/build.rs b/substreams/ethereum-balancer-v2/build.rs index 5e7bd34..c557d5b 100644 --- a/substreams/ethereum-balancer-v2/build.rs +++ b/substreams/ethereum-balancer-v2/build.rs @@ -26,10 +26,10 @@ fn main() -> Result<()> { let contract_name = file_name.split('.').next().unwrap(); - let input_path = format!("{}/{}", abi_folder, file_name); - let output_path = format!("{}/{}.rs", output_folder, contract_name); + let input_path = format!("{abi_folder}/{file_name}"); + let output_path = format!("{output_folder}/{contract_name}.rs"); - mod_rs_content.push_str(&format!("pub mod {};\n", contract_name)); + mod_rs_content.push_str(&format!("pub mod {contract_name};\n")); if std::path::Path::new(&output_path).exists() { continue; @@ -40,7 +40,7 @@ fn main() -> Result<()> { .write_to_file(&output_path)?; } - let mod_rs_path = format!("{}/mod.rs", output_folder); + let mod_rs_path = format!("{output_folder}/mod.rs"); let mut mod_rs_file = fs::File::create(mod_rs_path)?; mod_rs_file.write_all(mod_rs_content.as_bytes())?; diff --git a/substreams/ethereum-balancer-v2/src/pool_factories.rs b/substreams/ethereum-balancer-v2/src/pool_factories.rs index 9afd4b6..6d0b90c 100644 --- a/substreams/ethereum-balancer-v2/src/pool_factories.rs +++ b/substreams/ethereum-balancer-v2/src/pool_factories.rs @@ -60,24 +60,21 @@ pub fn address_map( let pool_registered = get_pool_registered(tx, &pool_created.pool); Some( - ProtocolComponent::new( - &format!("0x{}", hex::encode(pool_registered.pool_id)), - &(tx.into()), - ) - .with_contracts(&[pool_created.pool, VAULT_ADDRESS.to_vec()]) - .with_tokens(&create_call.tokens) - .with_attributes(&[ - ("pool_type", "WeightedPoolFactoryV1".as_bytes()), - ("normalized_weights", &json_serialize_bigint_list(&create_call.weights)), - ( - "fee", - &create_call - .swap_fee_percentage - .to_signed_bytes_be(), - ), - ("manual_updates", &[1u8]), - ]) - .as_swap_type("balancer_v2_pool", ImplementationType::Vm), + ProtocolComponent::new(&format!("0x{}", hex::encode(pool_registered.pool_id))) + .with_contracts(&[pool_created.pool, VAULT_ADDRESS.to_vec()]) + .with_tokens(&create_call.tokens) + .with_attributes(&[ + ("pool_type", "WeightedPoolFactoryV1".as_bytes()), + ("normalized_weights", &json_serialize_bigint_list(&create_call.weights)), + ( + "fee", + &create_call + .swap_fee_percentage + .to_signed_bytes_be(), + ), + ("manual_updates", &[1u8]), + ]) + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("cC508a455F5b0073973107Db6a878DdBDab957bC") => { @@ -88,28 +85,28 @@ pub fn address_map( let pool_registered = get_pool_registered(tx, &pool_created.pool); Some( - ProtocolComponent::new( - &format!("0x{}", hex::encode(pool_registered.pool_id)), - &(tx.into()), - ) - .with_contracts(&[pool_created.pool, VAULT_ADDRESS.to_vec()]) - .with_tokens(&create_call.tokens) - .with_attributes(&[ - ("pool_type", "WeightedPoolFactoryV2".as_bytes()), - ( - "normalized_weights", - &json_serialize_bigint_list(&create_call.normalized_weights), - ), - ("rate_providers", &json_serialize_address_list(&create_call.rate_providers)), - ( - "fee", - &create_call - .swap_fee_percentage - .to_signed_bytes_be(), - ), - ("manual_updates", &[1u8]), - ]) - .as_swap_type("balancer_v2_pool", ImplementationType::Vm), + ProtocolComponent::new(&format!("0x{}", hex::encode(pool_registered.pool_id))) + .with_contracts(&[pool_created.pool, VAULT_ADDRESS.to_vec()]) + .with_tokens(&create_call.tokens) + .with_attributes(&[ + ("pool_type", "WeightedPoolFactoryV2".as_bytes()), + ( + "normalized_weights", + &json_serialize_bigint_list(&create_call.normalized_weights), + ), + ( + "rate_providers", + &json_serialize_address_list(&create_call.rate_providers), + ), + ( + "fee", + &create_call + .swap_fee_percentage + .to_signed_bytes_be(), + ), + ("manual_updates", &[1u8]), + ]) + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("5Dd94Da3644DDD055fcf6B3E1aa310Bb7801EB8b") => { @@ -120,28 +117,28 @@ pub fn address_map( let pool_registered = get_pool_registered(tx, &pool_created.pool); Some( - ProtocolComponent::new( - &format!("0x{}", hex::encode(pool_registered.pool_id)), - &(tx.into()), - ) - .with_contracts(&[pool_created.pool, VAULT_ADDRESS.to_vec()]) - .with_tokens(&create_call.tokens) - .with_attributes(&[ - ("pool_type", "WeightedPoolFactoryV3".as_bytes()), - ( - "normalized_weights", - &json_serialize_bigint_list(&create_call.normalized_weights), - ), - ("rate_providers", &json_serialize_address_list(&create_call.rate_providers)), - ( - "fee", - &create_call - .swap_fee_percentage - .to_signed_bytes_be(), - ), - ("manual_updates", &[1u8]), - ]) - .as_swap_type("balancer_v2_pool", ImplementationType::Vm), + ProtocolComponent::new(&format!("0x{}", hex::encode(pool_registered.pool_id))) + .with_contracts(&[pool_created.pool, VAULT_ADDRESS.to_vec()]) + .with_tokens(&create_call.tokens) + .with_attributes(&[ + ("pool_type", "WeightedPoolFactoryV3".as_bytes()), + ( + "normalized_weights", + &json_serialize_bigint_list(&create_call.normalized_weights), + ), + ( + "rate_providers", + &json_serialize_address_list(&create_call.rate_providers), + ), + ( + "fee", + &create_call + .swap_fee_percentage + .to_signed_bytes_be(), + ), + ("manual_updates", &[1u8]), + ]) + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("897888115Ada5773E02aA29F775430BFB5F34c51") => { @@ -152,28 +149,28 @@ pub fn address_map( let pool_registered = get_pool_registered(tx, &pool_created.pool); Some( - ProtocolComponent::new( - &format!("0x{}", hex::encode(pool_registered.pool_id)), - &(tx.into()), - ) - .with_contracts(&[pool_created.pool, VAULT_ADDRESS.to_vec()]) - .with_tokens(&create_call.tokens) - .with_attributes(&[ - ("pool_type", "WeightedPoolFactoryV4".as_bytes()), - ( - "normalized_weights", - &json_serialize_bigint_list(&create_call.normalized_weights), - ), - ("rate_providers", &json_serialize_address_list(&create_call.rate_providers)), - ( - "fee", - &create_call - .swap_fee_percentage - .to_signed_bytes_be(), - ), - ("manual_updates", &[1u8]), - ]) - .as_swap_type("balancer_v2_pool", ImplementationType::Vm), + ProtocolComponent::new(&format!("0x{}", hex::encode(pool_registered.pool_id))) + .with_contracts(&[pool_created.pool, VAULT_ADDRESS.to_vec()]) + .with_tokens(&create_call.tokens) + .with_attributes(&[ + ("pool_type", "WeightedPoolFactoryV4".as_bytes()), + ( + "normalized_weights", + &json_serialize_bigint_list(&create_call.normalized_weights), + ), + ( + "rate_providers", + &json_serialize_address_list(&create_call.rate_providers), + ), + ( + "fee", + &create_call + .swap_fee_percentage + .to_signed_bytes_be(), + ), + ("manual_updates", &[1u8]), + ]) + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("DB8d758BCb971e482B2C45f7F8a7740283A1bd3A") => { @@ -185,25 +182,25 @@ pub fn address_map( let tokens_registered = get_token_registered(tx, &pool_registered.pool_id); Some( - ProtocolComponent::new( - &format!("0x{}", hex::encode(pool_registered.pool_id)), - &(tx.into()), - ) - .with_contracts(&[pool_created.pool.clone(), VAULT_ADDRESS.to_vec()]) - .with_tokens(&tokens_registered.tokens) - .with_attributes(&[ - ("pool_type", "ComposableStablePoolFactory".as_bytes()), - ("bpt", &pool_created.pool), - ( - "fee", - &create_call - .swap_fee_percentage - .to_signed_bytes_be(), - ), - ("rate_providers", &json_serialize_address_list(&create_call.rate_providers)), - ("manual_updates", &[1u8]), - ]) - .as_swap_type("balancer_v2_pool", ImplementationType::Vm), + ProtocolComponent::new(&format!("0x{}", hex::encode(pool_registered.pool_id))) + .with_contracts(&[pool_created.pool.clone(), VAULT_ADDRESS.to_vec()]) + .with_tokens(&tokens_registered.tokens) + .with_attributes(&[ + ("pool_type", "ComposableStablePoolFactory".as_bytes()), + ("bpt", &pool_created.pool), + ( + "fee", + &create_call + .swap_fee_percentage + .to_signed_bytes_be(), + ), + ( + "rate_providers", + &json_serialize_address_list(&create_call.rate_providers), + ), + ("manual_updates", &[1u8]), + ]) + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("813EE7a840CE909E7Fea2117A44a90b8063bd4fd") => { @@ -215,32 +212,29 @@ pub fn address_map( let tokens_registered = get_token_registered(tx, &pool_registered.pool_id); Some( - ProtocolComponent::new( - &format!("0x{}", hex::encode(pool_registered.pool_id)), - &(tx.into()), - ) - .with_contracts(&[pool_created.pool.clone(), VAULT_ADDRESS.to_vec()]) - .with_tokens(&tokens_registered.tokens) - .with_attributes(&[ - ("pool_type", "ERC4626LinearPoolFactory".as_bytes()), - ( - "upper_target", - &create_call - .upper_target - .to_signed_bytes_be(), - ), - ("manual_updates", &[1u8]), - ("bpt", &pool_created.pool), - ("main_token", &create_call.main_token), - ("wrapped_token", &create_call.wrapped_token), - ( - "fee", - &create_call - .swap_fee_percentage - .to_signed_bytes_be(), - ), - ]) - .as_swap_type("balancer_v2_pool", ImplementationType::Vm), + ProtocolComponent::new(&format!("0x{}", hex::encode(pool_registered.pool_id))) + .with_contracts(&[pool_created.pool.clone(), VAULT_ADDRESS.to_vec()]) + .with_tokens(&tokens_registered.tokens) + .with_attributes(&[ + ("pool_type", "ERC4626LinearPoolFactory".as_bytes()), + ( + "upper_target", + &create_call + .upper_target + .to_signed_bytes_be(), + ), + ("manual_updates", &[1u8]), + ("bpt", &pool_created.pool), + ("main_token", &create_call.main_token), + ("wrapped_token", &create_call.wrapped_token), + ( + "fee", + &create_call + .swap_fee_percentage + .to_signed_bytes_be(), + ), + ]) + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("5F43FBa61f63Fa6bFF101a0A0458cEA917f6B347") => { @@ -252,32 +246,29 @@ pub fn address_map( let tokens_registered = get_token_registered(tx, &pool_registered.pool_id); Some( - ProtocolComponent::new( - &format!("0x{}", hex::encode(pool_registered.pool_id)), - &(tx.into()), - ) - .with_contracts(&[pool_created.pool.clone(), VAULT_ADDRESS.to_vec()]) - .with_tokens(&tokens_registered.tokens) - .with_attributes(&[ - ("pool_type", "EulerLinearPoolFactory".as_bytes()), - ( - "upper_target", - &create_call - .upper_target - .to_signed_bytes_be(), - ), - ("manual_updates", &[1u8]), - ("bpt", &pool_created.pool), - ("main_token", &create_call.main_token), - ("wrapped_token", &create_call.wrapped_token), - ( - "fee", - &create_call - .swap_fee_percentage - .to_signed_bytes_be(), - ), - ]) - .as_swap_type("balancer_v2_pool", ImplementationType::Vm), + ProtocolComponent::new(&format!("0x{}", hex::encode(pool_registered.pool_id))) + .with_contracts(&[pool_created.pool.clone(), VAULT_ADDRESS.to_vec()]) + .with_tokens(&tokens_registered.tokens) + .with_attributes(&[ + ("pool_type", "EulerLinearPoolFactory".as_bytes()), + ( + "upper_target", + &create_call + .upper_target + .to_signed_bytes_be(), + ), + ("manual_updates", &[1u8]), + ("bpt", &pool_created.pool), + ("main_token", &create_call.main_token), + ("wrapped_token", &create_call.wrapped_token), + ( + "fee", + &create_call + .swap_fee_percentage + .to_signed_bytes_be(), + ), + ]) + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } // ❌ Reading the deployed factory for Gearbox showcases that it's currently disabled @@ -337,32 +328,29 @@ pub fn address_map( let tokens_registered = get_token_registered(tx, &pool_registered.pool_id); Some( - ProtocolComponent::new( - &format!("0x{}", hex::encode(pool_registered.pool_id)), - &(tx.into()), - ) - .with_contracts(&[pool_created.pool.clone(), VAULT_ADDRESS.to_vec()]) - .with_tokens(&tokens_registered.tokens) - .with_attributes(&[ - ("pool_type", "SiloLinearPoolFactory".as_bytes()), - ( - "upper_target", - &create_call - .upper_target - .to_signed_bytes_be(), - ), - ("manual_updates", &[1u8]), - ("bpt", &pool_created.pool), - ("main_token", &create_call.main_token), - ("wrapped_token", &create_call.wrapped_token), - ( - "fee", - &create_call - .swap_fee_percentage - .to_signed_bytes_be(), - ), - ]) - .as_swap_type("balancer_v2_pool", ImplementationType::Vm), + ProtocolComponent::new(&format!("0x{}", hex::encode(pool_registered.pool_id))) + .with_contracts(&[pool_created.pool.clone(), VAULT_ADDRESS.to_vec()]) + .with_tokens(&tokens_registered.tokens) + .with_attributes(&[ + ("pool_type", "SiloLinearPoolFactory".as_bytes()), + ( + "upper_target", + &create_call + .upper_target + .to_signed_bytes_be(), + ), + ("manual_updates", &[1u8]), + ("bpt", &pool_created.pool), + ("main_token", &create_call.main_token), + ("wrapped_token", &create_call.wrapped_token), + ( + "fee", + &create_call + .swap_fee_percentage + .to_signed_bytes_be(), + ), + ]) + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("5F5222Ffa40F2AEd6380D022184D6ea67C776eE0") => { @@ -374,32 +362,29 @@ pub fn address_map( let tokens_registered = get_token_registered(tx, &pool_registered.pool_id); Some( - ProtocolComponent::new( - &format!("0x{}", hex::encode(pool_registered.pool_id)), - &(tx.into()), - ) - .with_contracts(&[pool_created.pool.clone(), VAULT_ADDRESS.to_vec()]) - .with_tokens(&tokens_registered.tokens) - .with_attributes(&[ - ("pool_type", "YearnLinearPoolFactory".as_bytes()), - ( - "upper_target", - &create_call - .upper_target - .to_signed_bytes_be(), - ), - ("manual_updates", &[1u8]), - ("bpt", &pool_created.pool), - ("main_token", &create_call.main_token), - ("wrapped_token", &create_call.wrapped_token), - ( - "fee", - &create_call - .swap_fee_percentage - .to_signed_bytes_be(), - ), - ]) - .as_swap_type("balancer_v2_pool", ImplementationType::Vm), + ProtocolComponent::new(&format!("0x{}", hex::encode(pool_registered.pool_id))) + .with_contracts(&[pool_created.pool.clone(), VAULT_ADDRESS.to_vec()]) + .with_tokens(&tokens_registered.tokens) + .with_attributes(&[ + ("pool_type", "YearnLinearPoolFactory".as_bytes()), + ( + "upper_target", + &create_call + .upper_target + .to_signed_bytes_be(), + ), + ("manual_updates", &[1u8]), + ("bpt", &pool_created.pool), + ("main_token", &create_call.main_token), + ("wrapped_token", &create_call.wrapped_token), + ( + "fee", + &create_call + .swap_fee_percentage + .to_signed_bytes_be(), + ), + ]) + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } // The `WeightedPool2TokenFactory` is a deprecated contract, but we've included @@ -412,24 +397,21 @@ pub fn address_map( let pool_registered = get_pool_registered(tx, &pool_created.pool); Some( - ProtocolComponent::new( - &format!("0x{}", hex::encode(pool_registered.pool_id)), - &(tx.into()), - ) - .with_contracts(&[pool_created.pool, VAULT_ADDRESS.to_vec()]) - .with_tokens(&create_call.tokens) - .with_attributes(&[ - ("pool_type", "WeightedPool2TokensFactory".as_bytes()), - ("weights", &json_serialize_bigint_list(&create_call.weights)), - ( - "fee", - &create_call - .swap_fee_percentage - .to_signed_bytes_be(), - ), - ("manual_updates", &[1u8]), - ]) - .as_swap_type("balancer_v2_pool", ImplementationType::Vm), + ProtocolComponent::new(&format!("0x{}", hex::encode(pool_registered.pool_id))) + .with_contracts(&[pool_created.pool, VAULT_ADDRESS.to_vec()]) + .with_tokens(&create_call.tokens) + .with_attributes(&[ + ("pool_type", "WeightedPool2TokensFactory".as_bytes()), + ("weights", &json_serialize_bigint_list(&create_call.weights)), + ( + "fee", + &create_call + .swap_fee_percentage + .to_signed_bytes_be(), + ), + ("manual_updates", &[1u8]), + ]) + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } _ => None, diff --git a/substreams/ethereum-balancer-v2/substreams.yaml b/substreams/ethereum-balancer-v2/substreams.yaml index 03f9f42..aac9d0f 100644 --- a/substreams/ethereum-balancer-v2/substreams.yaml +++ b/substreams/ethereum-balancer-v2/substreams.yaml @@ -1,7 +1,7 @@ specVersion: v0.1.0 package: name: "ethereum_balancer_v2" - version: v0.2.4 + version: v0.2.5 protobuf: files: diff --git a/substreams/ethereum-curve/Cargo.toml b/substreams/ethereum-curve/Cargo.toml index 38a3d7c..fb2f827 100644 --- a/substreams/ethereum-curve/Cargo.toml +++ b/substreams/ethereum-curve/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethereum-curve" -version = "0.3.2" +version = "0.3.3" edition = "2021" [lib] @@ -18,7 +18,7 @@ hex = "0.4.3" bytes = "1.5.0" anyhow = "1.0.75" num-bigint = "0.4.4" -tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "b8aeaa3" } +tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "52d5021" } serde = { version = "1.0", features = ["derive"] } serde_qs = "0.13.0" itertools = "0.13.0" diff --git a/substreams/ethereum-curve/src/pool_factories.rs b/substreams/ethereum-curve/src/pool_factories.rs index 2c95976..f6b3e0e 100644 --- a/substreams/ethereum-curve/src/pool_factories.rs +++ b/substreams/ethereum-curve/src/pool_factories.rs @@ -100,12 +100,6 @@ pub fn address_map( Some(( ProtocolComponent { id: hex::encode(component_id), - tx: Some(Transaction { - to: tx.to.clone(), - from: tx.from.clone(), - hash: tx.hash.clone(), - index: tx.index.into(), - }), tokens: tokens.clone(), contracts: vec![ component_id.into(), @@ -218,12 +212,6 @@ pub fn address_map( Some(( ProtocolComponent { id: hex::encode(component_id), - tx: Some(Transaction { - to: tx.to.clone(), - from: tx.from.clone(), - hash: tx.hash.clone(), - index: tx.index.into(), - }), tokens: tokens.clone(), contracts: vec![component_id.into()], static_att: vec![ @@ -465,12 +453,6 @@ pub fn address_map( Some(( ProtocolComponent { id: hex::encode(component_id), - tx: Some(Transaction { - to: tx.to.clone(), - from: tx.from.clone(), - hash: tx.hash.clone(), - index: tx.index.into(), - }), tokens: pool_added.coins.clone(), contracts: vec![component_id.into(), CRYPTO_SWAP_NG_FACTORY.into()], static_att: vec![ @@ -538,12 +520,6 @@ pub fn address_map( Some(( ProtocolComponent { id: hex::encode(component_id), - tx: Some(Transaction { - to: tx.to.clone(), - from: tx.from.clone(), - hash: tx.hash.clone(), - index: tx.index.into(), - }), tokens: vec![pool_added.coin.clone(), lp_token.clone()], contracts: vec![ component_id.into(), @@ -637,12 +613,6 @@ pub fn address_map( Some(( ProtocolComponent { id: id.clone(), - tx: Some(Transaction { - to: tx.to.clone(), - from: tx.from.clone(), - hash: tx.hash.clone(), - index: tx.index.into(), - }), tokens: tokens.clone(), contracts: vec![pool_added.pool, TRICRYPTO_FACTORY.into()], static_att: vec![ @@ -758,12 +728,6 @@ pub fn address_map( Some(( ProtocolComponent { id: hex::encode(component_id), - tx: Some(Transaction { - to: tx.to.clone(), - from: tx.from.clone(), - hash: tx.hash.clone(), - index: tx.index.into(), - }), tokens: tokens.clone(), contracts: vec![component_id.into()], static_att: vec![ @@ -903,12 +867,6 @@ pub fn address_map( Some(( ProtocolComponent { id: id.clone(), - tx: Some(Transaction { - to: tx.to.clone(), - from: tx.from.clone(), - hash: tx.hash.clone(), - index: tx.index.into(), - }), tokens: pool_added.coins.clone().into(), contracts: vec![pool_added.pool, TWOCRYPTO_FACTORY.into()], static_att: vec![ diff --git a/substreams/ethereum-curve/src/pools.rs b/substreams/ethereum-curve/src/pools.rs index 65573d2..5b092e2 100644 --- a/substreams/ethereum-curve/src/pools.rs +++ b/substreams/ethereum-curve/src/pools.rs @@ -48,12 +48,6 @@ fn create_component( Ok(Some(( ProtocolComponent { id: pool.address.clone(), - tx: Some(Transaction { - to: tx.to.clone(), - from: tx.from.clone(), - hash: tx.hash.clone(), - index: tx.index.into(), - }), tokens: pool .tokens .clone() diff --git a/substreams/ethereum-curve/substreams.yaml b/substreams/ethereum-curve/substreams.yaml index e802d07..a447840 100644 --- a/substreams/ethereum-curve/substreams.yaml +++ b/substreams/ethereum-curve/substreams.yaml @@ -1,7 +1,7 @@ specVersion: v0.1.0 package: name: "substreams_curve" - version: v0.3.2 + version: v0.3.3 protobuf: files: diff --git a/substreams/ethereum-sfrax/Cargo.toml b/substreams/ethereum-sfrax/Cargo.toml index c795f51..b660ab9 100644 --- a/substreams/ethereum-sfrax/Cargo.toml +++ b/substreams/ethereum-sfrax/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethereum-sfrax" -version = "0.1.1" +version = "0.1.2" edition = "2021" [lib] @@ -17,7 +17,7 @@ prost-types = "0.11" substreams = "0.5.22" substreams-ethereum = "0.9.9" hex = "0.4.3" -tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "b8aeaa3" } +tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "52d5021" } itertools = "0.12.0" anyhow = "1.0.75" diff --git a/substreams/ethereum-sfrax/src/modules.rs b/substreams/ethereum-sfrax/src/modules.rs index a2427b9..f02ebf3 100644 --- a/substreams/ethereum-sfrax/src/modules.rs +++ b/substreams/ethereum-sfrax/src/modules.rs @@ -35,7 +35,7 @@ pub fn map_components( // a log.address = vault_address is the deployment tx if is_deployment_tx(tx, &vault_address) { Some( - ProtocolComponent::at_contract(&vault_address, &tx.into()) + ProtocolComponent::at_contract(&vault_address) .with_tokens(&[ locked_asset.as_slice(), vault_address.as_slice(), diff --git a/substreams/ethereum-sfrax/substreams.yaml b/substreams/ethereum-sfrax/substreams.yaml index c5eb7a2..f7caa2f 100644 --- a/substreams/ethereum-sfrax/substreams.yaml +++ b/substreams/ethereum-sfrax/substreams.yaml @@ -1,7 +1,7 @@ specVersion: v0.1.0 package: name: "ethereum_sfrax" - version: v0.1.0 + version: v0.1.2 protobuf: files: diff --git a/substreams/ethereum-sfraxeth/Cargo.toml b/substreams/ethereum-sfraxeth/Cargo.toml index bd2e158..1206e7e 100644 --- a/substreams/ethereum-sfraxeth/Cargo.toml +++ b/substreams/ethereum-sfraxeth/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethereum-sfraxeth" -version = "0.1.0" +version = "0.1.1" edition = "2021" [lib] @@ -17,7 +17,7 @@ prost-types = "0.11" substreams = "0.5.22" substreams-ethereum = "0.9.9" hex = "0.4.3" -tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "b8aeaa3" } +tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "52d5021" } itertools = "0.12.0" anyhow = "1.0.75" diff --git a/substreams/ethereum-sfraxeth/src/modules.rs b/substreams/ethereum-sfraxeth/src/modules.rs index dee48c0..8940b2a 100644 --- a/substreams/ethereum-sfraxeth/src/modules.rs +++ b/substreams/ethereum-sfraxeth/src/modules.rs @@ -38,7 +38,7 @@ pub fn map_components( // a log.address = vault_address is the deployment tx if is_deployment_tx(tx, &vault_address) { Some( - ProtocolComponent::at_contract(&vault_address, &tx.into()) + ProtocolComponent::at_contract(&vault_address) .with_tokens(&[ locked_asset.as_slice(), vault_address.as_slice(), @@ -120,7 +120,7 @@ pub fn store_reward_cycles(block_reward_cycles: BlockRewardCycles, store: StoreS let address_hex = format!("0x{}", hex::encode(&reward_cycle.vault_address)); store.set( reward_cycle.ord, - format!("reward_cycle:{}", address_hex), + format!("reward_cycle:{address_hex}"), &reward_cycle.next_reward_amount, ); }); @@ -144,7 +144,7 @@ pub fn map_relative_balances( let address_hex = format!("0x{}", hex::encode(address_bytes_be)); if store - .get_last(format!("pool:{}", address_hex)) + .get_last(format!("pool:{address_hex}")) .is_some() { substreams::log::info!( @@ -177,7 +177,7 @@ pub fn map_relative_balances( let address_bytes_be = vault_log.address(); let address_hex = format!("0x{}", hex::encode(address_bytes_be)); if store - .get_last(format!("pool:{}", address_hex)) + .get_last(format!("pool:{address_hex}")) .is_some() { deltas.extend_from_slice(&[ @@ -206,7 +206,7 @@ pub fn map_relative_balances( let address_bytes_be = vault_log.address(); let address_hex = format!("0x{}", hex::encode(address_bytes_be)); if store - .get_last(format!("pool:{}", address_hex)) + .get_last(format!("pool:{address_hex}")) .is_some() { // When the NextRewardsCycle event is emitted: @@ -221,7 +221,7 @@ pub fn map_relative_balances( if let Some(last_reward_amount) = reward_store .deltas .iter() - .find(|el| el.key == format!("reward_cycle:{}", address_hex)) + .find(|el| el.key == format!("reward_cycle:{address_hex}")) .map(|el| el.old_value.clone()) { substreams::log::info!( diff --git a/substreams/ethereum-sfraxeth/substreams.yaml b/substreams/ethereum-sfraxeth/substreams.yaml index 2341247..18234d5 100644 --- a/substreams/ethereum-sfraxeth/substreams.yaml +++ b/substreams/ethereum-sfraxeth/substreams.yaml @@ -1,7 +1,7 @@ specVersion: v0.1.0 package: name: "ethereum_sfraxeth" - version: v0.1.0 + version: v0.1.1 protobuf: files: @@ -88,4 +88,4 @@ modules: type: proto:tycho.evm.v1.BlockChanges params: - map_components: "ac3E018457B222d93114458476f3E3416Abbe38F" \ No newline at end of file + map_components: "ac3E018457B222d93114458476f3E3416Abbe38F" diff --git a/substreams/ethereum-template-factory/Cargo.toml b/substreams/ethereum-template-factory/Cargo.toml index 9d4f94a..15b6593 100644 --- a/substreams/ethereum-template-factory/Cargo.toml +++ b/substreams/ethereum-template-factory/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] substreams = "0.5.22" substreams-ethereum = "0.9.9" prost = "0.11" -tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "3c08359" } +tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "52d5021" } anyhow = "1.0.95" ethabi = "18.0.0" num-bigint = "0.4.6" diff --git a/substreams/ethereum-template-factory/build.rs b/substreams/ethereum-template-factory/build.rs index 5e7bd34..c557d5b 100644 --- a/substreams/ethereum-template-factory/build.rs +++ b/substreams/ethereum-template-factory/build.rs @@ -26,10 +26,10 @@ fn main() -> Result<()> { let contract_name = file_name.split('.').next().unwrap(); - let input_path = format!("{}/{}", abi_folder, file_name); - let output_path = format!("{}/{}.rs", output_folder, contract_name); + let input_path = format!("{abi_folder}/{file_name}"); + let output_path = format!("{output_folder}/{contract_name}.rs"); - mod_rs_content.push_str(&format!("pub mod {};\n", contract_name)); + mod_rs_content.push_str(&format!("pub mod {contract_name};\n")); if std::path::Path::new(&output_path).exists() { continue; @@ -40,7 +40,7 @@ fn main() -> Result<()> { .write_to_file(&output_path)?; } - let mod_rs_path = format!("{}/mod.rs", output_folder); + let mod_rs_path = format!("{output_folder}/mod.rs"); let mut mod_rs_file = fs::File::create(mod_rs_path)?; mod_rs_file.write_all(mod_rs_content.as_bytes())?; diff --git a/substreams/ethereum-template-singleton/Cargo.toml b/substreams/ethereum-template-singleton/Cargo.toml index 93537f1..06d2b2e 100644 --- a/substreams/ethereum-template-singleton/Cargo.toml +++ b/substreams/ethereum-template-singleton/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] substreams = "0.5.22" substreams-ethereum = "0.9.9" prost = "0.11" -tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "3c08359" } +tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "52d5021" } anyhow = "1.0.95" ethabi = "18.0.0" num-bigint = "0.4.6" diff --git a/substreams/ethereum-template-singleton/build.rs b/substreams/ethereum-template-singleton/build.rs index 5e7bd34..c557d5b 100644 --- a/substreams/ethereum-template-singleton/build.rs +++ b/substreams/ethereum-template-singleton/build.rs @@ -26,10 +26,10 @@ fn main() -> Result<()> { let contract_name = file_name.split('.').next().unwrap(); - let input_path = format!("{}/{}", abi_folder, file_name); - let output_path = format!("{}/{}.rs", output_folder, contract_name); + let input_path = format!("{abi_folder}/{file_name}"); + let output_path = format!("{output_folder}/{contract_name}.rs"); - mod_rs_content.push_str(&format!("pub mod {};\n", contract_name)); + mod_rs_content.push_str(&format!("pub mod {contract_name};\n")); if std::path::Path::new(&output_path).exists() { continue; @@ -40,7 +40,7 @@ fn main() -> Result<()> { .write_to_file(&output_path)?; } - let mod_rs_path = format!("{}/mod.rs", output_folder); + let mod_rs_path = format!("{output_folder}/mod.rs"); let mut mod_rs_file = fs::File::create(mod_rs_path)?; mod_rs_file.write_all(mod_rs_content.as_bytes())?;