From 637f86efb046eee4686689de64ab379a26a95841 Mon Sep 17 00:00:00 2001 From: Mike Casale <46603283+mikewcasale@users.noreply.github.com> Date: Tue, 23 Jan 2024 03:33:14 -0800 Subject: [PATCH 1/2] Fixes an issue whereby StrategyCreated events by Carbon were not properly handled - Carbon cid values are provided by the contract and are int types, whereas all other exchange cid values are generated by hashing the descr (exchange tkn1/tkn2 fee) info. - This fix ensures that the types and values of carbon cid's are preserved --- fastlane_bot/events/async_event_update_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastlane_bot/events/async_event_update_utils.py b/fastlane_bot/events/async_event_update_utils.py index ff1784624..a2c734f34 100644 --- a/fastlane_bot/events/async_event_update_utils.py +++ b/fastlane_bot/events/async_event_update_utils.py @@ -474,6 +474,8 @@ def async_update_pools_from_contracts(mgr: Any, current_block: int, logging_path # Initialize web3 new_pool_data_df["cid"] = [ cfg.w3.keccak(text=f"{row['descr']}").hex() + if row["exchange_name"] != "carbon_v1" + else int(row['cid']) for index, row in new_pool_data_df.iterrows() ] From bc9305b3cb032efe9424e2591e959690d99f9682 Mon Sep 17 00:00:00 2001 From: Mike Casale <46603283+mikewcasale@users.noreply.github.com> Date: Tue, 23 Jan 2024 05:58:54 -0800 Subject: [PATCH 2/2] Update async_event_update_utils.py --- fastlane_bot/events/async_event_update_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane_bot/events/async_event_update_utils.py b/fastlane_bot/events/async_event_update_utils.py index a2c734f34..9785b32a1 100644 --- a/fastlane_bot/events/async_event_update_utils.py +++ b/fastlane_bot/events/async_event_update_utils.py @@ -474,7 +474,7 @@ def async_update_pools_from_contracts(mgr: Any, current_block: int, logging_path # Initialize web3 new_pool_data_df["cid"] = [ cfg.w3.keccak(text=f"{row['descr']}").hex() - if row["exchange_name"] != "carbon_v1" + if row["exchange_name"] not in mgr.cfg.CARBON_V1_FORKS else int(row['cid']) for index, row in new_pool_data_df.iterrows() ]