web3-wizzard-lib 0.0.2__py3-none-any.whl → 0.0.3__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.
- web3_wizzard_lib/core/modules/linea_appeal.py +12 -45
- web3_wizzard_lib/core/modules/stargate/farming.py +1 -1
- web3_wizzard_lib/core/utils/ai_utils.py +27 -0
- {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.0.3.dist-info}/METADATA +8 -3
- {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.0.3.dist-info}/RECORD +8 -294
- {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.0.3.dist-info}/WHEEL +1 -1
- core/__init__.py +0 -1
- core/contract/__init__.py +0 -0
- core/contract/aavecontract.py +0 -36
- core/contract/alienswap_contract.py +0 -21
- core/contract/arena_games_contract.py +0 -16
- core/contract/basiliskcontract.py +0 -58
- core/contract/bilinear_contract.py +0 -22
- core/contract/bungee.py +0 -33
- core/contract/coredao_contract.py +0 -35
- core/contract/coredao_from_contract.py +0 -40
- core/contract/dmail_send_mail.py +0 -18
- core/contract/empty_nft.py +0 -18
- core/contract/era_name.py +0 -23
- core/contract/eralendcontract.py +0 -34
- core/contract/eth_scroll_bridge_contract.py +0 -25
- core/contract/frog_war_contract.py +0 -48
- core/contract/horizondex_quoter.py +0 -14
- core/contract/horizondex_router.py +0 -91
- core/contract/imagine_contract.py +0 -18
- core/contract/izumi.py +0 -63
- core/contract/kreatorland_contract.py +0 -21
- core/contract/l0_claim.py +0 -254
- core/contract/l2_telegraph.py +0 -21
- core/contract/layerbank_price.py +0 -18
- core/contract/layerbank_token.py +0 -29
- core/contract/layerbankcontract.py +0 -59
- core/contract/linea_day_2_contract.py +0 -19
- core/contract/linea_day_3_contract.py +0 -55
- core/contract/linea_ens_names_contract.py +0 -55
- core/contract/lineaswaprouter.py +0 -52
- core/contract/maverick_multicall.py +0 -52
- core/contract/mendi_finance_contract.py +0 -11
- core/contract/mendi_token.py +0 -25
- core/contract/merkly_minter.py +0 -47
- core/contract/micro3_contract.py +0 -18
- core/contract/mute_router.py +0 -93
- core/contract/nidum_contract.py +0 -44
- core/contract/nile_contract.py +0 -60
- core/contract/nomis_attest_contract.py +0 -40
- core/contract/nomis_contract.py +0 -40
- core/contract/octomos.py +0 -31
- core/contract/odos.py +0 -104
- core/contract/omnisea.py +0 -29
- core/contract/orbiter_starknet.py +0 -30
- core/contract/pancake_pool.py +0 -19
- core/contract/pancake_quoter.py +0 -20
- core/contract/pancake_router.py +0 -72
- core/contract/rage_claim.py +0 -24
- core/contract/reactor_fusion_contract.py +0 -78
- core/contract/readon_contract.py +0 -19
- core/contract/rubyscore_contract.py +0 -31
- core/contract/satoshi_universe_contract.py +0 -29
- core/contract/scroll_bridge_contract.py +0 -24
- core/contract/scroll_canvas_mint_contract.py +0 -26
- core/contract/scroll_oracle.py +0 -11
- core/contract/snap_contract.py +0 -16
- core/contract/social_scan_contract.py +0 -20
- core/contract/stargate_farming.py +0 -37
- core/contract/stargate_router.py +0 -84
- core/contract/stargate_router_eth.py +0 -41
- core/contract/stargate_token_pool.py +0 -46
- core/contract/stargate_v2_contract.py +0 -36
- core/contract/syncswap_classic_pool.py +0 -15
- core/contract/syncswap_classic_pool_factory.py +0 -15
- core/contract/syncswap_pool.py +0 -25
- core/contract/syncswap_router.py +0 -123
- core/contract/tavaera_id.py +0 -18
- core/contract/tavaera_mint.py +0 -17
- core/contract/townstory_bonus_contract.py +0 -19
- core/contract/townstory_contract.py +0 -21
- core/contract/velocore_lens.py +0 -44
- core/contract/velocore_pool.py +0 -198
- core/contract/velocore_router.py +0 -80
- core/contract/woofi_swap.py +0 -29
- core/contract/xy_finance_contract.py +0 -87
- core/contract/yoddlo_contract.py +0 -19
- core/contract/yuliverse_contract.py +0 -36
- core/contract/zebra_contract.py +0 -68
- core/contract/zerolend_contract.py +0 -34
- core/contract/zerolend_liq_contract.py +0 -20
- core/contract/zkdx_contract.py +0 -40
- core/contract/zkdx_data.py +0 -14
- core/contract/zks.py +0 -24
- core/modules/__init__.py +0 -0
- core/modules/ads_import_proxy.py +0 -52
- core/modules/airdrop_printer.py +0 -80
- core/modules/bank/__init__.py +0 -0
- core/modules/bank/aave.py +0 -25
- core/modules/bank/bank.py +0 -15
- core/modules/bank/bank_module.py +0 -99
- core/modules/bank/basilisk.py +0 -25
- core/modules/bank/eralend.py +0 -25
- core/modules/bank/layerbank.py +0 -116
- core/modules/bank/mendi_finance.py +0 -57
- core/modules/bank/reactorfusion.py +0 -25
- core/modules/bank/zerolend.py +0 -36
- core/modules/bridge/__init__.py +0 -0
- core/modules/bridge/bridge.py +0 -8
- core/modules/bridge/coredao_bridge_sub.py +0 -47
- core/modules/bridge/orbiter_sub.py +0 -112
- core/modules/bridge/scroll_bridge_sub.py +0 -42
- core/modules/bridge/stargate_v2_sub.py +0 -74
- core/modules/bridge_module.py +0 -47
- core/modules/bungee.py +0 -109
- core/modules/cex_sender.py +0 -60
- core/modules/cex_subaccount_transfer.py +0 -34
- core/modules/cex_withdraw.py +0 -91
- core/modules/claimer.py +0 -45
- core/modules/claims/__init__.py +0 -0
- core/modules/claims/layerzero_claimer.py +0 -64
- core/modules/claims/rabby_claimer.py +0 -81
- core/modules/concrete_swap.py +0 -97
- core/modules/coredao_bridge.py +0 -32
- core/modules/coredao_bridge_auto.py +0 -39
- core/modules/debank_checker.py +0 -90
- core/modules/dmail.py +0 -54
- core/modules/erc20_balance.py +0 -42
- core/modules/intract/__init__.py +0 -0
- core/modules/intract/intract_api.py +0 -212
- core/modules/intract/utils.py +0 -81
- core/modules/intract_claim.py +0 -104
- core/modules/layer_2_20.py +0 -65
- core/modules/lending_module.py +0 -134
- core/modules/linea_appeal.py +0 -70
- core/modules/linea_poh_lxp.py +0 -64
- core/modules/liquidity/__init__.py +0 -0
- core/modules/liquidity/nile_pool.py +0 -64
- core/modules/liquidity/pool.py +0 -16
- core/modules/liquidity/syncswap_pool.py +0 -61
- core/modules/liquidity/velocore_pool.py +0 -55
- core/modules/liquidity/zerolend_liquidity.py +0 -26
- core/modules/liquidity_pool.py +0 -60
- core/modules/merkly_refuel.py +0 -87
- core/modules/modules.py +0 -4
- core/modules/nft/__init__.py +0 -0
- core/modules/nft/abbys_world.py +0 -22
- core/modules/nft/acg_worlds.py +0 -25
- core/modules/nft/alienswap_linea.py +0 -22
- core/modules/nft/arena_games.py +0 -22
- core/modules/nft/asmatch.py +0 -22
- core/modules/nft/battlemon.py +0 -25
- core/modules/nft/bilinear.py +0 -22
- core/modules/nft/bitavatar.py +0 -25
- core/modules/nft/culture_satoshi_universe.py +0 -24
- core/modules/nft/efrogs.py +0 -26
- core/modules/nft/empty_nft.py +0 -22
- core/modules/nft/era_domain.py +0 -42
- core/modules/nft/frog_war.py +0 -22
- core/modules/nft/frog_war_bonus.py +0 -22
- core/modules/nft/gamerboom.py +0 -25
- core/modules/nft/gamerboom_bonus.py +0 -26
- core/modules/nft/imagine.py +0 -32
- core/modules/nft/kreatorland_module.py +0 -35
- core/modules/nft/l2_telegraph_module.py +0 -22
- core/modules/nft/layer3_meta.py +0 -25
- core/modules/nft/linea_culture_2_2_linus.py +0 -24
- core/modules/nft/linea_culture_2_3_yooldo.py +0 -24
- core/modules/nft/linea_culture_2_4_frogwar.py +0 -24
- core/modules/nft/linea_culture_2_5_acg.py +0 -25
- core/modules/nft/linea_culture_2_6_ascend_the_end.py +0 -25
- core/modules/nft/linea_culture_3_1_ascend_the_end.py +0 -25
- core/modules/nft/linea_culture_3_2_sending_me.py +0 -25
- core/modules/nft/linea_culture_3_3_townstory.py +0 -25
- core/modules/nft/linea_culture_3_4_daniele.py +0 -25
- core/modules/nft/linea_culture_3_5_demmortal.py +0 -25
- core/modules/nft/linea_culture_3_6_foxy.py +0 -25
- core/modules/nft/linea_culture_4_1_coop_records.py +0 -60
- core/modules/nft/linea_culture_4_2_borja_moskv.py +0 -65
- core/modules/nft/linea_culture_4_2_borja_moskv_approve.py +0 -27
- core/modules/nft/linea_culture_4_3_fruit.py +0 -66
- core/modules/nft/linea_culture_4_4_fruit_crux.py +0 -67
- core/modules/nft/linea_culture_4_5_forbidden_fruit.py +0 -67
- core/modules/nft/linea_culture_4_6_laurent.py +0 -67
- core/modules/nft/linea_culture_day2.py +0 -20
- core/modules/nft/linea_culture_day3.py +0 -20
- core/modules/nft/linea_ens_names.py +0 -107
- core/modules/nft/lucky_cat.py +0 -25
- core/modules/nft/merkly_minter_module.py +0 -22
- core/modules/nft/micro3.py +0 -23
- core/modules/nft/mint_2048.py +0 -28
- core/modules/nft/nft_submodule.py +0 -16
- core/modules/nft/nidum.py +0 -87
- core/modules/nft/nidum_bonus.py +0 -23
- core/modules/nft/nomis.py +0 -64
- core/modules/nft/nomis_attest.py +0 -66
- core/modules/nft/nouns.py +0 -27
- core/modules/nft/octomos.py +0 -32
- core/modules/nft/omnisea.py +0 -33
- core/modules/nft/omnizone.py +0 -25
- core/modules/nft/orbiter_claim.py +0 -87
- core/modules/nft/readon.py +0 -30
- core/modules/nft/rubyscore.py +0 -45
- core/modules/nft/sarubol.py +0 -22
- core/modules/nft/satoshi_universe.py +0 -22
- core/modules/nft/scroll_canvas_attest_year_badge.py +0 -35
- core/modules/nft/scroll_canvas_mint.py +0 -51
- core/modules/nft/sign.py +0 -32
- core/modules/nft/snap.py +0 -25
- core/modules/nft/snap_bonus.py +0 -31
- core/modules/nft/social_scan.py +0 -22
- core/modules/nft/sub_module.py +0 -8
- core/modules/nft/tavaera.py +0 -30
- core/modules/nft/townstory.py +0 -75
- core/modules/nft/townstory_bonus.py +0 -45
- core/modules/nft/trusta_reputation.py +0 -48
- core/modules/nft/trustaa_poh.py +0 -49
- core/modules/nft/uber_poh.py +0 -24
- core/modules/nft/wizards_of_linea.py +0 -26
- core/modules/nft/yoddlo.py +0 -22
- core/modules/nft/yuliverse.py +0 -22
- core/modules/nft/zace.py +0 -25
- core/modules/nft/zks_domain.py +0 -41
- core/modules/nft_minter.py +0 -107
- core/modules/orbiter.py +0 -39
- core/modules/orbiter_checker.py +0 -26
- core/modules/rage.py +0 -54
- core/modules/scroll_bridge.py +0 -45
- core/modules/sell_all.py +0 -51
- core/modules/sleep_module.py +0 -25
- core/modules/smart_contract_deployment.py +0 -37
- core/modules/stargate/__init__.py +0 -0
- core/modules/stargate/auto_bridge.py +0 -91
- core/modules/stargate/bridge.py +0 -38
- core/modules/stargate/bridge_eth.py +0 -59
- core/modules/stargate/bridge_tokens.py +0 -48
- core/modules/stargate/classic_bridge.py +0 -34
- core/modules/stargate/farming.py +0 -163
- core/modules/stargate/l0_data.py +0 -10
- core/modules/stargate/pool.py +0 -74
- core/modules/stargate/stargate_balance_utils.py +0 -25
- core/modules/stargate/stargate_gas_checker.py +0 -68
- core/modules/swap/__init__.py +0 -1
- core/modules/swap/horizondex.py +0 -38
- core/modules/swap/izumi.py +0 -41
- core/modules/swap/lineaswap.py +0 -34
- core/modules/swap/maverick.py +0 -66
- core/modules/swap/mute.py +0 -39
- core/modules/swap/odos.py +0 -58
- core/modules/swap/one_inch.py +0 -58
- core/modules/swap/pancake.py +0 -41
- core/modules/swap/swap_facade.py +0 -10
- core/modules/swap/syncswap.py +0 -62
- core/modules/swap/velocore.py +0 -40
- core/modules/swap/woofi.py +0 -38
- core/modules/swap/xy_finance.py +0 -43
- core/modules/swap/zebra.py +0 -32
- core/modules/warm_up.py +0 -98
- core/modules/wrapping.py +0 -74
- core/modules/zkdx.py +0 -63
- tests/core/__init__.py +0 -0
- tests/core/contracts/__init__.py +0 -0
- tests/core/contracts/test_horizondex_quoter.py +0 -37
- tests/core/contracts/test_uniswap_quoter.py +0 -35
- tests/core/contracts/test_velocore_lens.py +0 -67
- tests/core/contracts/test_velocore_pool.py +0 -57
- tests/core/modules/__init__.py +0 -67
- tests/core/modules/swap/__init__.py +0 -0
- tests/core/modules/swap/test_horizondex.py +0 -37
- tests/core/modules/swap/test_lineaswap.py +0 -28
- tests/core/modules/swap/test_maverick.py +0 -31
- tests/core/modules/swap/test_mute.py +0 -29
- tests/core/modules/swap/test_odos.py +0 -36
- tests/core/modules/swap/test_pancake.py +0 -54
- tests/core/modules/swap/test_syncswap.py +0 -59
- tests/core/modules/swap/test_velocore.py +0 -33
- tests/core/modules/swap/test_woofi.py +0 -22
- tests/core/modules/test_bungee.py +0 -27
- tests/core/modules/test_concrete_swap.py +0 -62
- tests/core/modules/test_dmail.py +0 -41
- tests/core/modules/test_lending.py +0 -122
- tests/core/modules/test_nft.py +0 -32
- tests/core/modules/test_nft_minter.py +0 -30
- tests/core/modules/test_orbiter.py +0 -28
- tests/core/modules/test_sellall.py +0 -27
- tests/core/modules/test_send_to_cex.py +0 -27
- tests/core/modules/test_stargate_auto_bridge.py +0 -32
- tests/core/modules/test_stargate_bridge.py +0 -25
- tests/core/modules/test_stargate_farming.py +0 -108
- tests/core/modules/test_warmup.py +0 -78
- tests/core/modules/test_wrapping.py +0 -68
- tests/core/scenario/__init__.py +0 -0
- tests/core/scenario/module_0_test_config.py +0 -91
- tests/core/test_app.py +0 -19
- tests/core/test_config.py +0 -34
- web3_wizzard_lib/core/modules/modules.py +0 -27
- web3_wizzard_lib/core/modules/nft/sub_module.py +0 -8
- web3_wizzard_lib/core/modules/swap/swap_facade.py +0 -10
- {web3_wizzard_lib-0.0.2.data → web3_wizzard_lib-0.0.3.data}/data/requirements.txt +0 -0
- {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.0.3.dist-info}/top_level.txt +0 -0
core/modules/bungee.py
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
from typing import Union
|
2
|
-
|
3
|
-
import requests
|
4
|
-
from loguru import logger
|
5
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
6
|
-
from sybil_engine.data.networks import get_chain_instance
|
7
|
-
from sybil_engine.domain.balance.balance_utils import get_native_balance, interval_to_eth_balance, from_wei_to_eth
|
8
|
-
from sybil_engine.module.module import Module
|
9
|
-
from sybil_engine.utils.utils import ConfigurationException
|
10
|
-
from sybil_engine.utils.validation_utils import validate_chain, validate_refuel_interval
|
11
|
-
from sybil_engine.utils.web3_utils import init_web3
|
12
|
-
|
13
|
-
from web3_wizzard_lib.core.contract.bungee import bungee_chain_ids, Bungee
|
14
|
-
|
15
|
-
|
16
|
-
class BungeeRefuel(Module):
|
17
|
-
module_name = 'BUNGEE'
|
18
|
-
module_config = 'bungee_config'
|
19
|
-
|
20
|
-
def execute(self, refuel_amount_interval, from_chain, to_chain, account):
|
21
|
-
from_chain_instance = get_chain_instance(from_chain)
|
22
|
-
web3 = init_web3(from_chain_instance, account.proxy)
|
23
|
-
|
24
|
-
bungee_contract = get_contracts_for_chain(from_chain)['BUNGEE']
|
25
|
-
bungee = Bungee(bungee_contract, web3)
|
26
|
-
|
27
|
-
try:
|
28
|
-
limits = self.get_bungee_limits(from_chain)
|
29
|
-
|
30
|
-
to_chain_limits = [
|
31
|
-
chain for chain in limits if chain["chainId"] == bungee_chain_ids[to_chain] and chain["isEnabled"]
|
32
|
-
]
|
33
|
-
|
34
|
-
if to_chain_limits:
|
35
|
-
min_amount = float(from_wei_to_eth(int(to_chain_limits[0]["minAmount"])))
|
36
|
-
max_amount = float(from_wei_to_eth(int(to_chain_limits[0]["maxAmount"])))
|
37
|
-
|
38
|
-
if refuel_amount_interval == 'max':
|
39
|
-
refuel_amount_interval = {'from': max_amount * 0.9, 'to': max_amount * 0.98}
|
40
|
-
|
41
|
-
if refuel_amount_interval == '':
|
42
|
-
refuel_amount_interval = {'from': min_amount, 'to': max_amount}
|
43
|
-
|
44
|
-
if refuel_amount_interval['from'] < min_amount:
|
45
|
-
raise ConfigurationException(
|
46
|
-
f'Min refuel amount for {from_chain} is {min_amount} < {refuel_amount_interval["from"]}')
|
47
|
-
|
48
|
-
if refuel_amount_interval['to'] > max_amount:
|
49
|
-
raise ConfigurationException(
|
50
|
-
f'Max refuel amount for {from_chain} is {max_amount} > {refuel_amount_interval["to"]}')
|
51
|
-
|
52
|
-
native_without_min = get_native_balance(account, web3, from_chain_instance).minus(
|
53
|
-
self.min_native_balance)
|
54
|
-
|
55
|
-
amount = interval_to_eth_balance(refuel_amount_interval, account, from_chain, web3)
|
56
|
-
|
57
|
-
if amount.wei > native_without_min.wei:
|
58
|
-
amount = native_without_min
|
59
|
-
|
60
|
-
logger.info(f"Refuel {from_chain.title()} > {to_chain.title()} | {amount}")
|
61
|
-
|
62
|
-
bungee.refuel(account, to_chain, amount.wei)
|
63
|
-
else:
|
64
|
-
logger.info("skip")
|
65
|
-
except Exception as e:
|
66
|
-
logger.error(f"Bungee refuel error | error {e}")
|
67
|
-
|
68
|
-
def get_bungee_limits(self, from_chain) -> Union[dict, bool]:
|
69
|
-
bungee_data = self.get_bungee_data()
|
70
|
-
|
71
|
-
try:
|
72
|
-
if from_chain == 'ZKSYNC':
|
73
|
-
limits = [chain_data for chain_data in bungee_data if chain_data["name"] == "zkSync"][0]["limits"]
|
74
|
-
elif from_chain == 'ARBITRUM':
|
75
|
-
limits = [chain_data for chain_data in bungee_data if chain_data["name"] == "Arbitrum"][0]["limits"]
|
76
|
-
elif from_chain == 'OPTIMISM':
|
77
|
-
limits = [chain_data for chain_data in bungee_data if chain_data["name"] == "Optimism"][0]["limits"]
|
78
|
-
elif from_chain == 'POLYGON':
|
79
|
-
limits = [chain_data for chain_data in bungee_data if chain_data["name"] == "Polygon"][0]["limits"]
|
80
|
-
elif from_chain == 'AVALANCHE':
|
81
|
-
limits = [chain_data for chain_data in bungee_data if chain_data["name"] == "Avalanche"][0]["limits"]
|
82
|
-
elif from_chain == 'BSC':
|
83
|
-
limits = [chain_data for chain_data in bungee_data if chain_data["name"] == "BSC"][0]["limits"]
|
84
|
-
elif from_chain == 'BASE':
|
85
|
-
limits = [chain_data for chain_data in bungee_data if chain_data["name"] == "Base"][0]["limits"]
|
86
|
-
else:
|
87
|
-
raise Exception("Not supported")
|
88
|
-
|
89
|
-
return limits
|
90
|
-
except Exception as e:
|
91
|
-
return False
|
92
|
-
|
93
|
-
def get_bungee_data(self):
|
94
|
-
url = "https://refuel.socket.tech/chains"
|
95
|
-
response = requests.get(url)
|
96
|
-
if response.status_code == 200:
|
97
|
-
data = response.json()["result"]
|
98
|
-
return data
|
99
|
-
return False
|
100
|
-
|
101
|
-
def log(self):
|
102
|
-
return "BUNGEE REFUEL"
|
103
|
-
|
104
|
-
def parse_params(self, module_params):
|
105
|
-
validate_chain(module_params['from_chain'])
|
106
|
-
validate_chain(module_params['to_chain'])
|
107
|
-
validate_refuel_interval(module_params['refuel_amount_interval'])
|
108
|
-
|
109
|
-
return module_params['refuel_amount_interval'], module_params['from_chain'], module_params['to_chain']
|
core/modules/cex_sender.py
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
from loguru import logger
|
2
|
-
from sybil_engine.contract.send import Send
|
3
|
-
from sybil_engine.data.networks import get_chain_instance
|
4
|
-
from sybil_engine.domain.balance.balance_utils import interval_to_native_balance, 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.accumulator import add_accumulator_native_balance
|
8
|
-
from sybil_engine.utils.retry import retry
|
9
|
-
from sybil_engine.utils.validation_utils import validate_chain, validate_amount_interval
|
10
|
-
from sybil_engine.utils.web3_utils import init_web3
|
11
|
-
|
12
|
-
|
13
|
-
class SendToCex(Module):
|
14
|
-
module_name = 'SEND_TO_CEX'
|
15
|
-
module_config = 'send_to_cex_config'
|
16
|
-
supported_chains = ['USDC', 'USDT', 'ZK', 'ZRO', 'OBT']
|
17
|
-
|
18
|
-
def execute(self, chain, send_to_cex_amount_interval, token, account):
|
19
|
-
cex_address = account.cex_address
|
20
|
-
chain_instance = get_chain_instance(chain)
|
21
|
-
web3 = init_web3(chain_instance, account.proxy)
|
22
|
-
|
23
|
-
if token == 'NATIVE':
|
24
|
-
amount = interval_to_native_balance(send_to_cex_amount_interval, account, chain_instance['chain'], web3)
|
25
|
-
|
26
|
-
if send_to_cex_amount_interval == 'all_balance':
|
27
|
-
amount = amount.minus(self.min_native_balance)
|
28
|
-
elif token in self.supported_chains:
|
29
|
-
amount = interval_to_erc20_balance(send_to_cex_amount_interval, account, token, chain, web3)
|
30
|
-
else:
|
31
|
-
raise Exception(f"Token {token} not supported. Only NATIVE and USDC/USDT are supported.")
|
32
|
-
|
33
|
-
if amount.wei == 0 :
|
34
|
-
logger.info("Wallet is empty")
|
35
|
-
return
|
36
|
-
|
37
|
-
self.send_funds(account, amount, cex_address, chain, chain_instance, token, web3)
|
38
|
-
|
39
|
-
add_accumulator_native_balance("Total sent to cex", amount.wei)
|
40
|
-
|
41
|
-
@retry(max_attempts=5, retry_interval={'from': 60 * 2, 'to': 60 * 3})
|
42
|
-
def send_funds(self, account, amount, cex_address, chain, chain_instance, token, web3):
|
43
|
-
logger.info(f"Send {amount} to {cex_address} ({chain_instance['chain']})")
|
44
|
-
if token == 'NATIVE':
|
45
|
-
send = Send(None, web3)
|
46
|
-
send.send_to_wallet(account, cex_address, amount)
|
47
|
-
elif token in self.supported_chains:
|
48
|
-
erc20_token = Erc20Token(chain, token, web3)
|
49
|
-
erc20_token.transfer(amount, cex_address, account)
|
50
|
-
else:
|
51
|
-
raise Exception(f"Token {token} not supported. Only NATIVE and USDC/USDT are supported.")
|
52
|
-
|
53
|
-
def log(self):
|
54
|
-
return "SEND TO CEX"
|
55
|
-
|
56
|
-
def parse_params(self, module_params):
|
57
|
-
validate_chain(module_params['chain'])
|
58
|
-
validate_amount_interval(module_params['amount'])
|
59
|
-
|
60
|
-
return module_params['chain'], module_params['amount'], module_params['token']
|
@@ -1,34 +0,0 @@
|
|
1
|
-
from sybil_engine.config.app_config import get_cex_data, get_cex_conf
|
2
|
-
from sybil_engine.domain.cex.binance import Binance
|
3
|
-
from sybil_engine.domain.cex.okx import OKX
|
4
|
-
from sybil_engine.module.module import Module
|
5
|
-
from sybil_engine.utils.app_account_utils import AppAccount
|
6
|
-
from sybil_engine.utils.utils import ConfigurationException
|
7
|
-
|
8
|
-
|
9
|
-
class CEXSubAccountTransfer(Module):
|
10
|
-
module_name = 'CEX_SUB_ACCOUNT_TRANSFER'
|
11
|
-
module_config = 'cex_account_transfer_config'
|
12
|
-
|
13
|
-
def execute(self, cex, account: AppAccount):
|
14
|
-
password, cex_data = get_cex_data()
|
15
|
-
|
16
|
-
tokens = ['ETH', 'CORE', 'POL', 'USDC', 'USDT', 'OKB', 'ZRO']
|
17
|
-
|
18
|
-
if cex == 'okx':
|
19
|
-
cex_obj = OKX(cex_data[get_cex_conf()], password)
|
20
|
-
elif cex == 'binance':
|
21
|
-
cex_obj = Binance(cex_data[get_cex_conf()], password)
|
22
|
-
else:
|
23
|
-
raise ConfigurationException(f"{cex} is not")
|
24
|
-
|
25
|
-
cex_obj.transfer_from_sub_account(tokens)
|
26
|
-
|
27
|
-
def log(self):
|
28
|
-
return "CEX SUB ACCOUNT TRANSFER"
|
29
|
-
|
30
|
-
def parse_params(self, module_params):
|
31
|
-
if 'cex' not in module_params:
|
32
|
-
module_params['cex'] = 'okx'
|
33
|
-
|
34
|
-
return [module_params['cex']]
|
core/modules/cex_withdraw.py
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
import random
|
2
|
-
|
3
|
-
from loguru import logger
|
4
|
-
from sybil_engine.config.app_config import get_cex_data, get_cex_conf
|
5
|
-
from sybil_engine.data.networks import get_chain_instance
|
6
|
-
from sybil_engine.domain.balance.balance_utils import get_native_balance, \
|
7
|
-
interval_to_native_balance, interval_to_erc20_balance
|
8
|
-
from sybil_engine.domain.balance.tokens import Erc20Token
|
9
|
-
from sybil_engine.domain.cex.binance import Binance
|
10
|
-
from sybil_engine.domain.cex.okx import OKX
|
11
|
-
from sybil_engine.module.module import Module
|
12
|
-
from sybil_engine.utils.app_account_utils import AppAccount
|
13
|
-
from sybil_engine.utils.utils import randomized_sleeping, ConfigurationException
|
14
|
-
from sybil_engine.utils.web3_utils import init_web3
|
15
|
-
|
16
|
-
|
17
|
-
class CEXWithdraw(Module):
|
18
|
-
module_name = 'CEX_WITHDRAW'
|
19
|
-
sleep_after_conf = True
|
20
|
-
module_config = 'cex_withdraw'
|
21
|
-
|
22
|
-
def execute(self, chain, withdraw_interval, min_auto_withdraw_interval, token, cex, account: AppAccount):
|
23
|
-
self.sleep_after_conf = True
|
24
|
-
chain_instance = get_chain_instance(chain)
|
25
|
-
web3 = init_web3(chain_instance, None)
|
26
|
-
|
27
|
-
balance, min_auto_withdraw, withdraw_token = self.balance(account, chain, chain_instance,
|
28
|
-
min_auto_withdraw_interval, token, web3)
|
29
|
-
logger.info(f"{chain}")
|
30
|
-
logger.info(f"Minimum balance should be {min_auto_withdraw}")
|
31
|
-
|
32
|
-
if min_auto_withdraw.wei < balance.wei:
|
33
|
-
self.sleep_after_conf = False
|
34
|
-
|
35
|
-
while min_auto_withdraw.wei > balance.wei:
|
36
|
-
logger.info(f"Actual balance: {balance}")
|
37
|
-
|
38
|
-
amount = round(random.uniform(withdraw_interval['from'], withdraw_interval['to']), 6)
|
39
|
-
logger.info(f"Withdraw {amount} {chain_instance['gas_token']} from {cex} to {account.address}")
|
40
|
-
|
41
|
-
password, cex_data = get_cex_data()
|
42
|
-
|
43
|
-
if cex == 'okx':
|
44
|
-
cex_obj = OKX(cex_data[get_cex_conf()], password)
|
45
|
-
elif cex == 'binance':
|
46
|
-
cex_obj = Binance(cex_data[get_cex_conf()], password)
|
47
|
-
else:
|
48
|
-
raise ConfigurationException(f"{cex} is not")
|
49
|
-
|
50
|
-
if withdraw_token == 'WETH':
|
51
|
-
withdraw_token = 'ETH'
|
52
|
-
|
53
|
-
cex_obj.withdrawal(account.address, chain, amount, withdraw_token)
|
54
|
-
|
55
|
-
randomized_sleeping({'from': 60 * 2, 'to': 60 * 4})
|
56
|
-
|
57
|
-
balance, _, _ = self.balance(account, chain, chain_instance, min_auto_withdraw_interval, token, web3)
|
58
|
-
|
59
|
-
def balance(self, account, chain, chain_instance, min_auto_withdraw_interval, token, web3):
|
60
|
-
if token == 'NATIVE':
|
61
|
-
min_auto_withdraw = interval_to_native_balance(min_auto_withdraw_interval, account, chain, web3)
|
62
|
-
balance = get_native_balance(account, web3, chain_instance)
|
63
|
-
withdraw_token = chain_instance['gas_token']
|
64
|
-
elif token in ['USDC', 'USDT', 'WETH', 'ETH']:
|
65
|
-
if token == 'ETH':
|
66
|
-
token = 'WETH'
|
67
|
-
min_auto_withdraw = interval_to_erc20_balance(min_auto_withdraw_interval, account, token, chain, web3)
|
68
|
-
erc20_token = Erc20Token(chain, token, web3)
|
69
|
-
balance = erc20_token.balance(account)
|
70
|
-
withdraw_token = token
|
71
|
-
else:
|
72
|
-
raise ConfigurationException(f"Unsupported token {token}, supported tokens are: NATIVE, USDC")
|
73
|
-
return balance, min_auto_withdraw, withdraw_token
|
74
|
-
|
75
|
-
def log(self):
|
76
|
-
return "CEX WITHDRAW"
|
77
|
-
|
78
|
-
def parse_params(self, module_params):
|
79
|
-
if 'cex' not in module_params:
|
80
|
-
module_params['cex'] = 'okx'
|
81
|
-
|
82
|
-
return [
|
83
|
-
module_params['chain'],
|
84
|
-
module_params['withdraw_interval'],
|
85
|
-
module_params['min_auto_withdraw_interval'],
|
86
|
-
module_params['token'],
|
87
|
-
module_params['cex']
|
88
|
-
]
|
89
|
-
|
90
|
-
def sleep_after(self):
|
91
|
-
return self.sleep_after_conf
|
core/modules/claimer.py
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
from loguru import logger
|
2
|
-
from sybil_engine.data.networks import get_chain_instance
|
3
|
-
from sybil_engine.module.module import Module
|
4
|
-
from sybil_engine.utils.app_account_utils import AppAccount
|
5
|
-
from sybil_engine.utils.web3_utils import init_web3
|
6
|
-
|
7
|
-
from web3_wizzard_lib.core.modules import claimer_zro
|
8
|
-
from web3_wizzard_lib.core.modules.claims.rabby_claimer import claimer_rabby
|
9
|
-
|
10
|
-
native_prices = {
|
11
|
-
'ETH': 3700,
|
12
|
-
'USDT': 1
|
13
|
-
}
|
14
|
-
|
15
|
-
|
16
|
-
class Claimer(Module):
|
17
|
-
module_name = 'CLAIMER'
|
18
|
-
sleep_after_conf = True
|
19
|
-
module_config = 'claimer_config'
|
20
|
-
|
21
|
-
def execute(self, chain, layerzero_token, project, account: AppAccount):
|
22
|
-
logger.info(f"CLAIM L0 tokens for {account} on {chain}")
|
23
|
-
chain_instance = get_chain_instance(chain)
|
24
|
-
web3 = init_web3(chain_instance, None)
|
25
|
-
|
26
|
-
if project == 'ZRO':
|
27
|
-
claimer_zro(account, chain_instance, layerzero_token, web3)
|
28
|
-
else:
|
29
|
-
claimer_rabby(account, web3)
|
30
|
-
|
31
|
-
def log(self):
|
32
|
-
return "CLAIMER"
|
33
|
-
|
34
|
-
def parse_params(self, module_params):
|
35
|
-
if 'project' not in module_params:
|
36
|
-
module_params['project'] = 'ZRO'
|
37
|
-
|
38
|
-
return [
|
39
|
-
module_params['chain'],
|
40
|
-
module_params['token'],
|
41
|
-
module_params['project']
|
42
|
-
]
|
43
|
-
|
44
|
-
def sleep_after(self):
|
45
|
-
return self.sleep_after_conf
|
core/modules/claims/__init__.py
DELETED
File without changes
|
@@ -1,64 +0,0 @@
|
|
1
|
-
import requests
|
2
|
-
from loguru import logger
|
3
|
-
from sybil_engine.config.app_config import get_cex_conf, get_cex_data
|
4
|
-
from sybil_engine.domain.balance.balance import NativeBalance, Erc20Balance
|
5
|
-
from sybil_engine.domain.balance.balance_utils import get_native_balance
|
6
|
-
from sybil_engine.domain.balance.tokens import Erc20Token
|
7
|
-
from sybil_engine.domain.cex.okx import OKX
|
8
|
-
|
9
|
-
total_zro = 0
|
10
|
-
|
11
|
-
def claimer_zro(account, chain_instance, token, web3):
|
12
|
-
allocation_data = get_allocation(account.address)
|
13
|
-
if not allocation_data:
|
14
|
-
raise Exception("Failed to fetch allocation data.")
|
15
|
-
amount_raw = int(allocation_data.get('zroAllocation', {}).get('asBigInt'))
|
16
|
-
logger.info(f"ZRO Allocation for {account.address} is {amount_raw}")
|
17
|
-
if token == 'NATIVE':
|
18
|
-
withdraw_token = chain_instance['gas_token']
|
19
|
-
claim_price = NativeBalance(int((round(amount_raw / 10 ** 18) + 1) * 0.00005 * 10 ** 18),
|
20
|
-
chain_instance['chain'], token)
|
21
|
-
balance = get_native_balance(account, web3, chain_instance)
|
22
|
-
logger.info(f"Native balance is {balance}")
|
23
|
-
else:
|
24
|
-
claim_price = Erc20Balance(
|
25
|
-
int((round(amount_raw / 10 ** 18) + 1) * 0.00003 * 10 ** 18),
|
26
|
-
chain_instance['chain'],
|
27
|
-
token,
|
28
|
-
decimal=18
|
29
|
-
)
|
30
|
-
withdraw_token = token
|
31
|
-
balance = Erc20Token(chain_instance['chain'], token, web3).balance(account)
|
32
|
-
logger.info(f"Native balance is {balance}")
|
33
|
-
logger.info(f"Need {claim_price} for claim")
|
34
|
-
if claim_price.wei > balance.wei:
|
35
|
-
password, cex_data = get_cex_data()
|
36
|
-
cex_obj = OKX(cex_data[get_cex_conf()], password)
|
37
|
-
cex_obj.withdrawal(account.address, chain_instance['chain'], float(balance.readable()), withdraw_token)
|
38
|
-
|
39
|
-
proof = get_proof(account.address)
|
40
|
-
logger.info(proof)
|
41
|
-
global total_zro
|
42
|
-
total_zro = total_zro + int(proof['amount'])
|
43
|
-
amount_to_claim = int(proof['amount'])
|
44
|
-
merkle_proof = proof['proof'].split('|')
|
45
|
-
#contract_address = get_contracts_for_chain(chain_instance['chain'])['ZRO_CLAIMER']
|
46
|
-
#claimer = L0Claim(contract_address, web3)
|
47
|
-
#claimer.donateAndClaim(account, claim_price.wei, amount_to_claim, merkle_proof)
|
48
|
-
|
49
|
-
def get_proof(wallet):
|
50
|
-
url = f"https://www.layerzero.foundation/api/proof/{wallet}?address={wallet}"
|
51
|
-
response = requests.get(url)
|
52
|
-
if response.status_code == 200:
|
53
|
-
return response.json()
|
54
|
-
else:
|
55
|
-
return None
|
56
|
-
|
57
|
-
|
58
|
-
def get_allocation(wallet):
|
59
|
-
url = f"https://www.layerzero.foundation/api/allocation/{wallet}"
|
60
|
-
response = requests.get(url)
|
61
|
-
if response.status_code == 200:
|
62
|
-
return response.json()
|
63
|
-
else:
|
64
|
-
return None
|
@@ -1,81 +0,0 @@
|
|
1
|
-
import time
|
2
|
-
from random import randint
|
3
|
-
|
4
|
-
from eth_account.messages import encode_defunct, SignableMessage
|
5
|
-
from fake_useragent import UserAgent
|
6
|
-
from loguru import logger
|
7
|
-
|
8
|
-
import requests
|
9
|
-
from sybil_engine.utils.utils import randomized_sleeping
|
10
|
-
|
11
|
-
url = "https://api.rabby.io/v2/points/claim_snapshot"
|
12
|
-
|
13
|
-
headers = {
|
14
|
-
"Host": "api.rabby.io",
|
15
|
-
"Connection": "keep-alive",
|
16
|
-
"Content-Length": "224",
|
17
|
-
"sec-ch-ua": '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
|
18
|
-
"X-Version": "0.92.48",
|
19
|
-
"sec-ch-ua-mobile": "?0",
|
20
|
-
"User-Agent": UserAgent().random,
|
21
|
-
"x-api-ts": str(int(time.time())),
|
22
|
-
"Content-Type": "application/json",
|
23
|
-
"x-api-ver": "v2",
|
24
|
-
"Accept": "application/json, text/plain, */*",
|
25
|
-
"X-Client": "Rabby",
|
26
|
-
"sec-ch-ua-platform": '"Windows"',
|
27
|
-
"Origin": "chrome-extension://acmacodkjb dgmoleebolmdjonilkdbch",
|
28
|
-
"Sec-Fetch-Site": "none",
|
29
|
-
"Sec-Fetch-Mode": "cors",
|
30
|
-
"Sec-Fetch-Dest": "empty",
|
31
|
-
"Accept-Encoding": "gzip, deflate, br",
|
32
|
-
"Accept-Language": "uk-UA,uk;q=0.9,en-US;q=0.8,en;q=0.7",
|
33
|
-
}
|
34
|
-
|
35
|
-
|
36
|
-
def claimer_rabby(account, web3):
|
37
|
-
try:
|
38
|
-
address = account.address.lower()
|
39
|
-
msg = f"{address} Claims Rabby Points"
|
40
|
-
|
41
|
-
payload = {
|
42
|
-
"id": address,
|
43
|
-
"signature": get_signed_code(web3, account, msg),
|
44
|
-
"invite_code": "FREEBONUS"
|
45
|
-
}
|
46
|
-
|
47
|
-
proxies = {}
|
48
|
-
proxies.update(
|
49
|
-
{"http": account.proxy,
|
50
|
-
"https": account.proxy}
|
51
|
-
)
|
52
|
-
|
53
|
-
response = make_request_with_retries(url, headers=headers, json=payload, proxies=proxies)
|
54
|
-
|
55
|
-
if response.json().get("error_code") == 0:
|
56
|
-
logger.success(f"{address} | Claimed!")
|
57
|
-
else:
|
58
|
-
resp_msg = response.json().get("error_msg")
|
59
|
-
logger.info(f"{address} | {resp_msg} | {response.json()}")
|
60
|
-
except Exception as e:
|
61
|
-
logger.error(f"{account}... | {e}")
|
62
|
-
|
63
|
-
|
64
|
-
def sign(web3, account, encoded_msg: SignableMessage):
|
65
|
-
return web3.eth.account.sign_message(encoded_msg, account.key)
|
66
|
-
|
67
|
-
|
68
|
-
def get_signed_code(web3, account, msg) -> str:
|
69
|
-
return sign(web3, account, encode_defunct(text=msg)).signature.hex()
|
70
|
-
|
71
|
-
def make_request_with_retries(url, headers, json, proxies, max_retries=5):
|
72
|
-
for attempt in range(max_retries):
|
73
|
-
response = requests.post(url, headers=headers, json=json, proxies=proxies)
|
74
|
-
if response.status_code == 429:
|
75
|
-
retry_after = int(response.headers.get("Retry-After", randint(1, 5)))
|
76
|
-
logger.info(f"Rate limited. Retrying after {retry_after} seconds. Attempt {attempt + 1}/{max_retries}")
|
77
|
-
time.sleep(retry_after)
|
78
|
-
else:
|
79
|
-
return response
|
80
|
-
logger.error("Max retries reached. Giving up.")
|
81
|
-
return None
|
core/modules/concrete_swap.py
DELETED
@@ -1,97 +0,0 @@
|
|
1
|
-
import random
|
2
|
-
|
3
|
-
from loguru import logger
|
4
|
-
from sybil_engine.data.networks import get_chain_instance
|
5
|
-
from sybil_engine.domain.balance.balance_utils import verify_balance, amount_to_swap_from_interval
|
6
|
-
from sybil_engine.domain.balance.tokens import Erc20Token
|
7
|
-
from sybil_engine.module.module import Module
|
8
|
-
from sybil_engine.utils.utils import SwapException
|
9
|
-
from sybil_engine.utils.validation_utils import validate_amount_interval, validate_token
|
10
|
-
from sybil_engine.utils.web3_utils import init_web3
|
11
|
-
|
12
|
-
from web3_wizzard_lib.core.modules import swap_facade
|
13
|
-
|
14
|
-
|
15
|
-
class ConcreteSwap(Module):
|
16
|
-
module_name = 'CONCRETE_SWAP'
|
17
|
-
module_config = 'swap_config'
|
18
|
-
allowed_chains = ['ZKSYNC', 'LINEA', 'BASE', 'SCROLL', 'ARBITRUM']
|
19
|
-
sleep_after_var = True
|
20
|
-
|
21
|
-
def execute(self, chain, amount_interval, from_token, to_token, swap_app, account):
|
22
|
-
if isinstance(swap_app, list):
|
23
|
-
swap_app = random.choice(swap_app)
|
24
|
-
|
25
|
-
self.sleep_after_var = True
|
26
|
-
chain_instance = get_chain_instance(chain)
|
27
|
-
web3 = init_web3(chain_instance, account.proxy)
|
28
|
-
|
29
|
-
native_balance = verify_balance(self.min_native_balance, chain_instance, account, web3)
|
30
|
-
|
31
|
-
from_token_contract = Erc20Token(chain, from_token, web3)
|
32
|
-
to_token_contract = Erc20Token(chain, to_token, web3)
|
33
|
-
|
34
|
-
pair_to_swap = self.create_pair_to_swap(
|
35
|
-
from_token_contract.symbol(),
|
36
|
-
swap_app,
|
37
|
-
to_token_contract.symbol(),
|
38
|
-
)
|
39
|
-
|
40
|
-
amount_to_swap = amount_to_swap_from_interval(
|
41
|
-
account,
|
42
|
-
chain,
|
43
|
-
self.min_native_balance,
|
44
|
-
native_balance,
|
45
|
-
amount_interval,
|
46
|
-
from_token,
|
47
|
-
web3
|
48
|
-
)
|
49
|
-
|
50
|
-
if amount_to_swap.wei < 100000:
|
51
|
-
logger.info("Low balance, ignore")
|
52
|
-
return
|
53
|
-
|
54
|
-
try:
|
55
|
-
swap_facade.swap(
|
56
|
-
account,
|
57
|
-
amount_to_swap,
|
58
|
-
chain_instance,
|
59
|
-
pair_to_swap,
|
60
|
-
swap_app,
|
61
|
-
from_token,
|
62
|
-
to_token,
|
63
|
-
web3
|
64
|
-
)
|
65
|
-
except SwapException as e:
|
66
|
-
logger.info(e.message)
|
67
|
-
self.sleep_after_var = False
|
68
|
-
|
69
|
-
def create_pair_to_swap(self, from_token, swap_app, to_token):
|
70
|
-
pair_to_swap = {
|
71
|
-
'name': f'{from_token}>{to_token}',
|
72
|
-
'tokens': [from_token, to_token],
|
73
|
-
'slippage': 2,
|
74
|
-
'app': swap_app
|
75
|
-
}
|
76
|
-
return pair_to_swap
|
77
|
-
|
78
|
-
def log(self):
|
79
|
-
return "SWAP"
|
80
|
-
|
81
|
-
def sleep_after(self):
|
82
|
-
return self.sleep_after_var
|
83
|
-
|
84
|
-
def parse_params(self, module_params):
|
85
|
-
self.validate_supported_chain(module_params['chain'])
|
86
|
-
validate_amount_interval(module_params['amount_interval'])
|
87
|
-
validate_token(module_params['from_token'])
|
88
|
-
validate_token(module_params['to_token'])
|
89
|
-
#validate_dex(module_params['app'])
|
90
|
-
|
91
|
-
return (
|
92
|
-
module_params['chain'],
|
93
|
-
module_params['amount_interval'],
|
94
|
-
module_params['from_token'],
|
95
|
-
module_params['to_token'],
|
96
|
-
module_params['app']
|
97
|
-
)
|
core/modules/coredao_bridge.py
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
from sybil_engine.module.module import Order, Module
|
2
|
-
|
3
|
-
from web3_wizzard_lib.core.modules.bridge.coredao_bridge_sub import CoreDaoBridgeSubModule
|
4
|
-
|
5
|
-
|
6
|
-
class CoreDaoBridge(Module):
|
7
|
-
module_name = 'COREDAO_BRIDGE'
|
8
|
-
allowed_chains = ['POLYGON', 'COREDAO']
|
9
|
-
module_config = 'coredao_bridge_config'
|
10
|
-
|
11
|
-
def execute(self, bridge_amount_interval, from_chain, to_chain, token, account):
|
12
|
-
CoreDaoBridgeSubModule().execute(
|
13
|
-
bridge_amount_interval,
|
14
|
-
from_chain,
|
15
|
-
to_chain,
|
16
|
-
token,
|
17
|
-
self.min_native_balance,
|
18
|
-
account
|
19
|
-
)
|
20
|
-
|
21
|
-
def log(self):
|
22
|
-
return "COREDAO BRIDGE"
|
23
|
-
|
24
|
-
def parse_params(self, module_params):
|
25
|
-
self.validate_supported_chain(module_params['from_chain'])
|
26
|
-
self.validate_supported_chain(module_params['to_chain'])
|
27
|
-
|
28
|
-
return module_params['bridge_amount_interval'], module_params['from_chain'], module_params['to_chain'], \
|
29
|
-
module_params['token']
|
30
|
-
|
31
|
-
def order(self):
|
32
|
-
return Order.RANDOM
|
@@ -1,39 +0,0 @@
|
|
1
|
-
from sybil_engine.module.module import Order, RepeatableModule
|
2
|
-
from sybil_engine.utils.utils import interval_to_int, randomized_sleeping
|
3
|
-
|
4
|
-
from web3_wizzard_lib.core.modules.bridge.coredao_bridge_sub import CoreDaoBridgeSubModule
|
5
|
-
|
6
|
-
|
7
|
-
class CoreDaoBridgeAuto(RepeatableModule):
|
8
|
-
module_name = 'COREDAO_BRIDGE_AUTO'
|
9
|
-
allowed_chains = ['POLYGON', 'COREDAO']
|
10
|
-
random_order = Order.RANDOM
|
11
|
-
repeat_conf = 'repeats'
|
12
|
-
module_config = 'coredao_bridge_auto_config'
|
13
|
-
|
14
|
-
@RepeatableModule.repeatable_log
|
15
|
-
def execute(self, from_chain, to_chain, bridge_amount_interval, token, sleep_interval, account):
|
16
|
-
CoreDaoBridgeSubModule().execute(bridge_amount_interval, from_chain, to_chain, token, account)
|
17
|
-
randomized_sleeping(sleep_interval)
|
18
|
-
CoreDaoBridgeSubModule().execute(bridge_amount_interval, to_chain, from_chain, token, account)
|
19
|
-
|
20
|
-
def log(self):
|
21
|
-
return "COREDAO BRIDGE AUTO"
|
22
|
-
|
23
|
-
def parse_params(self, module_params):
|
24
|
-
return [
|
25
|
-
module_params['from_chain'],
|
26
|
-
module_params['to_chain'],
|
27
|
-
module_params['bridge_amount_interval'],
|
28
|
-
module_params['token'],
|
29
|
-
module_params['sleep_interval'],
|
30
|
-
]
|
31
|
-
|
32
|
-
def order(self):
|
33
|
-
return Order.RANDOM
|
34
|
-
|
35
|
-
def repeats(self, module_params):
|
36
|
-
if self.repeat_conf not in module_params:
|
37
|
-
return 1
|
38
|
-
else:
|
39
|
-
return range(interval_to_int(module_params[self.repeat_conf]))
|