web3-wizzard-lib 0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- core/__init__.py +1 -0
- core/contract/__init__.py +0 -0
- core/contract/aavecontract.py +36 -0
- core/contract/alienswap_contract.py +21 -0
- core/contract/arena_games_contract.py +16 -0
- core/contract/basiliskcontract.py +58 -0
- core/contract/bilinear_contract.py +22 -0
- core/contract/bungee.py +33 -0
- core/contract/coredao_contract.py +35 -0
- core/contract/coredao_from_contract.py +40 -0
- core/contract/dmail_send_mail.py +18 -0
- core/contract/empty_nft.py +18 -0
- core/contract/era_name.py +23 -0
- core/contract/eralendcontract.py +34 -0
- core/contract/eth_scroll_bridge_contract.py +25 -0
- core/contract/frog_war_contract.py +48 -0
- core/contract/horizondex_quoter.py +14 -0
- core/contract/horizondex_router.py +91 -0
- core/contract/imagine_contract.py +18 -0
- core/contract/izumi.py +63 -0
- core/contract/kreatorland_contract.py +21 -0
- core/contract/l0_claim.py +254 -0
- core/contract/l2_telegraph.py +21 -0
- core/contract/layerbank_price.py +18 -0
- core/contract/layerbank_token.py +29 -0
- core/contract/layerbankcontract.py +59 -0
- core/contract/linea_day_2_contract.py +19 -0
- core/contract/linea_day_3_contract.py +55 -0
- core/contract/linea_ens_names_contract.py +55 -0
- core/contract/lineaswaprouter.py +52 -0
- core/contract/maverick_multicall.py +52 -0
- core/contract/mendi_finance_contract.py +11 -0
- core/contract/mendi_token.py +25 -0
- core/contract/merkly_minter.py +47 -0
- core/contract/micro3_contract.py +18 -0
- core/contract/mute_router.py +93 -0
- core/contract/nidum_contract.py +44 -0
- core/contract/nile_contract.py +60 -0
- core/contract/nomis_attest_contract.py +40 -0
- core/contract/nomis_contract.py +40 -0
- core/contract/octomos.py +31 -0
- core/contract/odos.py +104 -0
- core/contract/omnisea.py +29 -0
- core/contract/orbiter_starknet.py +30 -0
- core/contract/pancake_pool.py +19 -0
- core/contract/pancake_quoter.py +20 -0
- core/contract/pancake_router.py +72 -0
- core/contract/rage_claim.py +24 -0
- core/contract/reactor_fusion_contract.py +78 -0
- core/contract/readon_contract.py +19 -0
- core/contract/rubyscore_contract.py +31 -0
- core/contract/satoshi_universe_contract.py +29 -0
- core/contract/scroll_bridge_contract.py +24 -0
- core/contract/scroll_canvas_mint_contract.py +26 -0
- core/contract/scroll_oracle.py +11 -0
- core/contract/snap_contract.py +16 -0
- core/contract/social_scan_contract.py +20 -0
- core/contract/stargate_farming.py +37 -0
- core/contract/stargate_router.py +84 -0
- core/contract/stargate_router_eth.py +41 -0
- core/contract/stargate_token_pool.py +46 -0
- core/contract/stargate_v2_contract.py +36 -0
- core/contract/syncswap_classic_pool.py +15 -0
- core/contract/syncswap_classic_pool_factory.py +15 -0
- core/contract/syncswap_pool.py +25 -0
- core/contract/syncswap_router.py +123 -0
- core/contract/tavaera_id.py +18 -0
- core/contract/tavaera_mint.py +17 -0
- core/contract/townstory_bonus_contract.py +19 -0
- core/contract/townstory_contract.py +21 -0
- core/contract/velocore_lens.py +44 -0
- core/contract/velocore_pool.py +198 -0
- core/contract/velocore_router.py +80 -0
- core/contract/woofi_swap.py +29 -0
- core/contract/xy_finance_contract.py +87 -0
- core/contract/yoddlo_contract.py +19 -0
- core/contract/yuliverse_contract.py +36 -0
- core/contract/zebra_contract.py +68 -0
- core/contract/zerolend_contract.py +34 -0
- core/contract/zerolend_liq_contract.py +20 -0
- core/contract/zkdx_contract.py +40 -0
- core/contract/zkdx_data.py +14 -0
- core/contract/zks.py +24 -0
- core/modules/__init__.py +0 -0
- core/modules/ads_import_proxy.py +52 -0
- core/modules/airdrop_printer.py +80 -0
- core/modules/bank/__init__.py +0 -0
- core/modules/bank/aave.py +25 -0
- core/modules/bank/bank.py +15 -0
- core/modules/bank/bank_module.py +99 -0
- core/modules/bank/basilisk.py +25 -0
- core/modules/bank/eralend.py +25 -0
- core/modules/bank/layerbank.py +116 -0
- core/modules/bank/mendi_finance.py +57 -0
- core/modules/bank/reactorfusion.py +25 -0
- core/modules/bank/zerolend.py +36 -0
- core/modules/bridge/__init__.py +0 -0
- core/modules/bridge/bridge.py +8 -0
- core/modules/bridge/coredao_bridge_sub.py +47 -0
- core/modules/bridge/orbiter_sub.py +112 -0
- core/modules/bridge/scroll_bridge_sub.py +42 -0
- core/modules/bridge/stargate_v2_sub.py +74 -0
- core/modules/bridge_module.py +47 -0
- core/modules/bungee.py +109 -0
- core/modules/cex_sender.py +60 -0
- core/modules/cex_subaccount_transfer.py +34 -0
- core/modules/cex_withdraw.py +91 -0
- core/modules/claimer.py +45 -0
- core/modules/claims/__init__.py +0 -0
- core/modules/claims/layerzero_claimer.py +64 -0
- core/modules/claims/rabby_claimer.py +81 -0
- core/modules/concrete_swap.py +97 -0
- core/modules/coredao_bridge.py +32 -0
- core/modules/coredao_bridge_auto.py +39 -0
- core/modules/debank_checker.py +90 -0
- core/modules/dmail.py +54 -0
- core/modules/erc20_balance.py +42 -0
- core/modules/intract/__init__.py +0 -0
- core/modules/intract/intract_api.py +212 -0
- core/modules/intract/utils.py +81 -0
- core/modules/intract_claim.py +104 -0
- core/modules/layer_2_20.py +65 -0
- core/modules/lending_module.py +134 -0
- core/modules/linea_appeal.py +70 -0
- core/modules/linea_poh_lxp.py +64 -0
- core/modules/liquidity/__init__.py +0 -0
- core/modules/liquidity/nile_pool.py +64 -0
- core/modules/liquidity/pool.py +16 -0
- core/modules/liquidity/syncswap_pool.py +61 -0
- core/modules/liquidity/velocore_pool.py +55 -0
- core/modules/liquidity/zerolend_liquidity.py +26 -0
- core/modules/liquidity_pool.py +60 -0
- core/modules/merkly_refuel.py +87 -0
- core/modules/modules.py +4 -0
- core/modules/nft/__init__.py +0 -0
- core/modules/nft/abbys_world.py +22 -0
- core/modules/nft/acg_worlds.py +25 -0
- core/modules/nft/alienswap_linea.py +22 -0
- core/modules/nft/arena_games.py +22 -0
- core/modules/nft/asmatch.py +22 -0
- core/modules/nft/battlemon.py +25 -0
- core/modules/nft/bilinear.py +22 -0
- core/modules/nft/bitavatar.py +25 -0
- core/modules/nft/culture_satoshi_universe.py +24 -0
- core/modules/nft/efrogs.py +26 -0
- core/modules/nft/empty_nft.py +22 -0
- core/modules/nft/era_domain.py +42 -0
- core/modules/nft/frog_war.py +22 -0
- core/modules/nft/frog_war_bonus.py +22 -0
- core/modules/nft/gamerboom.py +25 -0
- core/modules/nft/gamerboom_bonus.py +26 -0
- core/modules/nft/imagine.py +32 -0
- core/modules/nft/kreatorland_module.py +35 -0
- core/modules/nft/l2_telegraph_module.py +22 -0
- core/modules/nft/layer3_meta.py +25 -0
- core/modules/nft/linea_culture_2_2_linus.py +24 -0
- core/modules/nft/linea_culture_2_3_yooldo.py +24 -0
- core/modules/nft/linea_culture_2_4_frogwar.py +24 -0
- core/modules/nft/linea_culture_2_5_acg.py +25 -0
- core/modules/nft/linea_culture_2_6_ascend_the_end.py +25 -0
- core/modules/nft/linea_culture_3_1_ascend_the_end.py +25 -0
- core/modules/nft/linea_culture_3_2_sending_me.py +25 -0
- core/modules/nft/linea_culture_3_3_townstory.py +25 -0
- core/modules/nft/linea_culture_3_4_daniele.py +25 -0
- core/modules/nft/linea_culture_3_5_demmortal.py +25 -0
- core/modules/nft/linea_culture_3_6_foxy.py +25 -0
- core/modules/nft/linea_culture_4_1_coop_records.py +60 -0
- core/modules/nft/linea_culture_4_2_borja_moskv.py +65 -0
- core/modules/nft/linea_culture_4_2_borja_moskv_approve.py +27 -0
- core/modules/nft/linea_culture_4_3_fruit.py +66 -0
- core/modules/nft/linea_culture_4_4_fruit_crux.py +67 -0
- core/modules/nft/linea_culture_4_5_forbidden_fruit.py +67 -0
- core/modules/nft/linea_culture_4_6_laurent.py +67 -0
- core/modules/nft/linea_culture_day2.py +20 -0
- core/modules/nft/linea_culture_day3.py +20 -0
- core/modules/nft/linea_ens_names.py +107 -0
- core/modules/nft/lucky_cat.py +25 -0
- core/modules/nft/merkly_minter_module.py +22 -0
- core/modules/nft/micro3.py +23 -0
- core/modules/nft/mint_2048.py +28 -0
- core/modules/nft/nft_submodule.py +16 -0
- core/modules/nft/nidum.py +87 -0
- core/modules/nft/nidum_bonus.py +23 -0
- core/modules/nft/nomis.py +64 -0
- core/modules/nft/nomis_attest.py +66 -0
- core/modules/nft/nouns.py +27 -0
- core/modules/nft/octomos.py +32 -0
- core/modules/nft/omnisea.py +33 -0
- core/modules/nft/omnizone.py +25 -0
- core/modules/nft/orbiter_claim.py +87 -0
- core/modules/nft/readon.py +30 -0
- core/modules/nft/rubyscore.py +45 -0
- core/modules/nft/sarubol.py +22 -0
- core/modules/nft/satoshi_universe.py +22 -0
- core/modules/nft/scroll_canvas_attest_year_badge.py +35 -0
- core/modules/nft/scroll_canvas_mint.py +51 -0
- core/modules/nft/sign.py +32 -0
- core/modules/nft/snap.py +25 -0
- core/modules/nft/snap_bonus.py +31 -0
- core/modules/nft/social_scan.py +22 -0
- core/modules/nft/sub_module.py +8 -0
- core/modules/nft/tavaera.py +30 -0
- core/modules/nft/townstory.py +75 -0
- core/modules/nft/townstory_bonus.py +45 -0
- core/modules/nft/trusta_reputation.py +48 -0
- core/modules/nft/trustaa_poh.py +49 -0
- core/modules/nft/uber_poh.py +24 -0
- core/modules/nft/wizards_of_linea.py +26 -0
- core/modules/nft/yoddlo.py +22 -0
- core/modules/nft/yuliverse.py +22 -0
- core/modules/nft/zace.py +25 -0
- core/modules/nft/zks_domain.py +41 -0
- core/modules/nft_minter.py +107 -0
- core/modules/orbiter.py +39 -0
- core/modules/orbiter_checker.py +26 -0
- core/modules/rage.py +54 -0
- core/modules/scroll_bridge.py +45 -0
- core/modules/sell_all.py +51 -0
- core/modules/sleep_module.py +25 -0
- core/modules/smart_contract_deployment.py +37 -0
- core/modules/stargate/__init__.py +0 -0
- core/modules/stargate/auto_bridge.py +91 -0
- core/modules/stargate/bridge.py +38 -0
- core/modules/stargate/bridge_eth.py +59 -0
- core/modules/stargate/bridge_tokens.py +48 -0
- core/modules/stargate/classic_bridge.py +34 -0
- core/modules/stargate/farming.py +163 -0
- core/modules/stargate/l0_data.py +10 -0
- core/modules/stargate/pool.py +74 -0
- core/modules/stargate/stargate_balance_utils.py +25 -0
- core/modules/stargate/stargate_gas_checker.py +68 -0
- core/modules/swap/__init__.py +1 -0
- core/modules/swap/horizondex.py +38 -0
- core/modules/swap/izumi.py +41 -0
- core/modules/swap/lineaswap.py +34 -0
- core/modules/swap/maverick.py +66 -0
- core/modules/swap/mute.py +39 -0
- core/modules/swap/odos.py +58 -0
- core/modules/swap/one_inch.py +58 -0
- core/modules/swap/pancake.py +41 -0
- core/modules/swap/swap_facade.py +10 -0
- core/modules/swap/syncswap.py +62 -0
- core/modules/swap/velocore.py +40 -0
- core/modules/swap/woofi.py +38 -0
- core/modules/swap/xy_finance.py +43 -0
- core/modules/swap/zebra.py +32 -0
- core/modules/warm_up.py +98 -0
- core/modules/wrapping.py +74 -0
- core/modules/zkdx.py +63 -0
- data/__init__.py +0 -0
- data/config_default.py +52 -0
- data/module_config_default.py +209 -0
- tests/__init__.py +0 -0
- tests/core/__init__.py +0 -0
- tests/core/contracts/__init__.py +0 -0
- tests/core/contracts/test_horizondex_quoter.py +37 -0
- tests/core/contracts/test_uniswap_quoter.py +35 -0
- tests/core/contracts/test_velocore_lens.py +67 -0
- tests/core/contracts/test_velocore_pool.py +57 -0
- tests/core/modules/__init__.py +67 -0
- tests/core/modules/swap/__init__.py +0 -0
- tests/core/modules/swap/test_horizondex.py +37 -0
- tests/core/modules/swap/test_lineaswap.py +28 -0
- tests/core/modules/swap/test_maverick.py +31 -0
- tests/core/modules/swap/test_mute.py +29 -0
- tests/core/modules/swap/test_odos.py +36 -0
- tests/core/modules/swap/test_pancake.py +54 -0
- tests/core/modules/swap/test_syncswap.py +59 -0
- tests/core/modules/swap/test_velocore.py +33 -0
- tests/core/modules/swap/test_woofi.py +22 -0
- tests/core/modules/test_bungee.py +27 -0
- tests/core/modules/test_concrete_swap.py +62 -0
- tests/core/modules/test_dmail.py +41 -0
- tests/core/modules/test_lending.py +122 -0
- tests/core/modules/test_nft.py +32 -0
- tests/core/modules/test_nft_minter.py +30 -0
- tests/core/modules/test_orbiter.py +28 -0
- tests/core/modules/test_sellall.py +27 -0
- tests/core/modules/test_send_to_cex.py +27 -0
- tests/core/modules/test_stargate_auto_bridge.py +32 -0
- tests/core/modules/test_stargate_bridge.py +25 -0
- tests/core/modules/test_stargate_farming.py +108 -0
- tests/core/modules/test_warmup.py +78 -0
- tests/core/modules/test_wrapping.py +68 -0
- tests/core/scenario/__init__.py +0 -0
- tests/core/scenario/module_0_test_config.py +91 -0
- tests/core/test_app.py +19 -0
- tests/core/test_config.py +34 -0
- web3_wizzard_lib/__init__.py +0 -0
- web3_wizzard_lib/core/__init__.py +1 -0
- web3_wizzard_lib/core/contract/__init__.py +0 -0
- web3_wizzard_lib/core/contract/aavecontract.py +36 -0
- web3_wizzard_lib/core/contract/alienswap_contract.py +21 -0
- web3_wizzard_lib/core/contract/arena_games_contract.py +16 -0
- web3_wizzard_lib/core/contract/basiliskcontract.py +58 -0
- web3_wizzard_lib/core/contract/bilinear_contract.py +22 -0
- web3_wizzard_lib/core/contract/bungee.py +33 -0
- web3_wizzard_lib/core/contract/coredao_contract.py +35 -0
- web3_wizzard_lib/core/contract/coredao_from_contract.py +40 -0
- web3_wizzard_lib/core/contract/dmail_send_mail.py +18 -0
- web3_wizzard_lib/core/contract/empty_nft.py +18 -0
- web3_wizzard_lib/core/contract/era_name.py +23 -0
- web3_wizzard_lib/core/contract/eralendcontract.py +34 -0
- web3_wizzard_lib/core/contract/eth_scroll_bridge_contract.py +25 -0
- web3_wizzard_lib/core/contract/frog_war_contract.py +48 -0
- web3_wizzard_lib/core/contract/horizondex_quoter.py +14 -0
- web3_wizzard_lib/core/contract/horizondex_router.py +91 -0
- web3_wizzard_lib/core/contract/imagine_contract.py +18 -0
- web3_wizzard_lib/core/contract/izumi.py +63 -0
- web3_wizzard_lib/core/contract/kreatorland_contract.py +21 -0
- web3_wizzard_lib/core/contract/l0_claim.py +254 -0
- web3_wizzard_lib/core/contract/l2_telegraph.py +21 -0
- web3_wizzard_lib/core/contract/layerbank_price.py +18 -0
- web3_wizzard_lib/core/contract/layerbank_token.py +29 -0
- web3_wizzard_lib/core/contract/layerbankcontract.py +59 -0
- web3_wizzard_lib/core/contract/linea_day_2_contract.py +19 -0
- web3_wizzard_lib/core/contract/linea_day_3_contract.py +55 -0
- web3_wizzard_lib/core/contract/linea_ens_names_contract.py +55 -0
- web3_wizzard_lib/core/contract/lineaswaprouter.py +52 -0
- web3_wizzard_lib/core/contract/maverick_multicall.py +52 -0
- web3_wizzard_lib/core/contract/mendi_finance_contract.py +11 -0
- web3_wizzard_lib/core/contract/mendi_token.py +25 -0
- web3_wizzard_lib/core/contract/merkly_minter.py +47 -0
- web3_wizzard_lib/core/contract/micro3_contract.py +18 -0
- web3_wizzard_lib/core/contract/mute_router.py +93 -0
- web3_wizzard_lib/core/contract/nidum_contract.py +44 -0
- web3_wizzard_lib/core/contract/nile_contract.py +60 -0
- web3_wizzard_lib/core/contract/nomis_attest_contract.py +40 -0
- web3_wizzard_lib/core/contract/nomis_contract.py +40 -0
- web3_wizzard_lib/core/contract/octomos.py +31 -0
- web3_wizzard_lib/core/contract/odos.py +104 -0
- web3_wizzard_lib/core/contract/omnisea.py +29 -0
- web3_wizzard_lib/core/contract/orbiter_starknet.py +30 -0
- web3_wizzard_lib/core/contract/pancake_pool.py +19 -0
- web3_wizzard_lib/core/contract/pancake_quoter.py +20 -0
- web3_wizzard_lib/core/contract/pancake_router.py +72 -0
- web3_wizzard_lib/core/contract/rage_claim.py +24 -0
- web3_wizzard_lib/core/contract/reactor_fusion_contract.py +78 -0
- web3_wizzard_lib/core/contract/readon_contract.py +19 -0
- web3_wizzard_lib/core/contract/rubyscore_contract.py +31 -0
- web3_wizzard_lib/core/contract/satoshi_universe_contract.py +29 -0
- web3_wizzard_lib/core/contract/scroll_bridge_contract.py +24 -0
- web3_wizzard_lib/core/contract/scroll_canvas_mint_contract.py +26 -0
- web3_wizzard_lib/core/contract/scroll_oracle.py +11 -0
- web3_wizzard_lib/core/contract/snap_contract.py +16 -0
- web3_wizzard_lib/core/contract/social_scan_contract.py +20 -0
- web3_wizzard_lib/core/contract/stargate_farming.py +37 -0
- web3_wizzard_lib/core/contract/stargate_router.py +84 -0
- web3_wizzard_lib/core/contract/stargate_router_eth.py +41 -0
- web3_wizzard_lib/core/contract/stargate_token_pool.py +46 -0
- web3_wizzard_lib/core/contract/stargate_v2_contract.py +36 -0
- web3_wizzard_lib/core/contract/syncswap_classic_pool.py +15 -0
- web3_wizzard_lib/core/contract/syncswap_classic_pool_factory.py +15 -0
- web3_wizzard_lib/core/contract/syncswap_pool.py +25 -0
- web3_wizzard_lib/core/contract/syncswap_router.py +123 -0
- web3_wizzard_lib/core/contract/tavaera_id.py +18 -0
- web3_wizzard_lib/core/contract/tavaera_mint.py +17 -0
- web3_wizzard_lib/core/contract/townstory_bonus_contract.py +19 -0
- web3_wizzard_lib/core/contract/townstory_contract.py +21 -0
- web3_wizzard_lib/core/contract/velocore_lens.py +44 -0
- web3_wizzard_lib/core/contract/velocore_pool.py +198 -0
- web3_wizzard_lib/core/contract/velocore_router.py +80 -0
- web3_wizzard_lib/core/contract/woofi_swap.py +29 -0
- web3_wizzard_lib/core/contract/xy_finance_contract.py +87 -0
- web3_wizzard_lib/core/contract/yoddlo_contract.py +19 -0
- web3_wizzard_lib/core/contract/yuliverse_contract.py +36 -0
- web3_wizzard_lib/core/contract/zebra_contract.py +68 -0
- web3_wizzard_lib/core/contract/zerolend_contract.py +34 -0
- web3_wizzard_lib/core/contract/zerolend_liq_contract.py +20 -0
- web3_wizzard_lib/core/contract/zkdx_contract.py +40 -0
- web3_wizzard_lib/core/contract/zkdx_data.py +14 -0
- web3_wizzard_lib/core/contract/zks.py +24 -0
- web3_wizzard_lib/core/modules/__init__.py +0 -0
- web3_wizzard_lib/core/modules/ads_import_proxy.py +52 -0
- web3_wizzard_lib/core/modules/airdrop_printer.py +80 -0
- web3_wizzard_lib/core/modules/bank/__init__.py +0 -0
- web3_wizzard_lib/core/modules/bank/aave.py +25 -0
- web3_wizzard_lib/core/modules/bank/bank.py +15 -0
- web3_wizzard_lib/core/modules/bank/bank_module.py +99 -0
- web3_wizzard_lib/core/modules/bank/basilisk.py +25 -0
- web3_wizzard_lib/core/modules/bank/eralend.py +25 -0
- web3_wizzard_lib/core/modules/bank/layerbank.py +116 -0
- web3_wizzard_lib/core/modules/bank/mendi_finance.py +57 -0
- web3_wizzard_lib/core/modules/bank/reactorfusion.py +25 -0
- web3_wizzard_lib/core/modules/bank/zerolend.py +36 -0
- web3_wizzard_lib/core/modules/bridge/__init__.py +0 -0
- web3_wizzard_lib/core/modules/bridge/bridge.py +8 -0
- web3_wizzard_lib/core/modules/bridge/coredao_bridge_sub.py +47 -0
- web3_wizzard_lib/core/modules/bridge/orbiter_sub.py +112 -0
- web3_wizzard_lib/core/modules/bridge/scroll_bridge_sub.py +42 -0
- web3_wizzard_lib/core/modules/bridge/stargate_v2_sub.py +74 -0
- web3_wizzard_lib/core/modules/bridge_module.py +47 -0
- web3_wizzard_lib/core/modules/bungee.py +109 -0
- web3_wizzard_lib/core/modules/cex_sender.py +60 -0
- web3_wizzard_lib/core/modules/cex_subaccount_transfer.py +34 -0
- web3_wizzard_lib/core/modules/cex_withdraw.py +91 -0
- web3_wizzard_lib/core/modules/claimer.py +45 -0
- web3_wizzard_lib/core/modules/claims/__init__.py +0 -0
- web3_wizzard_lib/core/modules/claims/layerzero_claimer.py +64 -0
- web3_wizzard_lib/core/modules/claims/rabby_claimer.py +81 -0
- web3_wizzard_lib/core/modules/concrete_swap.py +97 -0
- web3_wizzard_lib/core/modules/coredao_bridge.py +32 -0
- web3_wizzard_lib/core/modules/coredao_bridge_auto.py +39 -0
- web3_wizzard_lib/core/modules/debank_checker.py +90 -0
- web3_wizzard_lib/core/modules/dmail.py +54 -0
- web3_wizzard_lib/core/modules/erc20_balance.py +42 -0
- web3_wizzard_lib/core/modules/intract/__init__.py +0 -0
- web3_wizzard_lib/core/modules/intract/intract_api.py +212 -0
- web3_wizzard_lib/core/modules/intract/utils.py +81 -0
- web3_wizzard_lib/core/modules/intract_claim.py +104 -0
- web3_wizzard_lib/core/modules/layer_2_20.py +65 -0
- web3_wizzard_lib/core/modules/lending_module.py +134 -0
- web3_wizzard_lib/core/modules/linea_appeal.py +70 -0
- web3_wizzard_lib/core/modules/linea_poh_lxp.py +64 -0
- web3_wizzard_lib/core/modules/liquidity/__init__.py +0 -0
- web3_wizzard_lib/core/modules/liquidity/nile_pool.py +64 -0
- web3_wizzard_lib/core/modules/liquidity/pool.py +16 -0
- web3_wizzard_lib/core/modules/liquidity/syncswap_pool.py +61 -0
- web3_wizzard_lib/core/modules/liquidity/velocore_pool.py +55 -0
- web3_wizzard_lib/core/modules/liquidity/zerolend_liquidity.py +26 -0
- web3_wizzard_lib/core/modules/liquidity_pool.py +60 -0
- web3_wizzard_lib/core/modules/merkly_refuel.py +87 -0
- web3_wizzard_lib/core/modules/modules.py +27 -0
- web3_wizzard_lib/core/modules/nft/__init__.py +0 -0
- web3_wizzard_lib/core/modules/nft/abbys_world.py +22 -0
- web3_wizzard_lib/core/modules/nft/acg_worlds.py +25 -0
- web3_wizzard_lib/core/modules/nft/alienswap_linea.py +22 -0
- web3_wizzard_lib/core/modules/nft/arena_games.py +22 -0
- web3_wizzard_lib/core/modules/nft/asmatch.py +22 -0
- web3_wizzard_lib/core/modules/nft/battlemon.py +25 -0
- web3_wizzard_lib/core/modules/nft/bilinear.py +22 -0
- web3_wizzard_lib/core/modules/nft/bitavatar.py +25 -0
- web3_wizzard_lib/core/modules/nft/culture_satoshi_universe.py +24 -0
- web3_wizzard_lib/core/modules/nft/efrogs.py +26 -0
- web3_wizzard_lib/core/modules/nft/empty_nft.py +22 -0
- web3_wizzard_lib/core/modules/nft/era_domain.py +42 -0
- web3_wizzard_lib/core/modules/nft/frog_war.py +22 -0
- web3_wizzard_lib/core/modules/nft/frog_war_bonus.py +22 -0
- web3_wizzard_lib/core/modules/nft/gamerboom.py +25 -0
- web3_wizzard_lib/core/modules/nft/gamerboom_bonus.py +26 -0
- web3_wizzard_lib/core/modules/nft/imagine.py +32 -0
- web3_wizzard_lib/core/modules/nft/kreatorland_module.py +35 -0
- web3_wizzard_lib/core/modules/nft/l2_telegraph_module.py +22 -0
- web3_wizzard_lib/core/modules/nft/layer3_meta.py +25 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_2_2_linus.py +24 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_2_3_yooldo.py +24 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_2_4_frogwar.py +24 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_2_5_acg.py +25 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_2_6_ascend_the_end.py +25 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_3_1_ascend_the_end.py +25 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_3_2_sending_me.py +25 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_3_3_townstory.py +25 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_3_4_daniele.py +25 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_3_5_demmortal.py +25 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_3_6_foxy.py +25 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_4_1_coop_records.py +60 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_4_2_borja_moskv.py +65 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_4_2_borja_moskv_approve.py +27 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_4_3_fruit.py +66 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_4_4_fruit_crux.py +67 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_4_5_forbidden_fruit.py +67 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_4_6_laurent.py +67 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_day2.py +20 -0
- web3_wizzard_lib/core/modules/nft/linea_culture_day3.py +20 -0
- web3_wizzard_lib/core/modules/nft/linea_ens_names.py +107 -0
- web3_wizzard_lib/core/modules/nft/lucky_cat.py +25 -0
- web3_wizzard_lib/core/modules/nft/merkly_minter_module.py +22 -0
- web3_wizzard_lib/core/modules/nft/micro3.py +23 -0
- web3_wizzard_lib/core/modules/nft/mint_2048.py +28 -0
- web3_wizzard_lib/core/modules/nft/nft_submodule.py +16 -0
- web3_wizzard_lib/core/modules/nft/nidum.py +87 -0
- web3_wizzard_lib/core/modules/nft/nidum_bonus.py +23 -0
- web3_wizzard_lib/core/modules/nft/nomis.py +64 -0
- web3_wizzard_lib/core/modules/nft/nomis_attest.py +66 -0
- web3_wizzard_lib/core/modules/nft/nouns.py +27 -0
- web3_wizzard_lib/core/modules/nft/octomos.py +32 -0
- web3_wizzard_lib/core/modules/nft/omnisea.py +33 -0
- web3_wizzard_lib/core/modules/nft/omnizone.py +25 -0
- web3_wizzard_lib/core/modules/nft/orbiter_claim.py +87 -0
- web3_wizzard_lib/core/modules/nft/readon.py +30 -0
- web3_wizzard_lib/core/modules/nft/rubyscore.py +45 -0
- web3_wizzard_lib/core/modules/nft/sarubol.py +22 -0
- web3_wizzard_lib/core/modules/nft/satoshi_universe.py +22 -0
- web3_wizzard_lib/core/modules/nft/scroll_canvas_attest_year_badge.py +35 -0
- web3_wizzard_lib/core/modules/nft/scroll_canvas_mint.py +51 -0
- web3_wizzard_lib/core/modules/nft/sign.py +32 -0
- web3_wizzard_lib/core/modules/nft/snap.py +25 -0
- web3_wizzard_lib/core/modules/nft/snap_bonus.py +31 -0
- web3_wizzard_lib/core/modules/nft/social_scan.py +22 -0
- web3_wizzard_lib/core/modules/nft/sub_module.py +8 -0
- web3_wizzard_lib/core/modules/nft/tavaera.py +30 -0
- web3_wizzard_lib/core/modules/nft/townstory.py +75 -0
- web3_wizzard_lib/core/modules/nft/townstory_bonus.py +45 -0
- web3_wizzard_lib/core/modules/nft/trusta_reputation.py +48 -0
- web3_wizzard_lib/core/modules/nft/trustaa_poh.py +49 -0
- web3_wizzard_lib/core/modules/nft/uber_poh.py +24 -0
- web3_wizzard_lib/core/modules/nft/wizards_of_linea.py +26 -0
- web3_wizzard_lib/core/modules/nft/yoddlo.py +22 -0
- web3_wizzard_lib/core/modules/nft/yuliverse.py +22 -0
- web3_wizzard_lib/core/modules/nft/zace.py +25 -0
- web3_wizzard_lib/core/modules/nft/zks_domain.py +41 -0
- web3_wizzard_lib/core/modules/nft_minter.py +107 -0
- web3_wizzard_lib/core/modules/orbiter.py +39 -0
- web3_wizzard_lib/core/modules/orbiter_checker.py +26 -0
- web3_wizzard_lib/core/modules/rage.py +54 -0
- web3_wizzard_lib/core/modules/scroll_bridge.py +45 -0
- web3_wizzard_lib/core/modules/sell_all.py +51 -0
- web3_wizzard_lib/core/modules/sleep_module.py +25 -0
- web3_wizzard_lib/core/modules/smart_contract_deployment.py +37 -0
- web3_wizzard_lib/core/modules/stargate/__init__.py +0 -0
- web3_wizzard_lib/core/modules/stargate/auto_bridge.py +91 -0
- web3_wizzard_lib/core/modules/stargate/bridge.py +38 -0
- web3_wizzard_lib/core/modules/stargate/bridge_eth.py +59 -0
- web3_wizzard_lib/core/modules/stargate/bridge_tokens.py +48 -0
- web3_wizzard_lib/core/modules/stargate/classic_bridge.py +34 -0
- web3_wizzard_lib/core/modules/stargate/farming.py +163 -0
- web3_wizzard_lib/core/modules/stargate/l0_data.py +10 -0
- web3_wizzard_lib/core/modules/stargate/pool.py +74 -0
- web3_wizzard_lib/core/modules/stargate/stargate_balance_utils.py +25 -0
- web3_wizzard_lib/core/modules/stargate/stargate_gas_checker.py +68 -0
- web3_wizzard_lib/core/modules/swap/__init__.py +1 -0
- web3_wizzard_lib/core/modules/swap/horizondex.py +38 -0
- web3_wizzard_lib/core/modules/swap/izumi.py +41 -0
- web3_wizzard_lib/core/modules/swap/lineaswap.py +34 -0
- web3_wizzard_lib/core/modules/swap/maverick.py +66 -0
- web3_wizzard_lib/core/modules/swap/mute.py +39 -0
- web3_wizzard_lib/core/modules/swap/odos.py +58 -0
- web3_wizzard_lib/core/modules/swap/one_inch.py +58 -0
- web3_wizzard_lib/core/modules/swap/pancake.py +41 -0
- web3_wizzard_lib/core/modules/swap/swap_facade.py +10 -0
- web3_wizzard_lib/core/modules/swap/swap_list.py +10 -0
- web3_wizzard_lib/core/modules/swap/syncswap.py +62 -0
- web3_wizzard_lib/core/modules/swap/velocore.py +40 -0
- web3_wizzard_lib/core/modules/swap/woofi.py +38 -0
- web3_wizzard_lib/core/modules/swap/xy_finance.py +43 -0
- web3_wizzard_lib/core/modules/swap/zebra.py +32 -0
- web3_wizzard_lib/core/modules/warm_up.py +98 -0
- web3_wizzard_lib/core/modules/wrapping.py +74 -0
- web3_wizzard_lib/core/modules/zkdx.py +63 -0
- web3_wizzard_lib/core/utils/__init__.py +0 -0
- web3_wizzard_lib/core/utils/sub_module.py +8 -0
- web3_wizzard_lib/launcher.py +39 -0
- web3_wizzard_lib-0.0.2.data/data/requirements.txt +1 -0
- web3_wizzard_lib-0.0.2.dist-info/METADATA +10 -0
- web3_wizzard_lib-0.0.2.dist-info/RECORD +547 -0
- web3_wizzard_lib-0.0.2.dist-info/WHEEL +5 -0
- web3_wizzard_lib-0.0.2.dist-info/top_level.txt +3 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
from sybil_engine.domain.dex import Dex
|
2
|
+
|
3
|
+
from web3_wizzard_lib.core.contract.mute_router import MuteRouter
|
4
|
+
|
5
|
+
|
6
|
+
class Mute(Dex):
|
7
|
+
dex_name = 'mute'
|
8
|
+
swap_contract = "MUTE_ROUTER"
|
9
|
+
supported_chains = ['ZKSYNC']
|
10
|
+
|
11
|
+
def __init__(self, chain_instance, web3):
|
12
|
+
super().__init__(chain_instance, web3)
|
13
|
+
self.weth_address = self.tokens['WETH']
|
14
|
+
mute_contract = self.chain_contracts[self.swap_contract]
|
15
|
+
self.mute_router = MuteRouter(mute_contract, self.web3)
|
16
|
+
|
17
|
+
def swap_native_for_token(self, account, amount_to_swap, slippage, to_token_address):
|
18
|
+
amount_out_min = int(self.get_amount_out_min(amount_to_swap, self.weth_address, to_token_address) * slippage)
|
19
|
+
|
20
|
+
args = [account, amount_to_swap, self.weth_address, to_token_address, amount_out_min]
|
21
|
+
func = self.mute_router.swap_exact_eth_for_tokens_supporting_fee_on_transfer_tokens
|
22
|
+
return args, func
|
23
|
+
|
24
|
+
def swap_token_for_native(self, account, amount_to_swap, from_token_address, slippage):
|
25
|
+
amount_out_min = int(self.get_amount_out_min(amount_to_swap, from_token_address, self.weth_address) * slippage)
|
26
|
+
|
27
|
+
args = [account, amount_to_swap, from_token_address, self.weth_address, amount_out_min]
|
28
|
+
func = self.mute_router.swap_exact_tokens_for_eth_supporting_fee_on_transfer_tokens
|
29
|
+
return args, func
|
30
|
+
|
31
|
+
def swap_token_for_token(self, account, amount_to_swap, slippage, from_token_address, to_token_address):
|
32
|
+
amount_out_min = int(self.get_amount_out_min(amount_to_swap, from_token_address, to_token_address) * slippage)
|
33
|
+
|
34
|
+
args = [account, amount_to_swap, from_token_address, to_token_address, amount_out_min]
|
35
|
+
func = self.mute_router.swap_exact_tokens_for_tokens_supporting_fee_on_transfer_tokens
|
36
|
+
return args, func
|
37
|
+
|
38
|
+
def get_amount_out_min(self, amount_to_swap, from_token_address, to_token_address):
|
39
|
+
return self.mute_router.get_amount_out(amount_to_swap, from_token_address, to_token_address)
|
@@ -0,0 +1,58 @@
|
|
1
|
+
from loguru import logger
|
2
|
+
from sybil_engine.domain.dex import Dex
|
3
|
+
from sybil_engine.utils.retry import retry
|
4
|
+
from sybil_engine.utils.utils import AccountException
|
5
|
+
|
6
|
+
from web3_wizzard_lib.core.contract.odos import Odos
|
7
|
+
|
8
|
+
|
9
|
+
class OdosSwap(Dex):
|
10
|
+
dex_name = 'odos'
|
11
|
+
swap_contract = 'ODOS'
|
12
|
+
supported_chains = ['ZKSYNC', 'BASE', 'LINEA']
|
13
|
+
|
14
|
+
def __init__(self, chain_instance, web3):
|
15
|
+
super().__init__(chain_instance, web3)
|
16
|
+
self.odos_router_contract = self.chain_contracts[self.swap_contract]
|
17
|
+
self.odos_router = Odos(self.odos_router_contract, self.web3)
|
18
|
+
|
19
|
+
@retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
|
20
|
+
def swap(self, amount_to_swap, from_token, to_token, slippage, account):
|
21
|
+
logger.info(
|
22
|
+
f"Swap {amount_to_swap.log_line()}->{to_token.symbol()} in {self.dex_name} ({self.chain_instance['chain']})")
|
23
|
+
|
24
|
+
if amount_to_swap.token == 'ETH':
|
25
|
+
from_token_address = '0x0000000000000000000000000000000000000000'
|
26
|
+
else:
|
27
|
+
from_token_address = from_token.erc20_contract.contract_address
|
28
|
+
|
29
|
+
if to_token.token == 'ETH':
|
30
|
+
to_token_address = '0x0000000000000000000000000000000000000000'
|
31
|
+
else:
|
32
|
+
to_token_address = to_token.erc20_contract.contract_address
|
33
|
+
|
34
|
+
quote_data = self.odos_router.quote(
|
35
|
+
account, from_token_address, to_token_address, amount_to_swap.wei, slippage, self.chain_instance['chain']
|
36
|
+
)
|
37
|
+
|
38
|
+
if amount_to_swap.token == 'ETH':
|
39
|
+
transaction_data = self.odos_router.assemble(account, quote_data["pathId"])
|
40
|
+
|
41
|
+
func = self.odos_router.swap
|
42
|
+
else:
|
43
|
+
balance = from_token.balance(account)
|
44
|
+
|
45
|
+
if balance.wei < amount_to_swap.wei:
|
46
|
+
raise AccountException(f"Balance {balance} < {amount_to_swap}")
|
47
|
+
|
48
|
+
if from_token.allowance(account, self.odos_router_contract) < amount_to_swap.wei:
|
49
|
+
from_token.approve(account, self.odos_router_contract)
|
50
|
+
|
51
|
+
transaction_data = self.odos_router.assemble(account, quote_data["pathId"])
|
52
|
+
|
53
|
+
if to_token.token == 'ETH':
|
54
|
+
func = self.odos_router.swap
|
55
|
+
else:
|
56
|
+
raise Exception('Not supported')
|
57
|
+
|
58
|
+
func(account, transaction_data)
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import requests
|
2
|
+
from sybil_engine.contract.transaction_executor import evm_transaction
|
3
|
+
from sybil_engine.domain.dex import Dex
|
4
|
+
from sybil_engine.utils.gas_utils import l1_gas_price
|
5
|
+
from sybil_engine.utils.utils import randomized_sleeping, SwapException
|
6
|
+
from web3 import Web3
|
7
|
+
|
8
|
+
|
9
|
+
class OneInch(Dex):
|
10
|
+
dex_name = '1inch'
|
11
|
+
swap_contract = '1INCH'
|
12
|
+
supported_chains = ['BASE', 'ZKSYNC', 'OPTIMISM', 'ARBITRUM']
|
13
|
+
|
14
|
+
def __init__(self, chain_instance, web3):
|
15
|
+
super().__init__(chain_instance, web3)
|
16
|
+
self.weth_address = self.tokens['WETH']
|
17
|
+
self.base_url = 'https://api.1inch.dev/swap'
|
18
|
+
self.inch_version = 5.2
|
19
|
+
|
20
|
+
@l1_gas_price
|
21
|
+
def swap(self, amount_to_swap, from_token, to_token, slippage, account):
|
22
|
+
if amount_to_swap.wei == 0:
|
23
|
+
raise SwapException(f"Can't swap 0 of {amount_to_swap.token}")
|
24
|
+
|
25
|
+
self.get_txn(account, amount_to_swap, from_token, to_token)
|
26
|
+
|
27
|
+
def get_api_call_data(self, url):
|
28
|
+
response = requests.get(url, headers={'Authorization': "DuagMR3vHpYc9JBNqM0Wx9mSWA7VzwuH"})
|
29
|
+
|
30
|
+
return response.json()
|
31
|
+
|
32
|
+
@evm_transaction
|
33
|
+
def get_txn(self, account, amount_to_swap, from_token, to_token):
|
34
|
+
spender_json = self.get_api_call_data(
|
35
|
+
f'{self.base_url}/v{self.inch_version}/{self.web3.eth.chain_id}/approve/spender')
|
36
|
+
spender = Web3.to_checksum_address(spender_json['address'])
|
37
|
+
|
38
|
+
if from_token.symbol() != 'ETH' and from_token.allowance(account, spender) < amount_to_swap.wei:
|
39
|
+
from_token.approve(account, spender)
|
40
|
+
|
41
|
+
randomized_sleeping({'from': 1, 'to': 5})
|
42
|
+
|
43
|
+
_1inchurl = f"{self.base_url}/v{self.inch_version}/{self.web3.eth.chain_id}/swap?fromTokenAddress={from_token.address()}&toTokenAddress={to_token.address()}&amount={amount_to_swap.wei}&fromAddress={account.address}&slippage=5"
|
44
|
+
json_data = self.get_api_call_data(_1inchurl)
|
45
|
+
|
46
|
+
if json_data is False:
|
47
|
+
raise Exception(json_data['description'])
|
48
|
+
|
49
|
+
contract_txn = json_data['tx']
|
50
|
+
contract_txn['from'] = Web3.to_checksum_address(contract_txn['from'])
|
51
|
+
contract_txn['chainId'] = self.web3.eth.chain_id
|
52
|
+
contract_txn['nonce'] = self.web3.eth.get_transaction_count(account.address)
|
53
|
+
contract_txn['to'] = Web3.to_checksum_address(contract_txn['to'])
|
54
|
+
contract_txn['gasPrice'] = int(contract_txn['gasPrice'])
|
55
|
+
contract_txn['gas'] = int(contract_txn['gas'])
|
56
|
+
contract_txn['value'] = int(contract_txn['value'])
|
57
|
+
|
58
|
+
return contract_txn
|
@@ -0,0 +1,41 @@
|
|
1
|
+
from sybil_engine.domain.dex import Dex
|
2
|
+
|
3
|
+
from web3_wizzard_lib.core.contract.pancake_quoter import PancakeQuoter
|
4
|
+
from web3_wizzard_lib.core.contract.pancake_router import PancakeRouter
|
5
|
+
|
6
|
+
|
7
|
+
class Pancake(Dex):
|
8
|
+
dex_name = 'pancake'
|
9
|
+
swap_contract = "PANCAKE_ROUTER"
|
10
|
+
supported_chains = ['ZKSYNC', 'BASE', 'LINEA', 'ARBITRUM']
|
11
|
+
|
12
|
+
def __init__(self, chain_instance, web3):
|
13
|
+
super().__init__(chain_instance, web3)
|
14
|
+
self.weth_address = self.tokens['WETH']
|
15
|
+
self.pancake_router_contract = self.chain_contracts[self.swap_contract]
|
16
|
+
self.pancake_router = PancakeRouter(self.pancake_router_contract, self.web3)
|
17
|
+
|
18
|
+
def swap_native_for_token(self, account, amount_to_swap, slippage, to_token_address):
|
19
|
+
|
20
|
+
amount_out_min = int(self.get_amount_out_min(amount_to_swap, self.weth_address, to_token_address) * slippage)
|
21
|
+
args = [account, amount_to_swap, self.weth_address, to_token_address, amount_out_min]
|
22
|
+
func = self.pancake_router.swap_to_token
|
23
|
+
|
24
|
+
return args, func
|
25
|
+
|
26
|
+
def swap_token_for_native(self, account, amount_to_swap, from_token_address, slippage):
|
27
|
+
amount_out_min = int(
|
28
|
+
self.get_amount_out_min(amount_to_swap, from_token_address, self.weth_address) * slippage)
|
29
|
+
|
30
|
+
args = [account, amount_to_swap, from_token_address, self.weth_address, amount_out_min]
|
31
|
+
func = self.pancake_router.swap_to_eth
|
32
|
+
return args, func
|
33
|
+
|
34
|
+
def swap_token_for_token(self, account, amount_to_swap, slippage, from_token_address, to_token_address):
|
35
|
+
raise Exception('Not supported')
|
36
|
+
|
37
|
+
def get_amount_out_min(self, amount_to_swap, from_token_address, to_token_address):
|
38
|
+
pancake_quoter_contract = self.chain_contracts["PANCAKE_QUOTER"]
|
39
|
+
pancake_quoter = PancakeQuoter(pancake_quoter_contract, self.web3)
|
40
|
+
|
41
|
+
return pancake_quoter.quote_exact_input_single(from_token_address, to_token_address, amount_to_swap.wei)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
from sybil_engine.domain.dex import Dex
|
2
|
+
from sybil_engine.domain.swap_facade import SwapFacade
|
3
|
+
from sybil_engine.utils.package_import_utils import get_all_subclasses, import_all_modules_in_directory
|
4
|
+
|
5
|
+
|
6
|
+
def get_swap_classes():
|
7
|
+
import_all_modules_in_directory("core.modules.swap")
|
8
|
+
return get_all_subclasses(Dex)
|
9
|
+
|
10
|
+
swap_facade = SwapFacade(get_swap_classes())
|
@@ -0,0 +1,62 @@
|
|
1
|
+
from sybil_engine.domain.dex import Dex
|
2
|
+
|
3
|
+
from web3_wizzard_lib.core.contract.syncswap_classic_pool_factory import SyncSwapClassicPoolFactory
|
4
|
+
from web3_wizzard_lib.core.contract.syncswap_pool import SyncSwapPoolContract
|
5
|
+
from web3_wizzard_lib.core.contract.syncswap_router import SyncSwapRouter
|
6
|
+
|
7
|
+
|
8
|
+
class Syncswap(Dex):
|
9
|
+
dex_name = 'syncswap'
|
10
|
+
swap_contract = 'SYNCSWAP'
|
11
|
+
supported_chains = ['ZKSYNC', 'LINEA', 'SCROLL']
|
12
|
+
|
13
|
+
def __init__(self, chain_instance, web3):
|
14
|
+
super().__init__(chain_instance, web3)
|
15
|
+
self.weth_address = self.tokens['WETH']
|
16
|
+
self.pool_classic_pool_factory_address = self.chain_contracts['SYNCSWAP_CLASSIC_POOL_FACTORY']
|
17
|
+
self.syncswap_contract_address = self.chain_contracts[self.swap_contract]
|
18
|
+
self.syncswap_router = SyncSwapRouter(self.syncswap_contract_address, self.web3)
|
19
|
+
|
20
|
+
def swap_native_for_token(self, account, amount_to_swap, slippage, to_token_address):
|
21
|
+
token_in_data_address = self.weth_address
|
22
|
+
token_in_address = self.tokens['ZERO_ADDRESS']
|
23
|
+
|
24
|
+
amount_out_min = int(
|
25
|
+
self.get_amount_out_min(account, amount_to_swap, token_in_data_address, to_token_address) * slippage
|
26
|
+
)
|
27
|
+
|
28
|
+
args = [
|
29
|
+
account,
|
30
|
+
amount_to_swap,
|
31
|
+
self.weth_address,
|
32
|
+
token_in_address,
|
33
|
+
self.get_pool_address(token_in_data_address, to_token_address),
|
34
|
+
amount_out_min
|
35
|
+
]
|
36
|
+
|
37
|
+
return args, self.syncswap_router.swap
|
38
|
+
|
39
|
+
def swap_token_for_native(self, account, amount_to_swap, from_token_address, slippage):
|
40
|
+
token_in_data_address = self.tokens[amount_to_swap.token]
|
41
|
+
token_in_address = self.tokens[amount_to_swap.token]
|
42
|
+
|
43
|
+
amount_out_min = int(
|
44
|
+
self.get_amount_out_min(account, amount_to_swap, token_in_data_address, self.weth_address) * slippage)
|
45
|
+
|
46
|
+
args = [account, amount_to_swap, token_in_address, token_in_data_address, self.get_pool_address(token_in_data_address, self.weth_address), amount_out_min]
|
47
|
+
|
48
|
+
return args, self.syncswap_router.swap
|
49
|
+
|
50
|
+
def get_amount_out_min(self, account, amount_to_swap, token_in_data_address, to_token_address):
|
51
|
+
pool_address = self.get_pool_address(token_in_data_address, to_token_address)
|
52
|
+
|
53
|
+
if isinstance(pool_address, str):
|
54
|
+
syncswap_pool = SyncSwapPoolContract(pool_address, self.web3)
|
55
|
+
else:
|
56
|
+
syncswap_pool = SyncSwapPoolContract(list(pool_address.items())[0][1], self.web3)
|
57
|
+
|
58
|
+
return syncswap_pool.get_amount_out(account, amount_to_swap, token_in_data_address)
|
59
|
+
|
60
|
+
def get_pool_address(self, token_in_data_address, to_token_address):
|
61
|
+
pool_factory = SyncSwapClassicPoolFactory(self.pool_classic_pool_factory_address, self.web3)
|
62
|
+
return pool_factory.get_pool(token_in_data_address, to_token_address)
|
@@ -0,0 +1,40 @@
|
|
1
|
+
from sybil_engine.domain.dex import Dex
|
2
|
+
|
3
|
+
from web3_wizzard_lib.core.contract.velocore_router import VelocoreRouter
|
4
|
+
|
5
|
+
|
6
|
+
class Velocore(Dex):
|
7
|
+
dex_name = 'velocore'
|
8
|
+
swap_contract = "VELOCORE_ROUTER"
|
9
|
+
supported_chains = ['ZKSYNC']
|
10
|
+
|
11
|
+
def __init__(self, chain_instance, web3):
|
12
|
+
super().__init__(chain_instance, web3)
|
13
|
+
self.weth_address = self.tokens['WETH']
|
14
|
+
self.velocore_router = VelocoreRouter(self.chain_contracts[self.swap_contract], self.web3)
|
15
|
+
|
16
|
+
def swap_native_for_token(self, account, amount_to_swap, slippage, to_token_address):
|
17
|
+
amount_out_min = int(self.get_amount_out_min(amount_to_swap, self.weth_address, to_token_address) * slippage)
|
18
|
+
|
19
|
+
args = [account, amount_to_swap, self.weth_address, to_token_address, amount_out_min]
|
20
|
+
func = self.velocore_router.swap_exact_eth_for_tokens
|
21
|
+
|
22
|
+
return args, func
|
23
|
+
|
24
|
+
def get_amount_out_min(self, amount_to_swap, from_token_address, to_token_address):
|
25
|
+
return self.velocore_router.get_amount_out(amount_to_swap, from_token_address, to_token_address)
|
26
|
+
|
27
|
+
def swap_token_for_native(self, account, amount_to_swap, from_token_address, slippage):
|
28
|
+
amount_out_min = int(self.get_amount_out_min(amount_to_swap, from_token_address, self.weth_address) * slippage)
|
29
|
+
|
30
|
+
args = [account, amount_to_swap, from_token_address, self.weth_address, amount_out_min]
|
31
|
+
func = self.velocore_router.swap_exact_tokens_for_eth
|
32
|
+
return args, func
|
33
|
+
|
34
|
+
def swap_token_for_token(self, account, amount_to_swap, slippage, from_token_address, to_token_address):
|
35
|
+
amount_out_min = int(self.get_amount_out_min(amount_to_swap, from_token_address, to_token_address) * slippage)
|
36
|
+
|
37
|
+
args = [account, amount_to_swap, from_token_address, to_token_address, amount_out_min]
|
38
|
+
func = self.velocore_router.swap_exact_tokens_for_tokens
|
39
|
+
|
40
|
+
return args, func
|
@@ -0,0 +1,38 @@
|
|
1
|
+
from sybil_engine.domain.balance.tokens import Erc20Token
|
2
|
+
from sybil_engine.domain.dex import Dex
|
3
|
+
from sybil_engine.utils.gas_utils import l1_gas_price
|
4
|
+
from sybil_engine.utils.utils import AccountException
|
5
|
+
|
6
|
+
from web3_wizzard_lib.core.contract.woofi_swap import WoofiSwap
|
7
|
+
|
8
|
+
|
9
|
+
class Woofi(Dex):
|
10
|
+
dex_name = 'woofi'
|
11
|
+
swap_contract = 'WOOFI'
|
12
|
+
supported_chains = ['ZKSYNC', 'BASE', 'LINEA']
|
13
|
+
|
14
|
+
def __init__(self, chain_instance, web3):
|
15
|
+
super().__init__(chain_instance, web3)
|
16
|
+
self.contract_address = self.chain_contracts[self.swap_contract]
|
17
|
+
self.woofi_swap = WoofiSwap(self.contract_address, self.web3)
|
18
|
+
|
19
|
+
@l1_gas_price
|
20
|
+
def swap(self, amount_to_swap, from_token, to_token, slippage, account):
|
21
|
+
if amount_to_swap.wei == 0:
|
22
|
+
raise AccountException(f"{amount_to_swap.token} balance is 0")
|
23
|
+
|
24
|
+
token_in_address = self.tokens[amount_to_swap.token]
|
25
|
+
token_out_address = self.tokens[to_token.token]
|
26
|
+
|
27
|
+
erc20_from_token = Erc20Token(self.chain_instance['chain'], amount_to_swap.token, self.web3)
|
28
|
+
|
29
|
+
if amount_to_swap.token != 'ETH':
|
30
|
+
if erc20_from_token.allowance(account, self.contract_address) < amount_to_swap.wei:
|
31
|
+
erc20_from_token.approve(account, self.contract_address)
|
32
|
+
|
33
|
+
amount_out_min = int(self.get_amount_out_min(amount_to_swap, token_in_address, token_out_address) * slippage)
|
34
|
+
|
35
|
+
self.woofi_swap.swap(account, amount_to_swap, token_in_address, token_out_address, amount_out_min)
|
36
|
+
|
37
|
+
def get_amount_out_min(self, amount_to_swap, token_in_address, token_out_address):
|
38
|
+
return self.woofi_swap.query_swap(token_in_address, token_out_address, amount_to_swap)
|
@@ -0,0 +1,43 @@
|
|
1
|
+
from loguru import logger
|
2
|
+
from sybil_engine.domain.balance.tokens import Erc20Token
|
3
|
+
from sybil_engine.domain.dex import Dex
|
4
|
+
from sybil_engine.utils.gas_utils import l1_gas_price
|
5
|
+
from sybil_engine.utils.utils import AccountException
|
6
|
+
|
7
|
+
from web3_wizzard_lib.core.contract.xy_finance_contract import XYSwapContract
|
8
|
+
|
9
|
+
|
10
|
+
class XyFinance(Dex):
|
11
|
+
dex_name = 'xy.finance'
|
12
|
+
swap_contract = 'XY_FINANCE'
|
13
|
+
supported_chains = ['SCROLL']
|
14
|
+
|
15
|
+
def __init__(self, chain_instance, web3):
|
16
|
+
super().__init__(chain_instance, web3)
|
17
|
+
self.contract_address = self.chain_contracts[self.swap_contract]
|
18
|
+
self.xy_swap_contract = XYSwapContract(self.contract_address, self.web3)
|
19
|
+
|
20
|
+
@l1_gas_price
|
21
|
+
def swap(self, amount_to_swap, from_token, to_token, slippage, account):
|
22
|
+
if amount_to_swap.wei == 0:
|
23
|
+
raise AccountException(f"{amount_to_swap.token} balance is 0")
|
24
|
+
|
25
|
+
token_in_address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" if from_token == "ETH" else self.tokens[from_token]
|
26
|
+
token_out_address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" if to_token == "ETH" else self.tokens[to_token]
|
27
|
+
|
28
|
+
logger.info(f"Swap {amount_to_swap.log_line()}->{to_token} in {self.dex_name} ({self.chain_instance['chain']})")
|
29
|
+
|
30
|
+
erc20_from_token = Erc20Token(self.chain_instance['chain'], amount_to_swap.token, self.web3)
|
31
|
+
|
32
|
+
if amount_to_swap.token != 'ETH':
|
33
|
+
if erc20_from_token.allowance(account, self.contract_address) < amount_to_swap.wei:
|
34
|
+
erc20_from_token.approve(account, self.contract_address)
|
35
|
+
|
36
|
+
slippage = int((1 - slippage) * 100)
|
37
|
+
|
38
|
+
amount_out_min = self.get_amount_out_min(amount_to_swap, token_in_address, token_out_address, slippage)
|
39
|
+
|
40
|
+
self.xy_swap_contract.swap(account, amount_to_swap, token_in_address, token_out_address, amount_out_min, slippage)
|
41
|
+
|
42
|
+
def get_amount_out_min(self, amount_to_swap, token_in_address, token_out_address, slippage):
|
43
|
+
return self.xy_swap_contract.get_quote(token_in_address, token_out_address, amount_to_swap, slippage)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
from sybil_engine.domain.dex import Dex
|
2
|
+
|
3
|
+
from web3_wizzard_lib.core.contract.zebra_contract import ZebraContract
|
4
|
+
|
5
|
+
|
6
|
+
class Zebra(Dex):
|
7
|
+
dex_name = 'zebra'
|
8
|
+
swap_contract = "ZEBRA"
|
9
|
+
supported_chains = ['SCROLL']
|
10
|
+
|
11
|
+
def __init__(self, chain_instance, web3):
|
12
|
+
super().__init__(chain_instance, web3)
|
13
|
+
self.weth_address = self.tokens['WETH']
|
14
|
+
zebra_contract = self.chain_contracts[self.swap_contract]
|
15
|
+
self.zebra = ZebraContract(zebra_contract, self.web3)
|
16
|
+
|
17
|
+
def swap_native_for_token(self, account, amount_to_swap, slippage, to_token_address):
|
18
|
+
amount_out_min = int(self.get_amount_out_min(amount_to_swap, self.tokens['ETH'], to_token_address) * slippage)
|
19
|
+
|
20
|
+
args = [account, amount_to_swap, self.tokens['ETH'], to_token_address, amount_out_min]
|
21
|
+
func = self.zebra.swap_to_token
|
22
|
+
return args, func
|
23
|
+
|
24
|
+
def swap_token_for_native(self, account, amount_to_swap, from_token_address, slippage):
|
25
|
+
amount_out_min = int(self.get_amount_out_min(amount_to_swap, from_token_address, self.weth_address) * slippage)
|
26
|
+
|
27
|
+
args = [account, amount_to_swap, from_token_address, self.tokens['ETH'], amount_out_min]
|
28
|
+
func = self.zebra.swap_to_eth
|
29
|
+
return args, func
|
30
|
+
|
31
|
+
def get_amount_out_min(self, amount_to_swap, from_token_address, to_token_address):
|
32
|
+
return self.zebra.get_min_amount_out(amount_to_swap, from_token_address, to_token_address)
|
core/modules/warm_up.py
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
import random
|
2
|
+
|
3
|
+
from loguru import logger
|
4
|
+
from sybil_engine.data.networks import get_chain_instance
|
5
|
+
from sybil_engine.data.pairs import Pairs
|
6
|
+
from sybil_engine.domain.balance.balance_utils import verify_balance, amount_to_swap_from_interval
|
7
|
+
from sybil_engine.domain.balance.tokens import Erc20Token
|
8
|
+
from sybil_engine.module.module import Order, RepeatableModule
|
9
|
+
from sybil_engine.utils.utils import interval_to_int, randomized_sleeping, SwapException
|
10
|
+
from sybil_engine.utils.validation_utils import validate_amount_interval_possible_empty, validate_token, \
|
11
|
+
validate_interval, validate_dex_list
|
12
|
+
from sybil_engine.utils.web3_utils import init_web3
|
13
|
+
|
14
|
+
from web3_wizzard_lib.core.modules import swap_facade
|
15
|
+
|
16
|
+
|
17
|
+
class WarmUp(RepeatableModule):
|
18
|
+
module_name = 'WARMUP'
|
19
|
+
module_config = 'warmup_config'
|
20
|
+
allowed_chains = ['ZKSYNC', 'LINEA', 'BASE', 'SCROLL', 'ARBITRUM']
|
21
|
+
random_order = Order.RANDOM
|
22
|
+
repeat_conf = 'amount_of_warmups'
|
23
|
+
|
24
|
+
@RepeatableModule.repeatable_log
|
25
|
+
def execute(self, chain, swap_amount_interval, warm_token, amount_of_warmups, allowed_dex, pair_names: list,
|
26
|
+
sell_tokens, sleep_interval, account):
|
27
|
+
chain_instance = get_chain_instance(chain)
|
28
|
+
web3 = init_web3(chain_instance, account.proxy)
|
29
|
+
|
30
|
+
swap_amount = interval_to_int(amount_of_warmups)
|
31
|
+
|
32
|
+
if len(pair_names) > 0:
|
33
|
+
logger.info(f"Warmup pairs {pair_names}")
|
34
|
+
|
35
|
+
pair = Pairs(swap_facade)
|
36
|
+
|
37
|
+
pair_swaps = pair.get_warmup_pair_swaps(allowed_dex, chain, pair_names, swap_amount, warm_token)
|
38
|
+
random.shuffle(pair_swaps)
|
39
|
+
self._warm_up(chain_instance, pair_swaps, sell_tokens, sleep_interval, swap_amount_interval, account, web3)
|
40
|
+
|
41
|
+
def _warm_up(self, chain_instance, pair_swaps, sell_tokens, sleep_interval, swap_amount_interval, account, web3):
|
42
|
+
pair, swaps = random.choice(pair_swaps)
|
43
|
+
random.shuffle(swaps)
|
44
|
+
|
45
|
+
native_balance = verify_balance(self.min_native_balance, chain_instance, account, web3)
|
46
|
+
buy_dex, sell_dex = swaps[0], swaps[-1]
|
47
|
+
|
48
|
+
self._warm_up_pair(buy_dex, sell_dex, native_balance, swap_amount_interval, chain_instance, pair, sell_tokens,
|
49
|
+
sleep_interval, account, web3)
|
50
|
+
|
51
|
+
randomized_sleeping(sleep_interval)
|
52
|
+
|
53
|
+
def _warm_up_pair(self, buy_dex, sell_dex, native_balance, swap_amount_interval, chain_instance, pair, sell_tokens,
|
54
|
+
sleep_interval, account, web3):
|
55
|
+
warm_up_token = pair['tokens'][0]
|
56
|
+
token = pair['tokens'][1]
|
57
|
+
|
58
|
+
amount_to_swap = amount_to_swap_from_interval(account, chain_instance['chain'], self.min_native_balance,
|
59
|
+
native_balance, swap_amount_interval, warm_up_token, web3)
|
60
|
+
swap_facade.swap(account, amount_to_swap, chain_instance, pair, buy_dex, warm_up_token, token, web3)
|
61
|
+
randomized_sleeping(sleep_interval)
|
62
|
+
|
63
|
+
if sell_tokens:
|
64
|
+
try:
|
65
|
+
self.execute_sell(chain_instance, pair, sell_dex, account, web3)
|
66
|
+
except SwapException as e:
|
67
|
+
logger.error(e)
|
68
|
+
self.execute_sell(chain_instance, pair, buy_dex, account, web3)
|
69
|
+
|
70
|
+
def execute_sell(self, chain_instance, pair, sell_dex, account, web3):
|
71
|
+
amount_to_swap = Erc20Token(chain_instance['chain'], pair['tokens'][1], web3).balance(account)
|
72
|
+
swap_facade.swap(account, amount_to_swap, chain_instance, pair, sell_dex, amount_to_swap.token,
|
73
|
+
pair['tokens'][0], web3)
|
74
|
+
|
75
|
+
def parse_params(self, module_params):
|
76
|
+
self.validate_supported_chain(module_params['chain'])
|
77
|
+
validate_amount_interval_possible_empty(module_params["swap_amount_interval"])
|
78
|
+
validate_token(module_params["token"])
|
79
|
+
validate_interval(module_params["amount_of_warmups"])
|
80
|
+
validate_dex_list(module_params["allowed_dex"])
|
81
|
+
validate_interval(module_params["pair_sleep_interval"])
|
82
|
+
|
83
|
+
return (
|
84
|
+
module_params["chain"],
|
85
|
+
module_params["swap_amount_interval"],
|
86
|
+
module_params["token"],
|
87
|
+
module_params["amount_of_warmups"],
|
88
|
+
module_params["allowed_dex"],
|
89
|
+
module_params["warmup_pairs"],
|
90
|
+
module_params["sell_tokens"],
|
91
|
+
module_params["pair_sleep_interval"]
|
92
|
+
)
|
93
|
+
|
94
|
+
def log(self):
|
95
|
+
return "WARM UP"
|
96
|
+
|
97
|
+
def sleep_after(self):
|
98
|
+
return False
|
core/modules/wrapping.py
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
from loguru import logger
|
2
|
+
from sybil_engine.contract.weth import WETH
|
3
|
+
from sybil_engine.data.networks import get_chain_instance
|
4
|
+
from sybil_engine.data.tokens import get_tokens_for_chain
|
5
|
+
from sybil_engine.domain.balance.balance import NotEnoughNativeBalance
|
6
|
+
from sybil_engine.domain.balance.balance_utils import interval_to_eth_balance, verify_balance, interval_to_weth_balance
|
7
|
+
from sybil_engine.module.module import Module
|
8
|
+
from sybil_engine.utils.utils import ConfigurationException
|
9
|
+
from sybil_engine.utils.validation_utils import validate_amount_interval
|
10
|
+
from sybil_engine.utils.web3_utils import init_web3
|
11
|
+
|
12
|
+
|
13
|
+
class Wrapping(Module):
|
14
|
+
module_name = 'WRAPPING'
|
15
|
+
module_config = 'wrap_config'
|
16
|
+
allowed_chains = ['ZKSYNC', 'LINEA', 'BASE', 'SCROLL', 'ARBITRUM']
|
17
|
+
sleep_after_var = True
|
18
|
+
|
19
|
+
def execute(self, wrapping_chain, swap_amount_interval, action, account):
|
20
|
+
self.sleep_after_var = True
|
21
|
+
chain_instance = get_chain_instance(wrapping_chain)
|
22
|
+
web3 = init_web3(chain_instance, account.proxy)
|
23
|
+
|
24
|
+
weth_contract = get_tokens_for_chain(chain_instance['chain'])['WETH']
|
25
|
+
weth = WETH(weth_contract, web3)
|
26
|
+
|
27
|
+
if action == 'WRAP':
|
28
|
+
amount_to_wrap = interval_to_eth_balance(swap_amount_interval, account, chain_instance['chain'], web3)
|
29
|
+
|
30
|
+
logger.info(f"{action} {str(amount_to_wrap)}")
|
31
|
+
|
32
|
+
native_balance = verify_balance(self.min_native_balance, chain_instance, account, web3)
|
33
|
+
|
34
|
+
if swap_amount_interval == 'all_balance':
|
35
|
+
amount_to_wrap = amount_to_wrap.minus(self.min_native_balance)
|
36
|
+
|
37
|
+
if amount_to_wrap.wei > native_balance.wei:
|
38
|
+
raise NotEnoughNativeBalance(
|
39
|
+
f"Account balance {native_balance} < {amount_to_wrap} amount to wrap.")
|
40
|
+
|
41
|
+
weth.deposit(account, amount_to_wrap)
|
42
|
+
elif action == 'UNWRAP':
|
43
|
+
if swap_amount_interval == '':
|
44
|
+
swap_amount_interval = 'all_balance'
|
45
|
+
|
46
|
+
amount_to_unwrap = interval_to_weth_balance(
|
47
|
+
swap_amount_interval,
|
48
|
+
account,
|
49
|
+
chain_instance['chain'],
|
50
|
+
web3
|
51
|
+
)
|
52
|
+
|
53
|
+
if amount_to_unwrap.wei < 1000:
|
54
|
+
logger.info(f"WETH balance is {amount_to_unwrap}, skip unwrapping")
|
55
|
+
self.sleep_after_var = False
|
56
|
+
return
|
57
|
+
|
58
|
+
logger.info(f"{action} {amount_to_unwrap}")
|
59
|
+
|
60
|
+
weth.withdraw(account, amount_to_unwrap)
|
61
|
+
else:
|
62
|
+
raise ConfigurationException(f'Wrong Action {action}')
|
63
|
+
|
64
|
+
def parse_params(self, module_params):
|
65
|
+
self.validate_supported_chain(module_params['chain'])
|
66
|
+
validate_amount_interval(module_params['amount_interval'])
|
67
|
+
|
68
|
+
return module_params['chain'], module_params['amount_interval'], module_params['action']
|
69
|
+
|
70
|
+
def log(self):
|
71
|
+
return "WRAPPING"
|
72
|
+
|
73
|
+
def sleep_after(self):
|
74
|
+
return self.sleep_after_var
|
core/modules/zkdx.py
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
from loguru import logger
|
2
|
+
from sybil_engine.data.contracts import get_contracts_for_chain
|
3
|
+
from sybil_engine.data.networks import get_chain_instance
|
4
|
+
from sybil_engine.domain.balance.balance_utils import interval_to_erc20_balance
|
5
|
+
from sybil_engine.domain.balance.tokens import Erc20Token
|
6
|
+
from sybil_engine.module.module import Module
|
7
|
+
from sybil_engine.utils.app_account_utils import AppAccount
|
8
|
+
from sybil_engine.utils.utils import AccountException
|
9
|
+
from sybil_engine.utils.web3_utils import init_web3
|
10
|
+
|
11
|
+
from web3_wizzard_lib.core.contract.zkdx_contract import ZKDXContract
|
12
|
+
from web3_wizzard_lib.core.contract.zkdx_data import ZKDXDataContract
|
13
|
+
|
14
|
+
|
15
|
+
class ZKDX(Module):
|
16
|
+
module_name = 'ZKDX'
|
17
|
+
module_config = 'zkdx_config'
|
18
|
+
|
19
|
+
def execute(self, action, amount_interval, account: AppAccount, chain='LINEA'):
|
20
|
+
chain_instance = get_chain_instance(chain)
|
21
|
+
web3 = init_web3(chain_instance, account.proxy)
|
22
|
+
|
23
|
+
zkdx_contract = get_contracts_for_chain(chain)['ZKDX']
|
24
|
+
zkdx_data_contract = get_contracts_for_chain(chain)['ZKDX_DATA']
|
25
|
+
|
26
|
+
zkdx = ZKDXContract(zkdx_contract, web3)
|
27
|
+
|
28
|
+
if action == 'DEPOSIT':
|
29
|
+
amount = interval_to_erc20_balance(amount_interval, account, 'USDC', chain, web3)
|
30
|
+
|
31
|
+
erc20 = Erc20Token(chain, 'USDC', web3)
|
32
|
+
|
33
|
+
if erc20.allowance(account, zkdx_contract) < erc20.balance(account).wei:
|
34
|
+
erc20.approve(account, zkdx_contract)
|
35
|
+
|
36
|
+
logger.info(f"Deposit {amount} to ZKDX")
|
37
|
+
zkdx.swap_to_zkdx(account, amount)
|
38
|
+
if action == 'WITHDRAW':
|
39
|
+
zkdx_data = ZKDXDataContract(zkdx_data_contract, web3)
|
40
|
+
balance = zkdx_data.get_balance(account)[0]
|
41
|
+
|
42
|
+
if balance == 0:
|
43
|
+
raise AccountException("ZKDX Balance is 0, skip")
|
44
|
+
|
45
|
+
logger.info(f"WITHDRAW {balance / 10 ** 18} ZUSD to ZKDX")
|
46
|
+
zkdx.swap_from_zkdx(account, balance)
|
47
|
+
else:
|
48
|
+
raise Exception(f"{action} action not supported")
|
49
|
+
|
50
|
+
def log(self):
|
51
|
+
return "ZKDX"
|
52
|
+
|
53
|
+
def parse_params(self, module_params):
|
54
|
+
return [
|
55
|
+
module_params['action'],
|
56
|
+
module_params['amount_interval']
|
57
|
+
]
|
58
|
+
|
59
|
+
|
60
|
+
class EmptyDepositException(Exception):
|
61
|
+
def __init__(self, message):
|
62
|
+
self.message = message
|
63
|
+
super().__init__(self.message)
|
data/__init__.py
ADDED
File without changes
|