web3-wizzard-lib 1.6.11__py3-none-any.whl → 1.6.12__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-1.6.12.dist-info/METADATA +10 -0
- web3_wizzard_lib-1.6.12.dist-info/RECORD +107 -0
- web3_wizzard_lib-1.6.12.dist-info/top_level.txt +1 -0
- tests/__init__.py +0 -0
- web3_wizzard_lib/core/__init__.py +0 -1
- web3_wizzard_lib/core/contract/__init__.py +0 -0
- web3_wizzard_lib/core/contract/aavecontract.py +0 -36
- web3_wizzard_lib/core/contract/alienswap_contract.py +0 -21
- web3_wizzard_lib/core/contract/arena_games_contract.py +0 -16
- web3_wizzard_lib/core/contract/basiliskcontract.py +0 -58
- web3_wizzard_lib/core/contract/bilinear_contract.py +0 -22
- web3_wizzard_lib/core/contract/bungee.py +0 -33
- web3_wizzard_lib/core/contract/coredao_contract.py +0 -34
- web3_wizzard_lib/core/contract/coredao_from_contract.py +0 -40
- web3_wizzard_lib/core/contract/dmail_send_mail.py +0 -18
- web3_wizzard_lib/core/contract/empty_nft.py +0 -18
- web3_wizzard_lib/core/contract/era_name.py +0 -23
- web3_wizzard_lib/core/contract/eralendcontract.py +0 -34
- web3_wizzard_lib/core/contract/eth_scroll_bridge_contract.py +0 -25
- web3_wizzard_lib/core/contract/frog_war_contract.py +0 -48
- web3_wizzard_lib/core/contract/gmx_reward_router.py +0 -22
- web3_wizzard_lib/core/contract/horizondex_quoter.py +0 -14
- web3_wizzard_lib/core/contract/horizondex_router.py +0 -91
- web3_wizzard_lib/core/contract/imagine_contract.py +0 -18
- web3_wizzard_lib/core/contract/izumi.py +0 -63
- web3_wizzard_lib/core/contract/kreatorland_contract.py +0 -21
- web3_wizzard_lib/core/contract/l0_claim.py +0 -254
- web3_wizzard_lib/core/contract/l2_telegraph.py +0 -21
- web3_wizzard_lib/core/contract/layerbank_price.py +0 -18
- web3_wizzard_lib/core/contract/layerbank_token.py +0 -29
- web3_wizzard_lib/core/contract/layerbankcontract.py +0 -59
- web3_wizzard_lib/core/contract/linea_day_2_contract.py +0 -19
- web3_wizzard_lib/core/contract/linea_day_3_contract.py +0 -55
- web3_wizzard_lib/core/contract/linea_ens_names_contract.py +0 -55
- web3_wizzard_lib/core/contract/lineaswaprouter.py +0 -52
- web3_wizzard_lib/core/contract/maverick_multicall.py +0 -52
- web3_wizzard_lib/core/contract/mendi_finance_contract.py +0 -11
- web3_wizzard_lib/core/contract/mendi_token.py +0 -25
- web3_wizzard_lib/core/contract/merkly_minter.py +0 -47
- web3_wizzard_lib/core/contract/micro3_contract.py +0 -18
- web3_wizzard_lib/core/contract/mute_router.py +0 -93
- web3_wizzard_lib/core/contract/new_rage_contract.py +0 -31
- web3_wizzard_lib/core/contract/nidum_contract.py +0 -44
- web3_wizzard_lib/core/contract/nile_contract.py +0 -60
- web3_wizzard_lib/core/contract/nomis_attest_contract.py +0 -40
- web3_wizzard_lib/core/contract/nomis_contract.py +0 -40
- web3_wizzard_lib/core/contract/octomos.py +0 -31
- web3_wizzard_lib/core/contract/odos.py +0 -104
- web3_wizzard_lib/core/contract/omnisea.py +0 -29
- web3_wizzard_lib/core/contract/orbiter_starknet.py +0 -30
- web3_wizzard_lib/core/contract/pancake_pool.py +0 -19
- web3_wizzard_lib/core/contract/pancake_quoter.py +0 -20
- web3_wizzard_lib/core/contract/pancake_router.py +0 -72
- web3_wizzard_lib/core/contract/rage_claim.py +0 -24
- web3_wizzard_lib/core/contract/reactor_fusion_contract.py +0 -78
- web3_wizzard_lib/core/contract/readon_contract.py +0 -19
- web3_wizzard_lib/core/contract/rubyscore_contract.py +0 -31
- web3_wizzard_lib/core/contract/satoshi_universe_contract.py +0 -29
- web3_wizzard_lib/core/contract/scroll_bridge_contract.py +0 -24
- web3_wizzard_lib/core/contract/scroll_canvas_mint_contract.py +0 -26
- web3_wizzard_lib/core/contract/scroll_oracle.py +0 -11
- web3_wizzard_lib/core/contract/snap_contract.py +0 -16
- web3_wizzard_lib/core/contract/social_scan_contract.py +0 -20
- web3_wizzard_lib/core/contract/stargate_farming.py +0 -37
- web3_wizzard_lib/core/contract/stargate_router.py +0 -84
- web3_wizzard_lib/core/contract/stargate_router_eth.py +0 -41
- web3_wizzard_lib/core/contract/stargate_token_pool.py +0 -45
- web3_wizzard_lib/core/contract/stargate_v2_contract.py +0 -36
- web3_wizzard_lib/core/contract/syncswap_classic_pool.py +0 -15
- web3_wizzard_lib/core/contract/syncswap_classic_pool_factory.py +0 -15
- web3_wizzard_lib/core/contract/syncswap_pool.py +0 -25
- web3_wizzard_lib/core/contract/syncswap_router.py +0 -123
- web3_wizzard_lib/core/contract/tavaera_id.py +0 -18
- web3_wizzard_lib/core/contract/tavaera_mint.py +0 -17
- web3_wizzard_lib/core/contract/townstory_bonus_contract.py +0 -19
- web3_wizzard_lib/core/contract/townstory_contract.py +0 -21
- web3_wizzard_lib/core/contract/velocore_lens.py +0 -44
- web3_wizzard_lib/core/contract/velocore_pool.py +0 -198
- web3_wizzard_lib/core/contract/velocore_router.py +0 -80
- web3_wizzard_lib/core/contract/woofi_swap.py +0 -29
- web3_wizzard_lib/core/contract/xy_finance_contract.py +0 -87
- web3_wizzard_lib/core/contract/yoddlo_contract.py +0 -19
- web3_wizzard_lib/core/contract/yuliverse_contract.py +0 -36
- web3_wizzard_lib/core/contract/zebra_contract.py +0 -68
- web3_wizzard_lib/core/contract/zerolend_contract.py +0 -34
- web3_wizzard_lib/core/contract/zerolend_liq_contract.py +0 -20
- web3_wizzard_lib/core/contract/zkdx_contract.py +0 -40
- web3_wizzard_lib/core/contract/zkdx_data.py +0 -14
- web3_wizzard_lib/core/contract/zks.py +0 -24
- web3_wizzard_lib/core/modules/__init__.py +0 -0
- web3_wizzard_lib/core/modules/ads_import_proxy.py +0 -52
- web3_wizzard_lib/core/modules/airdrop_printer.py +0 -81
- web3_wizzard_lib/core/modules/bank/__init__.py +0 -0
- web3_wizzard_lib/core/modules/bank/aave.py +0 -25
- web3_wizzard_lib/core/modules/bank/bank.py +0 -15
- web3_wizzard_lib/core/modules/bank/basilisk.py +0 -25
- web3_wizzard_lib/core/modules/bank/eralend.py +0 -25
- web3_wizzard_lib/core/modules/bank/layerbank.py +0 -116
- web3_wizzard_lib/core/modules/bank/mendi_finance.py +0 -57
- web3_wizzard_lib/core/modules/bank/reactorfusion.py +0 -25
- web3_wizzard_lib/core/modules/bank/zerolend.py +0 -36
- web3_wizzard_lib/core/modules/bank_module.py +0 -99
- web3_wizzard_lib/core/modules/bridge/__init__.py +0 -0
- web3_wizzard_lib/core/modules/bridge/bridge.py +0 -8
- web3_wizzard_lib/core/modules/bridge/coredao_bridge_sub.py +0 -47
- web3_wizzard_lib/core/modules/bridge/orbiter_sub.py +0 -112
- web3_wizzard_lib/core/modules/bridge/scroll_bridge_sub.py +0 -42
- web3_wizzard_lib/core/modules/bridge/stargate_v2_sub.py +0 -74
- web3_wizzard_lib/core/modules/bridge_module.py +0 -47
- web3_wizzard_lib/core/modules/bungee.py +0 -109
- web3_wizzard_lib/core/modules/cex_sender.py +0 -60
- web3_wizzard_lib/core/modules/cex_subaccount_transfer.py +0 -34
- web3_wizzard_lib/core/modules/cex_withdraw.py +0 -91
- web3_wizzard_lib/core/modules/claimer.py +0 -45
- web3_wizzard_lib/core/modules/claims/__init__.py +0 -0
- web3_wizzard_lib/core/modules/claims/layerzero_claimer.py +0 -64
- web3_wizzard_lib/core/modules/claims/rabby_claimer.py +0 -81
- web3_wizzard_lib/core/modules/concrete_swap.py +0 -108
- web3_wizzard_lib/core/modules/coredao_bridge.py +0 -32
- web3_wizzard_lib/core/modules/coredao_bridge_auto.py +0 -39
- web3_wizzard_lib/core/modules/debank_checker.py +0 -78
- web3_wizzard_lib/core/modules/dmail.py +0 -54
- web3_wizzard_lib/core/modules/erc20_balance.py +0 -42
- web3_wizzard_lib/core/modules/gmx_reward.py +0 -25
- web3_wizzard_lib/core/modules/intract/__init__.py +0 -0
- web3_wizzard_lib/core/modules/intract/intract_api.py +0 -212
- web3_wizzard_lib/core/modules/intract/utils.py +0 -81
- web3_wizzard_lib/core/modules/intract_claim.py +0 -101
- web3_wizzard_lib/core/modules/layer_2_20.py +0 -65
- web3_wizzard_lib/core/modules/lending_module.py +0 -134
- web3_wizzard_lib/core/modules/linea_appeal.py +0 -98
- web3_wizzard_lib/core/modules/linea_poh_lxp.py +0 -65
- web3_wizzard_lib/core/modules/liquidity/__init__.py +0 -0
- web3_wizzard_lib/core/modules/liquidity/nile_pool.py +0 -64
- web3_wizzard_lib/core/modules/liquidity/pool.py +0 -16
- web3_wizzard_lib/core/modules/liquidity/syncswap_pool.py +0 -61
- web3_wizzard_lib/core/modules/liquidity/velocore_pool.py +0 -55
- web3_wizzard_lib/core/modules/liquidity/zerolend_liquidity.py +0 -26
- web3_wizzard_lib/core/modules/liquidity_pool.py +0 -60
- web3_wizzard_lib/core/modules/merkly_refuel.py +0 -87
- web3_wizzard_lib/core/modules/new_rage_withdraw.py +0 -41
- web3_wizzard_lib/core/modules/nft/__init__.py +0 -0
- web3_wizzard_lib/core/modules/nft/abbys_world.py +0 -22
- web3_wizzard_lib/core/modules/nft/acg_worlds.py +0 -25
- web3_wizzard_lib/core/modules/nft/alienswap_linea.py +0 -22
- web3_wizzard_lib/core/modules/nft/arena_games.py +0 -22
- web3_wizzard_lib/core/modules/nft/asmatch.py +0 -22
- web3_wizzard_lib/core/modules/nft/battlemon.py +0 -25
- web3_wizzard_lib/core/modules/nft/bilinear.py +0 -22
- web3_wizzard_lib/core/modules/nft/bitavatar.py +0 -25
- web3_wizzard_lib/core/modules/nft/culture_satoshi_universe.py +0 -24
- web3_wizzard_lib/core/modules/nft/efrogs.py +0 -26
- web3_wizzard_lib/core/modules/nft/empty_nft.py +0 -22
- web3_wizzard_lib/core/modules/nft/era_domain.py +0 -42
- web3_wizzard_lib/core/modules/nft/frog_war.py +0 -22
- web3_wizzard_lib/core/modules/nft/frog_war_bonus.py +0 -22
- web3_wizzard_lib/core/modules/nft/gamerboom.py +0 -25
- web3_wizzard_lib/core/modules/nft/gamerboom_bonus.py +0 -26
- web3_wizzard_lib/core/modules/nft/imagine.py +0 -32
- web3_wizzard_lib/core/modules/nft/kreatorland_module.py +0 -35
- web3_wizzard_lib/core/modules/nft/l2_telegraph_module.py +0 -22
- web3_wizzard_lib/core/modules/nft/layer3_meta.py +0 -25
- web3_wizzard_lib/core/modules/nft/linea_culture_2_2_linus.py +0 -24
- web3_wizzard_lib/core/modules/nft/linea_culture_2_3_yooldo.py +0 -24
- web3_wizzard_lib/core/modules/nft/linea_culture_2_4_frogwar.py +0 -24
- web3_wizzard_lib/core/modules/nft/linea_culture_2_5_acg.py +0 -25
- web3_wizzard_lib/core/modules/nft/linea_culture_2_6_ascend_the_end.py +0 -25
- web3_wizzard_lib/core/modules/nft/linea_culture_3_1_ascend_the_end.py +0 -25
- web3_wizzard_lib/core/modules/nft/linea_culture_3_2_sending_me.py +0 -25
- web3_wizzard_lib/core/modules/nft/linea_culture_3_3_townstory.py +0 -25
- web3_wizzard_lib/core/modules/nft/linea_culture_3_4_daniele.py +0 -25
- web3_wizzard_lib/core/modules/nft/linea_culture_3_5_demmortal.py +0 -25
- web3_wizzard_lib/core/modules/nft/linea_culture_3_6_foxy.py +0 -25
- web3_wizzard_lib/core/modules/nft/linea_culture_4_1_coop_records.py +0 -60
- web3_wizzard_lib/core/modules/nft/linea_culture_4_2_borja_moskv.py +0 -65
- web3_wizzard_lib/core/modules/nft/linea_culture_4_2_borja_moskv_approve.py +0 -27
- web3_wizzard_lib/core/modules/nft/linea_culture_4_3_fruit.py +0 -66
- web3_wizzard_lib/core/modules/nft/linea_culture_4_4_fruit_crux.py +0 -67
- web3_wizzard_lib/core/modules/nft/linea_culture_4_5_forbidden_fruit.py +0 -67
- web3_wizzard_lib/core/modules/nft/linea_culture_4_6_laurent.py +0 -67
- web3_wizzard_lib/core/modules/nft/linea_culture_day2.py +0 -20
- web3_wizzard_lib/core/modules/nft/linea_culture_day3.py +0 -20
- web3_wizzard_lib/core/modules/nft/linea_ens_names.py +0 -107
- web3_wizzard_lib/core/modules/nft/lucky_cat.py +0 -25
- web3_wizzard_lib/core/modules/nft/merkly_minter_module.py +0 -22
- web3_wizzard_lib/core/modules/nft/micro3.py +0 -23
- web3_wizzard_lib/core/modules/nft/mint_2048.py +0 -28
- web3_wizzard_lib/core/modules/nft/nft_submodule.py +0 -16
- web3_wizzard_lib/core/modules/nft/nidum.py +0 -87
- web3_wizzard_lib/core/modules/nft/nidum_bonus.py +0 -23
- web3_wizzard_lib/core/modules/nft/nomis.py +0 -64
- web3_wizzard_lib/core/modules/nft/nomis_attest.py +0 -66
- web3_wizzard_lib/core/modules/nft/nouns.py +0 -27
- web3_wizzard_lib/core/modules/nft/octomos.py +0 -32
- web3_wizzard_lib/core/modules/nft/omnisea.py +0 -33
- web3_wizzard_lib/core/modules/nft/omnizone.py +0 -25
- web3_wizzard_lib/core/modules/nft/orbiter_claim.py +0 -87
- web3_wizzard_lib/core/modules/nft/readon.py +0 -30
- web3_wizzard_lib/core/modules/nft/rubyscore.py +0 -45
- web3_wizzard_lib/core/modules/nft/sarubol.py +0 -22
- web3_wizzard_lib/core/modules/nft/satoshi_universe.py +0 -22
- web3_wizzard_lib/core/modules/nft/scroll_canvas_attest_year_badge.py +0 -35
- web3_wizzard_lib/core/modules/nft/scroll_canvas_mint.py +0 -51
- web3_wizzard_lib/core/modules/nft/sign.py +0 -32
- web3_wizzard_lib/core/modules/nft/snap.py +0 -25
- web3_wizzard_lib/core/modules/nft/snap_bonus.py +0 -31
- web3_wizzard_lib/core/modules/nft/social_scan.py +0 -22
- web3_wizzard_lib/core/modules/nft/tavaera.py +0 -30
- web3_wizzard_lib/core/modules/nft/townstory.py +0 -75
- web3_wizzard_lib/core/modules/nft/townstory_bonus.py +0 -45
- web3_wizzard_lib/core/modules/nft/trusta_reputation.py +0 -48
- web3_wizzard_lib/core/modules/nft/trustaa_poh.py +0 -49
- web3_wizzard_lib/core/modules/nft/uber_poh.py +0 -24
- web3_wizzard_lib/core/modules/nft/wizards_of_linea.py +0 -26
- web3_wizzard_lib/core/modules/nft/yoddlo.py +0 -22
- web3_wizzard_lib/core/modules/nft/yuliverse.py +0 -22
- web3_wizzard_lib/core/modules/nft/zace.py +0 -25
- web3_wizzard_lib/core/modules/nft/zks_domain.py +0 -41
- web3_wizzard_lib/core/modules/nft_minter.py +0 -107
- web3_wizzard_lib/core/modules/orbiter.py +0 -39
- web3_wizzard_lib/core/modules/orbiter_checker.py +0 -26
- web3_wizzard_lib/core/modules/rage.py +0 -54
- web3_wizzard_lib/core/modules/scroll_bridge.py +0 -45
- web3_wizzard_lib/core/modules/sell_all.py +0 -51
- web3_wizzard_lib/core/modules/sleep_module.py +0 -25
- web3_wizzard_lib/core/modules/smart_contract_deployment.py +0 -37
- web3_wizzard_lib/core/modules/stargate/__init__.py +0 -0
- web3_wizzard_lib/core/modules/stargate/auto_bridge.py +0 -91
- web3_wizzard_lib/core/modules/stargate/bridge.py +0 -38
- web3_wizzard_lib/core/modules/stargate/bridge_eth.py +0 -59
- web3_wizzard_lib/core/modules/stargate/bridge_tokens.py +0 -48
- web3_wizzard_lib/core/modules/stargate/classic_bridge.py +0 -34
- web3_wizzard_lib/core/modules/stargate/farming.py +0 -163
- web3_wizzard_lib/core/modules/stargate/l0_data.py +0 -10
- web3_wizzard_lib/core/modules/stargate/pool.py +0 -74
- web3_wizzard_lib/core/modules/stargate/stargate_balance_utils.py +0 -25
- web3_wizzard_lib/core/modules/stargate/stargate_gas_checker.py +0 -68
- web3_wizzard_lib/core/modules/swap/__init__.py +0 -1
- web3_wizzard_lib/core/modules/swap/horizondex.py +0 -38
- web3_wizzard_lib/core/modules/swap/izumi.py +0 -41
- web3_wizzard_lib/core/modules/swap/lineaswap.py +0 -34
- web3_wizzard_lib/core/modules/swap/maverick.py +0 -66
- web3_wizzard_lib/core/modules/swap/mute.py +0 -39
- web3_wizzard_lib/core/modules/swap/odos.py +0 -58
- web3_wizzard_lib/core/modules/swap/one_inch.py +0 -58
- web3_wizzard_lib/core/modules/swap/pancake.py +0 -41
- web3_wizzard_lib/core/modules/swap/swap_list.py +0 -11
- web3_wizzard_lib/core/modules/swap/syncswap.py +0 -62
- web3_wizzard_lib/core/modules/swap/velocore.py +0 -40
- web3_wizzard_lib/core/modules/swap/woofi.py +0 -38
- web3_wizzard_lib/core/modules/swap/xy_finance.py +0 -43
- web3_wizzard_lib/core/modules/swap/zebra.py +0 -32
- web3_wizzard_lib/core/modules/warm_up.py +0 -98
- web3_wizzard_lib/core/modules/wrapping.py +0 -74
- web3_wizzard_lib/core/modules/zkdx.py +0 -63
- web3_wizzard_lib/core/utils/__init__.py +0 -0
- web3_wizzard_lib/core/utils/ai_utils.py +0 -45
- web3_wizzard_lib/core/utils/benchmark_utils.py +0 -12
- web3_wizzard_lib/core/utils/module_memory.py +0 -28
- web3_wizzard_lib/core/utils/statistic_utils.py +0 -150
- web3_wizzard_lib/core/utils/sub_module.py +0 -8
- web3_wizzard_lib/data/__init__.py +0 -0
- web3_wizzard_lib/data/config_default.py +0 -52
- web3_wizzard_lib/data/module_config_default.py +0 -209
- web3_wizzard_lib/utils/__init__.py +0 -0
- web3_wizzard_lib/utils/debank_utils.py +0 -19
- web3_wizzard_lib-1.6.11.data/data/requirements.txt +0 -1
- web3_wizzard_lib-1.6.11.dist-info/METADATA +0 -15
- web3_wizzard_lib-1.6.11.dist-info/RECORD +0 -371
- web3_wizzard_lib-1.6.11.dist-info/top_level.txt +0 -3
- {web3_wizzard_lib-1.6.11.dist-info → web3_wizzard_lib-1.6.12.dist-info}/WHEEL +0 -0
@@ -1,84 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.contract import Contract
|
2
|
-
from sybil_engine.contract.transaction_executor import evm_transaction, l0_evm_transaction
|
3
|
-
|
4
|
-
from web3_wizzard_lib.core.modules.stargate.stargate_gas_checker import stargate_check_gas
|
5
|
-
|
6
|
-
with open("resources/abi/stargate_router.json") as f:
|
7
|
-
abi = f.read()
|
8
|
-
|
9
|
-
|
10
|
-
class StargateRouter(Contract):
|
11
|
-
def __init__(self, contract_address, web3):
|
12
|
-
super().__init__(contract_address, web3, abi)
|
13
|
-
|
14
|
-
@evm_transaction
|
15
|
-
def add_liquidity(self, account, pool_amount):
|
16
|
-
from_address = account.address
|
17
|
-
|
18
|
-
txn_params = self.build_generic_data(from_address, False)
|
19
|
-
|
20
|
-
contract_txn = self.contract.functions.addLiquidity(
|
21
|
-
self.chain_instance['stargate_usdc_pool'],
|
22
|
-
pool_amount.wei,
|
23
|
-
from_address
|
24
|
-
).build_transaction(txn_params)
|
25
|
-
|
26
|
-
contract_txn['gas'] = (self.web3.eth.estimate_gas(contract_txn) * 1.1)
|
27
|
-
|
28
|
-
return contract_txn
|
29
|
-
|
30
|
-
@evm_transaction
|
31
|
-
def instant_redeem(self, account, amount_to_bridge, stargate_pool_id):
|
32
|
-
from_address = account.address
|
33
|
-
|
34
|
-
txn_params = self.build_generic_data(from_address, False)
|
35
|
-
|
36
|
-
contract_txn = self.contract.functions.instantRedeemLocal(
|
37
|
-
stargate_pool_id,
|
38
|
-
amount_to_bridge,
|
39
|
-
from_address
|
40
|
-
).build_transaction(txn_params)
|
41
|
-
contract_txn['gas'] = int(self.web3.eth.estimate_gas(contract_txn) * 1.1)
|
42
|
-
|
43
|
-
return contract_txn
|
44
|
-
|
45
|
-
@stargate_check_gas("USDC")
|
46
|
-
@l0_evm_transaction
|
47
|
-
def swap(self, account, value_fee, amount_to_bridge, to_chain_instance):
|
48
|
-
from_address = account.address
|
49
|
-
|
50
|
-
txn_params = self.build_generic_data(from_address, False)
|
51
|
-
txn_params['value'] = value_fee
|
52
|
-
|
53
|
-
lz_tx_obj = [0, 0, '0x0000000000000000000000000000000000000001']
|
54
|
-
|
55
|
-
if amount_to_bridge.token == 'USDC':
|
56
|
-
stargate_pool = to_chain_instance['stargate_usdc_pool']
|
57
|
-
else:
|
58
|
-
stargate_pool = to_chain_instance['stargate_eth_pool']
|
59
|
-
|
60
|
-
contract_txn = self.contract.functions.swap(
|
61
|
-
to_chain_instance['stargate_chain_id'],
|
62
|
-
stargate_pool,
|
63
|
-
stargate_pool,
|
64
|
-
from_address,
|
65
|
-
amount_to_bridge.wei,
|
66
|
-
int(amount_to_bridge.wei * 0.985),
|
67
|
-
lz_tx_obj,
|
68
|
-
from_address,
|
69
|
-
'0x'
|
70
|
-
).build_transaction(txn_params)
|
71
|
-
contract_txn['gas'] = int(self.web3.eth.estimate_gas(contract_txn) * 1.1)
|
72
|
-
|
73
|
-
return contract_txn
|
74
|
-
|
75
|
-
def count_native_fee_stargate(self, chain_id, address):
|
76
|
-
return int(
|
77
|
-
self.contract.functions.quoteLayerZeroFee(
|
78
|
-
chain_id,
|
79
|
-
1,
|
80
|
-
address,
|
81
|
-
'0x',
|
82
|
-
(0, 0, address)
|
83
|
-
).call()[0] * 1.1
|
84
|
-
)
|
@@ -1,41 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.contract import Contract
|
2
|
-
from sybil_engine.contract.transaction_executor import evm_transaction, l0_evm_transaction
|
3
|
-
|
4
|
-
from web3_wizzard_lib.core.modules.stargate.stargate_gas_checker import stargate_check_gas
|
5
|
-
|
6
|
-
with open("resources/abi/stargate_swapETH_abi.json") as f:
|
7
|
-
abi = f.read()
|
8
|
-
|
9
|
-
|
10
|
-
class StargateRouterEth(Contract):
|
11
|
-
def __init__(self, contract_address, web3):
|
12
|
-
super().__init__(contract_address, web3, abi)
|
13
|
-
|
14
|
-
@evm_transaction
|
15
|
-
def add_liquidity_eth(self, account, pool_amount):
|
16
|
-
from_address = account.address
|
17
|
-
|
18
|
-
txn_params = self.build_generic_data(from_address, False)
|
19
|
-
txn_params['value'] = pool_amount.wei
|
20
|
-
|
21
|
-
contract_txn = self.contract.functions.addLiquidityETH().build_transaction(txn_params)
|
22
|
-
|
23
|
-
return contract_txn
|
24
|
-
|
25
|
-
@stargate_check_gas(token='ETH')
|
26
|
-
@l0_evm_transaction
|
27
|
-
def swap_eth(self, account, value_wei, amount_to_bridge_wei, to_chain_instance):
|
28
|
-
from_address = account.address
|
29
|
-
|
30
|
-
txn_params = self.build_generic_data(account.address, False)
|
31
|
-
txn_params['value'] = value_wei
|
32
|
-
|
33
|
-
contract_txn = self.contract.functions.swapETH(
|
34
|
-
to_chain_instance['stargate_chain_id'],
|
35
|
-
from_address,
|
36
|
-
from_address,
|
37
|
-
amount_to_bridge_wei,
|
38
|
-
int(amount_to_bridge_wei * 0.985)
|
39
|
-
).build_transaction(txn_params)
|
40
|
-
|
41
|
-
return contract_txn
|
@@ -1,45 +0,0 @@
|
|
1
|
-
from loguru import logger
|
2
|
-
from sybil_engine.contract.contract import Contract
|
3
|
-
from sybil_engine.utils.file_loader import load_abi
|
4
|
-
from web3 import Web3
|
5
|
-
|
6
|
-
abi = load_abi("resources/abi/stargate_token_pool.json")
|
7
|
-
|
8
|
-
MAX_ALLOWANCE = 115792089237316195423570985008687907853269984665640564039457584007913129639935
|
9
|
-
|
10
|
-
|
11
|
-
class StargateTokenPool(Contract):
|
12
|
-
def __init__(self, contract_address, web3):
|
13
|
-
super().__init__(contract_address, web3, abi)
|
14
|
-
|
15
|
-
def approve_pool(self, account, contract_on_approve):
|
16
|
-
logger.info(f"Approving token for pool")
|
17
|
-
|
18
|
-
sender = account.address
|
19
|
-
|
20
|
-
txn_params = self.build_generic_data(sender, set_contract_address=False)
|
21
|
-
|
22
|
-
contract_txn = self.contract.functions.approve(
|
23
|
-
Web3.to_checksum_address(contract_on_approve),
|
24
|
-
MAX_ALLOWANCE
|
25
|
-
).build_transaction(txn_params)
|
26
|
-
|
27
|
-
contract_txn['gas'] = int(self.web3.eth.estimate_gas(contract_txn) * 1.1)
|
28
|
-
|
29
|
-
return contract_txn
|
30
|
-
|
31
|
-
def balance_of(self, account):
|
32
|
-
return self.contract.functions.balanceOf(account.address).call()
|
33
|
-
|
34
|
-
def approve(self, account, contract_on_approve):
|
35
|
-
logger.info(f"Approving token")
|
36
|
-
|
37
|
-
txn_params = self.build_generic_data(account.address, False)
|
38
|
-
|
39
|
-
return self.contract.functions.approve(
|
40
|
-
Web3.to_checksum_address(contract_on_approve),
|
41
|
-
MAX_ALLOWANCE
|
42
|
-
).build_transaction(txn_params)
|
43
|
-
|
44
|
-
def allowance(self, account, allowance_contract):
|
45
|
-
return self.contract.functions.allowance(account.address, Web3.to_checksum_address(allowance_contract)).call()
|
@@ -1,36 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.contract import Contract
|
2
|
-
from sybil_engine.contract.transaction_executor import evm_transaction
|
3
|
-
from sybil_engine.utils.file_loader import load_abi
|
4
|
-
|
5
|
-
abi = load_abi("resources/abi/stargate_v2.json")
|
6
|
-
|
7
|
-
|
8
|
-
class StargateV2Contract(Contract):
|
9
|
-
def __init__(self, contract_address, web3):
|
10
|
-
super().__init__(contract_address, web3, abi)
|
11
|
-
|
12
|
-
@evm_transaction
|
13
|
-
def send(
|
14
|
-
self,
|
15
|
-
account,
|
16
|
-
value,
|
17
|
-
send_params,
|
18
|
-
stargate_fee,
|
19
|
-
refund_address
|
20
|
-
):
|
21
|
-
sender = account.address
|
22
|
-
|
23
|
-
txn_params = self.build_generic_data(sender, set_contract_address=False)
|
24
|
-
txn_params['value'] = value
|
25
|
-
|
26
|
-
return self.contract.functions.send(
|
27
|
-
send_params,
|
28
|
-
stargate_fee,
|
29
|
-
refund_address
|
30
|
-
).build_transaction(txn_params)
|
31
|
-
|
32
|
-
def quote_send(self, send_params):
|
33
|
-
return self.contract.functions.quoteSend(
|
34
|
-
send_params,
|
35
|
-
False
|
36
|
-
).call()
|
@@ -1,15 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.contract import Contract
|
2
|
-
from sybil_engine.utils.file_loader import load_abi
|
3
|
-
|
4
|
-
abi = load_abi("resources/abi/syncswap_classic_pool.json")
|
5
|
-
|
6
|
-
|
7
|
-
class SyncSwapClassicPool(Contract):
|
8
|
-
def __init__(self, contract_address, web3):
|
9
|
-
super().__init__(contract_address, web3, abi)
|
10
|
-
|
11
|
-
def get_pool(self, from_token, to_token):
|
12
|
-
return self.contract.functions.getPool(
|
13
|
-
from_token,
|
14
|
-
to_token
|
15
|
-
).call()
|
@@ -1,15 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.contract import Contract
|
2
|
-
from sybil_engine.utils.file_loader import load_abi
|
3
|
-
|
4
|
-
abi = load_abi("resources/abi/syncswap_classic_pool_factory.json")
|
5
|
-
|
6
|
-
|
7
|
-
class SyncSwapClassicPoolFactory(Contract):
|
8
|
-
def __init__(self, contract_address, web3):
|
9
|
-
super().__init__(contract_address, web3, abi)
|
10
|
-
|
11
|
-
def get_pool(self, from_token, to_token):
|
12
|
-
return self.contract.functions.getPool(
|
13
|
-
from_token,
|
14
|
-
to_token
|
15
|
-
).call()
|
@@ -1,25 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.contract import Contract
|
2
|
-
from sybil_engine.utils.file_loader import load_abi
|
3
|
-
|
4
|
-
abi = load_abi("resources/abi/syncswap_pool.json")
|
5
|
-
|
6
|
-
|
7
|
-
class SyncSwapPoolContract(Contract):
|
8
|
-
def __init__(self, contract_address, web3):
|
9
|
-
super().__init__(contract_address, web3, abi)
|
10
|
-
|
11
|
-
def get_amount_out(self, account, amount_to_swap, token_in_address):
|
12
|
-
sender = account.address
|
13
|
-
|
14
|
-
contract = self.web3.eth.contract(address=self.contract_address, abi=abi)
|
15
|
-
|
16
|
-
return contract.functions.getAmountOut(token_in_address, amount_to_swap.wei, sender).call()
|
17
|
-
|
18
|
-
def get_pool(self, from_token, to_token):
|
19
|
-
return self.contract.functions.getPool(
|
20
|
-
from_token,
|
21
|
-
to_token
|
22
|
-
).call()
|
23
|
-
|
24
|
-
def balanceOf(self, account):
|
25
|
-
return self.contract.functions.balanceOf(account.address).call()
|
@@ -1,123 +0,0 @@
|
|
1
|
-
from datetime import datetime
|
2
|
-
|
3
|
-
from eth_account.messages import encode_defunct
|
4
|
-
from sybil_engine.contract.contract import Contract
|
5
|
-
from sybil_engine.contract.erc20contract import MAX_ALLOWANCE
|
6
|
-
from sybil_engine.contract.transaction_executor import evm_transaction
|
7
|
-
from sybil_engine.data.tokens import get_tokens_for_chain
|
8
|
-
from sybil_engine.utils.file_loader import load_abi
|
9
|
-
from web3 import Web3
|
10
|
-
|
11
|
-
abi = load_abi("resources/abi/syncswap_router.json")
|
12
|
-
|
13
|
-
|
14
|
-
class SyncSwapRouter(Contract):
|
15
|
-
def __init__(self, contract_address, web3):
|
16
|
-
super().__init__(contract_address, web3, abi)
|
17
|
-
|
18
|
-
@evm_transaction
|
19
|
-
def swap(self, account, amount_to_swap, token_in_data_address, token_in_address, pool_address, amount_out_min,
|
20
|
-
withdraw_mode=b'\x01'):
|
21
|
-
sender = account.address
|
22
|
-
|
23
|
-
txn_params = self.build_generic_data(sender, False)
|
24
|
-
txn_params['value'] = amount_to_swap.wei if amount_to_swap.token == 'ETH' else 10000000000000
|
25
|
-
|
26
|
-
steps = self.steps(amount_to_swap, pool_address, sender, token_in_address, token_in_data_address,
|
27
|
-
withdraw_mode)
|
28
|
-
|
29
|
-
paths = [{"steps": steps, "tokenIn": token_in_address, "amountIn": amount_to_swap.wei}]
|
30
|
-
deadline = int(datetime.now().timestamp() + 60 * 60 * 3)
|
31
|
-
|
32
|
-
return self.contract.functions.swap(paths, amount_out_min, deadline).build_transaction(txn_params)
|
33
|
-
|
34
|
-
def steps(self, amount_to_swap, pool_address, sender, token_in_address, token_in_data_address, withdraw_mode):
|
35
|
-
if isinstance(pool_address, str):
|
36
|
-
data = b'\x00' * 12 + bytes.fromhex(token_in_data_address[2:]) + b'\x00' * 12 + bytes.fromhex(
|
37
|
-
sender[2:]) + b'\x00' * 31 + withdraw_mode
|
38
|
-
|
39
|
-
steps = [
|
40
|
-
{
|
41
|
-
"pool": pool_address,
|
42
|
-
"data": data,
|
43
|
-
"callback": get_tokens_for_chain(amount_to_swap.chain)['ZERO_ADDRESS'],
|
44
|
-
"callbackData": b''
|
45
|
-
}
|
46
|
-
]
|
47
|
-
else:
|
48
|
-
usdc_address = get_tokens_for_chain(amount_to_swap.chain)['USDC']
|
49
|
-
|
50
|
-
pool_pairs = list(pool_address.items())
|
51
|
-
if amount_to_swap.token == 'USDT':
|
52
|
-
zero_pool = pool_pairs[0][1] # USDC
|
53
|
-
first_pool = pool_pairs[1][1] # USDT
|
54
|
-
|
55
|
-
data_fir_step = b'\x00' * 12 + bytes.fromhex(token_in_address[2:]) + b'\x00' * 12 + bytes.fromhex(
|
56
|
-
sender[2:]) + b'\x00' * 31 + b'\x00'
|
57
|
-
|
58
|
-
data_sec_step = b'\x00' * 12 + bytes.fromhex(usdc_address[2:]) + b'\x00' * 12 + bytes.fromhex(
|
59
|
-
sender[2:]) + b'\x00' * 31 + withdraw_mode
|
60
|
-
else:
|
61
|
-
zero_pool = pool_pairs[1][1] # USDT
|
62
|
-
first_pool = pool_pairs[0][1] # USDC
|
63
|
-
|
64
|
-
data_fir_step = b'\x00' * 12 + bytes.fromhex(
|
65
|
-
token_in_data_address[2:]) + b'\x00' * 12 + bytes.fromhex(zero_pool[2:]) + b'\x00' * 31 + b'\x00'
|
66
|
-
|
67
|
-
data_sec_step = b'\x00' * 12 + bytes.fromhex(usdc_address[2:]) + b'\x00' * 12 + bytes.fromhex(
|
68
|
-
sender[2:]) + b'\x00' * 31 + b'\x02'
|
69
|
-
|
70
|
-
steps = [
|
71
|
-
{
|
72
|
-
"pool": first_pool,
|
73
|
-
"data": data_fir_step,
|
74
|
-
"callback": get_tokens_for_chain(amount_to_swap.chain)['ZERO_ADDRESS'],
|
75
|
-
"callbackData": b''
|
76
|
-
},
|
77
|
-
{
|
78
|
-
"pool": zero_pool,
|
79
|
-
"data": data_sec_step,
|
80
|
-
"callback": get_tokens_for_chain(amount_to_swap.chain)['ZERO_ADDRESS'],
|
81
|
-
"callbackData": b''
|
82
|
-
}
|
83
|
-
]
|
84
|
-
|
85
|
-
return steps
|
86
|
-
|
87
|
-
@evm_transaction
|
88
|
-
def add_liquidity2(self, account, amount):
|
89
|
-
sender = account.address
|
90
|
-
|
91
|
-
txn_params = self.build_generic_data(sender, False)
|
92
|
-
|
93
|
-
txn_params['value'] = amount.wei
|
94
|
-
|
95
|
-
return self.contract.functions.addLiquidity2(
|
96
|
-
'0x814A23B053FD0f102AEEda0459215C2444799C70',
|
97
|
-
[
|
98
|
-
(
|
99
|
-
'0x0000000000000000000000000000000000000000',
|
100
|
-
amount.wei
|
101
|
-
)
|
102
|
-
],
|
103
|
-
f'0x000000000000000000000000{account.address[2:]}',
|
104
|
-
0,
|
105
|
-
'0x0000000000000000000000000000000000000000',
|
106
|
-
b'0x'
|
107
|
-
).build_transaction(txn_params)
|
108
|
-
|
109
|
-
@evm_transaction
|
110
|
-
def burn_liquidity(self, account, pool, amount):
|
111
|
-
sender = account.address
|
112
|
-
|
113
|
-
txn_params = self.build_generic_data(sender, False)
|
114
|
-
|
115
|
-
return self.contract.functions.burnLiquiditySingle(
|
116
|
-
pool,
|
117
|
-
amount.wei, # liqudity
|
118
|
-
Web3.to_bytes(
|
119
|
-
hexstr=f'0x0000000000000000000000005300000000000000000000000000000000000004000000000000000000000000{account.address[2:]}0000000000000000000000000000000000000000000000000000000000000001'),
|
120
|
-
amount.wei, # minAmount
|
121
|
-
Web3.to_bytes(hexstr='0x0000000000000000000000000000000000000000'),
|
122
|
-
b'0x'
|
123
|
-
).build_transaction(txn_params)
|
@@ -1,18 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.contract import Contract
|
2
|
-
from sybil_engine.utils.file_loader import load_abi
|
3
|
-
from web3 import Web3
|
4
|
-
|
5
|
-
abi = load_abi("resources/abi/tavaera_id.json")
|
6
|
-
|
7
|
-
|
8
|
-
class TavaeraID(Contract):
|
9
|
-
def __init__(self, contract_address, web3):
|
10
|
-
super().__init__(contract_address, web3, abi)
|
11
|
-
|
12
|
-
def mint_citizen_id(self, account):
|
13
|
-
txn_params = self.build_generic_data(account.address, False)
|
14
|
-
txn_params['value'] = Web3.to_wei(0.0003, "ether")
|
15
|
-
|
16
|
-
contract_txn = self.contract.functions.mintCitizenId().build_transaction(txn_params)
|
17
|
-
|
18
|
-
return contract_txn
|
@@ -1,17 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.contract import Contract
|
2
|
-
from sybil_engine.utils.file_loader import load_abi
|
3
|
-
|
4
|
-
|
5
|
-
abi = load_abi("resources/abi/tavaera.json")
|
6
|
-
|
7
|
-
|
8
|
-
class Tavaera(Contract):
|
9
|
-
def __init__(self, contract_address, web3):
|
10
|
-
super().__init__(contract_address, web3, abi)
|
11
|
-
|
12
|
-
def mint(self, account):
|
13
|
-
txn_params = self.build_generic_data(account.address, False)
|
14
|
-
|
15
|
-
contract_txn = self.contract.functions.mint().build_transaction(txn_params)
|
16
|
-
|
17
|
-
return contract_txn
|
@@ -1,19 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.contract import Contract
|
2
|
-
from sybil_engine.contract.transaction_executor import evm_transaction
|
3
|
-
from sybil_engine.utils.file_loader import load_abi
|
4
|
-
from web3 import Web3
|
5
|
-
|
6
|
-
abi = load_abi("resources/abi/townstory_bonus.json")
|
7
|
-
|
8
|
-
|
9
|
-
class TownstoryBonusContract(Contract):
|
10
|
-
def __init__(self, contract_address, web3):
|
11
|
-
super().__init__(contract_address, web3, abi)
|
12
|
-
|
13
|
-
@evm_transaction
|
14
|
-
def claim_linea_travelbag(self, account, signature, deadline):
|
15
|
-
txn_params = self.build_generic_data(account.address, False)
|
16
|
-
|
17
|
-
return self.contract.functions.claimLineaTravelbag(
|
18
|
-
signature, account.address, deadline
|
19
|
-
).build_transaction(txn_params)
|
@@ -1,21 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.contract import Contract
|
2
|
-
from sybil_engine.contract.transaction_executor import evm_transaction
|
3
|
-
from sybil_engine.utils.file_loader import load_abi
|
4
|
-
from web3 import Web3
|
5
|
-
|
6
|
-
abi = load_abi("resources/abi/townstory.json")
|
7
|
-
|
8
|
-
|
9
|
-
class TownstoryContract(Contract):
|
10
|
-
def __init__(self, contract_address, web3):
|
11
|
-
super().__init__(contract_address, web3, abi)
|
12
|
-
|
13
|
-
@evm_transaction
|
14
|
-
def create_account_sign(self, account, signature, deadline):
|
15
|
-
txn_params = self.build_generic_data(account.address, False)
|
16
|
-
|
17
|
-
contract_txn = self.contract.functions.createAccountSign(
|
18
|
-
signature, 0, deadline
|
19
|
-
).build_transaction(txn_params)
|
20
|
-
|
21
|
-
return contract_txn
|
@@ -1,44 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.contract import Contract
|
2
|
-
from sybil_engine.utils.file_loader import load_abi
|
3
|
-
from web3 import Web3
|
4
|
-
|
5
|
-
abi = load_abi("resources/abi/velocore_lens.json")
|
6
|
-
|
7
|
-
|
8
|
-
def to_bytes32(address):
|
9
|
-
return Web3.to_bytes(hexstr=address).rjust(32, b'\0')
|
10
|
-
|
11
|
-
|
12
|
-
class VelocoreLensContract(Contract):
|
13
|
-
def __init__(self, contract_address, web3):
|
14
|
-
super().__init__(contract_address, web3, abi)
|
15
|
-
|
16
|
-
def getPoolBalance(self):
|
17
|
-
token_identifier = '0xe2c67A9B15e9E7FF8A9Cb0dFb8feE5609923E5DB'
|
18
|
-
|
19
|
-
# 0x000000000000000000000000e2c67A9B15e9E7FF8A9Cb0dFb8feE5609923E5DB
|
20
|
-
|
21
|
-
return (self.contract.functions.getPoolBalance(
|
22
|
-
'0xe2c67A9B15e9E7FF8A9Cb0dFb8feE5609923E5DB',
|
23
|
-
Web3.to_bytes(hexstr='0x000000000000000000000000b98308D11E2B578858Fbe65b793e71C7a0CAa43e')
|
24
|
-
)
|
25
|
-
.call())
|
26
|
-
|
27
|
-
def userBalances(self):
|
28
|
-
token_identifier = '0xe2c67A9B15e9E7FF8A9Cb0dFb8feE5609923E5DB'
|
29
|
-
|
30
|
-
# 0x000000000000000000000000e2c67A9B15e9E7FF8A9Cb0dFb8feE5609923E5DB
|
31
|
-
# 0x000000000000000000000000e2c67A9B15e9E7FF8A9Cb0dFb8feE5609923E5DB
|
32
|
-
|
33
|
-
return (self.contract.functions.userBalances(
|
34
|
-
'0xe2c67A9B15e9E7FF8A9Cb0dFb8feE5609923E5DB',
|
35
|
-
[Web3.to_bytes(hexstr='0x000000000000000000000000b98308D11E2B578858Fbe65b793e71C7a0CAa43e')]
|
36
|
-
)
|
37
|
-
.call())
|
38
|
-
|
39
|
-
def query_gauge(self, pool_address, account):
|
40
|
-
return (self.contract.functions.queryGauge(
|
41
|
-
pool_address,
|
42
|
-
account.address
|
43
|
-
)
|
44
|
-
.call())
|