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>
This commit is contained in:
Zizou
2025-05-14 10:57:22 +02:00
committed by GitHub
parent 1442215c91
commit e8bde64a23
22 changed files with 296 additions and 361 deletions

94
substreams/Cargo.lock generated
View File

@@ -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",

View File

@@ -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"

View File

@@ -47,6 +47,7 @@ impl From<InterimContractChange> for ContractChange {
.map(|(slot, value)| ContractSlot { slot, value: value.new_value })
.collect(),
change: value.change.into(),
token_balances: Vec::new(),
}
}
}

View File

@@ -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

View File

@@ -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"

View File

@@ -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())?;

View File

@@ -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,

View File

@@ -1,7 +1,7 @@
specVersion: v0.1.0
package:
name: "ethereum_balancer_v2"
version: v0.2.4
version: v0.2.5
protobuf:
files:

View File

@@ -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"

View File

@@ -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![

View File

@@ -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()

View File

@@ -1,7 +1,7 @@
specVersion: v0.1.0
package:
name: "substreams_curve"
version: v0.3.2
version: v0.3.3
protobuf:
files:

View File

@@ -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"

View File

@@ -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(),

View File

@@ -1,7 +1,7 @@
specVersion: v0.1.0
package:
name: "ethereum_sfrax"
version: v0.1.0
version: v0.1.2
protobuf:
files:

View File

@@ -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"

View File

@@ -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!(

View File

@@ -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"
map_components: "ac3E018457B222d93114458476f3E3416Abbe38F"

View File

@@ -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"

View File

@@ -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())?;

View File

@@ -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"

View File

@@ -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())?;