web3-wizzard-lib 1.6.12__py3-none-any.whl → 1.6.15__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/__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 +34 -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/gmx_reward_router.py +22 -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/new_rage_contract.py +31 -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 +45 -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 +81 -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/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/bank_module.py +99 -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 +108 -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 +78 -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/gmx_reward.py +25 -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 +101 -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 +98 -0
- web3_wizzard_lib/core/modules/linea_poh_lxp.py +65 -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/new_rage_withdraw.py +41 -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/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_list.py +11 -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/ai_utils.py +45 -0
- web3_wizzard_lib/core/utils/benchmark_utils.py +12 -0
- web3_wizzard_lib/core/utils/module_memory.py +28 -0
- web3_wizzard_lib/core/utils/statistic_utils.py +150 -0
- web3_wizzard_lib/core/utils/sub_module.py +8 -0
- web3_wizzard_lib/data/__init__.py +0 -0
- web3_wizzard_lib/data/config_default.py +52 -0
- web3_wizzard_lib/data/module_config_default.py +209 -0
- web3_wizzard_lib/utils/__init__.py +0 -0
- web3_wizzard_lib/utils/debank_utils.py +19 -0
- {web3_wizzard_lib-1.6.12.dist-info → web3_wizzard_lib-1.6.15.dist-info}/METADATA +2 -2
- web3_wizzard_lib-1.6.15.dist-info/RECORD +369 -0
- web3_wizzard_lib-1.6.12.dist-info/RECORD +0 -107
- {web3_wizzard_lib-1.6.12.dist-info → web3_wizzard_lib-1.6.15.dist-info}/WHEEL +0 -0
- {web3_wizzard_lib-1.6.12.dist-info → web3_wizzard_lib-1.6.15.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,19 @@
|
|
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/pancake/factory.json")
|
5
|
+
|
6
|
+
|
7
|
+
class PancakePool(Contract):
|
8
|
+
def __init__(self, contract_address, web3):
|
9
|
+
super().__init__(contract_address, web3, abi)
|
10
|
+
|
11
|
+
def get_pool(self, from_token: str, to_token: str):
|
12
|
+
|
13
|
+
pool = self.contract.functions.getPool(
|
14
|
+
from_token,
|
15
|
+
to_token,
|
16
|
+
500
|
17
|
+
).call()
|
18
|
+
|
19
|
+
return pool
|
@@ -0,0 +1,20 @@
|
|
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/pancake/quoter.json")
|
5
|
+
|
6
|
+
|
7
|
+
class PancakeQuoter(Contract):
|
8
|
+
def __init__(self, contract_address, web3):
|
9
|
+
super().__init__(contract_address, web3, abi)
|
10
|
+
|
11
|
+
def quote_exact_input_single(self, from_token: str, to_token: str, amount: int):
|
12
|
+
return self.contract.functions.quoteExactInputSingle(
|
13
|
+
(
|
14
|
+
from_token,
|
15
|
+
to_token,
|
16
|
+
amount,
|
17
|
+
500,
|
18
|
+
0
|
19
|
+
)
|
20
|
+
).call()[0]
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import time
|
2
|
+
|
3
|
+
from sybil_engine.contract.contract import Contract
|
4
|
+
from sybil_engine.contract.transaction_executor import evm_transaction
|
5
|
+
from sybil_engine.utils.file_loader import load_abi
|
6
|
+
|
7
|
+
from web3_wizzard_lib.core.modules.stargate.stargate_balance_utils import NativeBalance, Erc20Balance
|
8
|
+
|
9
|
+
abi = load_abi("resources/abi/pancake/router.json")
|
10
|
+
|
11
|
+
|
12
|
+
class PancakeRouter(Contract):
|
13
|
+
def __init__(self, contract_address, web3):
|
14
|
+
super().__init__(contract_address, web3, abi)
|
15
|
+
|
16
|
+
@evm_transaction
|
17
|
+
def swap_to_token(self, account, amount: NativeBalance, from_token: str, to_token: str, min_amount_out: int):
|
18
|
+
txn_params = self.build_generic_data(account.address, False)
|
19
|
+
|
20
|
+
txn_params['value'] = amount.wei
|
21
|
+
|
22
|
+
deadline = int(time.time()) + 1000000
|
23
|
+
|
24
|
+
transaction_data = self.contract.encode_abi(
|
25
|
+
"exactInputSingle",
|
26
|
+
args=[(
|
27
|
+
from_token,
|
28
|
+
to_token,
|
29
|
+
500,
|
30
|
+
account.address,
|
31
|
+
amount.wei,
|
32
|
+
min_amount_out,
|
33
|
+
0
|
34
|
+
)]
|
35
|
+
)
|
36
|
+
|
37
|
+
return self.contract.functions.multicall(deadline, [transaction_data]).build_transaction(txn_params)
|
38
|
+
|
39
|
+
@evm_transaction
|
40
|
+
def swap_to_eth(self, account, amount: Erc20Balance, from_token: str, to_token: str, min_amount_out: int):
|
41
|
+
txn_params = self.build_generic_data(account.address, False)
|
42
|
+
|
43
|
+
deadline = int(time.time()) + 1000000
|
44
|
+
|
45
|
+
transaction_data = self.contract.encode_abi(
|
46
|
+
fn_name="exactInputSingle",
|
47
|
+
args=[(
|
48
|
+
from_token,
|
49
|
+
to_token,
|
50
|
+
500,
|
51
|
+
"0x0000000000000000000000000000000000000002",
|
52
|
+
amount.wei,
|
53
|
+
min_amount_out,
|
54
|
+
0
|
55
|
+
)]
|
56
|
+
)
|
57
|
+
|
58
|
+
unwrap_data = self.contract.encode_abi(
|
59
|
+
fn_name="unwrapWETH9",
|
60
|
+
args=[
|
61
|
+
min_amount_out,
|
62
|
+
account.address
|
63
|
+
]
|
64
|
+
|
65
|
+
)
|
66
|
+
|
67
|
+
contract_txn = self.contract.functions.multicall(
|
68
|
+
deadline,
|
69
|
+
[transaction_data, unwrap_data]
|
70
|
+
).build_transaction(txn_params)
|
71
|
+
|
72
|
+
return contract_txn
|
@@ -0,0 +1,24 @@
|
|
1
|
+
from sybil_engine.contract.contract import Contract
|
2
|
+
from sybil_engine.contract.transaction_executor import evm_transaction
|
3
|
+
|
4
|
+
from sybil_engine.utils.file_loader import load_abi
|
5
|
+
|
6
|
+
abi = load_abi("resources/abi/rage_claim.json")
|
7
|
+
|
8
|
+
|
9
|
+
class RageClaimer(Contract):
|
10
|
+
def __init__(self, contract_address, web3):
|
11
|
+
super().__init__(contract_address, web3, abi)
|
12
|
+
|
13
|
+
@evm_transaction
|
14
|
+
def claim(self, account, amount, index, merkle_proof):
|
15
|
+
txn_params = self.build_generic_data(account.address, False)
|
16
|
+
|
17
|
+
contract_txn = self.contract.functions.claim(
|
18
|
+
index,
|
19
|
+
account.address,
|
20
|
+
amount,
|
21
|
+
merkle_proof
|
22
|
+
).build_transaction(txn_params)
|
23
|
+
|
24
|
+
return contract_txn
|
@@ -0,0 +1,78 @@
|
|
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/reactor_fusion.json")
|
6
|
+
|
7
|
+
|
8
|
+
class ReactorFusionContract(Contract):
|
9
|
+
|
10
|
+
def __init__(self, contract_address, web3):
|
11
|
+
super().__init__(contract_address, web3, abi)
|
12
|
+
|
13
|
+
def get_deposit_amount(self, account):
|
14
|
+
return self.contract.functions.balanceOf(account.address).call()
|
15
|
+
|
16
|
+
@evm_transaction
|
17
|
+
def mint(self, account, amount_wei: int):
|
18
|
+
tx_data = self.build_generic_data(account.address)
|
19
|
+
|
20
|
+
tx_data['data'] = self.contract.encode_abi('mint', args=())
|
21
|
+
tx_data['gas'] = int(self.web3.eth.estimate_gas(tx_data))
|
22
|
+
tx_data['value'] = amount_wei
|
23
|
+
|
24
|
+
return tx_data
|
25
|
+
|
26
|
+
@evm_transaction
|
27
|
+
def redeem_underlying(self, account, amount):
|
28
|
+
tx_data = self.build_generic_data(account.address, False)
|
29
|
+
|
30
|
+
return self.contract.functions.redeem(amount).build_transaction(tx_data)
|
31
|
+
|
32
|
+
# if amount > 0:
|
33
|
+
# logger.info(
|
34
|
+
# f"[{self.account_id}][{self.address}] Make withdraw from ReactorFusion | " +
|
35
|
+
# f"{Web3.from_wei(amount, 'ether')} ETH"
|
36
|
+
# )
|
37
|
+
#
|
38
|
+
#
|
39
|
+
# else:
|
40
|
+
# logger.error(f"[{self.account_id}][{self.address}] Deposit not found")
|
41
|
+
|
42
|
+
# @retry
|
43
|
+
# @check_gas
|
44
|
+
# async def enable_collateral(self):
|
45
|
+
# logger.info(f"[{self.account_id}][{self.address}] Enable collateral on ReactorFusion")
|
46
|
+
#
|
47
|
+
# contract = self.get_contract(REACTORFUSION_CONTRACTS["collateral"], REACTORFUSION_ABI)
|
48
|
+
#
|
49
|
+
# tx_data = await self.get_tx_data()
|
50
|
+
#
|
51
|
+
# transaction = await contract.functions.enterMarkets(
|
52
|
+
# [Web3.to_checksum_address(REACTORFUSION_CONTRACTS["landing"])]
|
53
|
+
# ).build_transaction(tx_data)
|
54
|
+
#
|
55
|
+
# signed_txn = await self.sign(transaction)
|
56
|
+
#
|
57
|
+
# txn_hash = await self.send_raw_transaction(signed_txn)
|
58
|
+
#
|
59
|
+
# await self.wait_until_tx_finished(txn_hash.hex())
|
60
|
+
#
|
61
|
+
# @retry
|
62
|
+
# @check_gas
|
63
|
+
# async def disable_collateral(self):
|
64
|
+
# logger.info(f"[{self.account_id}][{self.address}] Disable collateral on ReactorFusion")
|
65
|
+
#
|
66
|
+
# contract = self.get_contract(REACTORFUSION_CONTRACTS["collateral"], REACTORFUSION_ABI)
|
67
|
+
#
|
68
|
+
# tx_data = await self.get_tx_data()
|
69
|
+
#
|
70
|
+
# transaction = await contract.functions.exitMarket(
|
71
|
+
# Web3.to_checksum_address(REACTORFUSION_CONTRACTS["landing"])
|
72
|
+
# ).build_transaction(tx_data)
|
73
|
+
#
|
74
|
+
# signed_txn = await self.sign(transaction)
|
75
|
+
#
|
76
|
+
# txn_hash = await self.send_raw_transaction(signed_txn)
|
77
|
+
#
|
78
|
+
# await self.wait_until_tx_finished(txn_hash.hex())
|
@@ -0,0 +1,19 @@
|
|
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/abbysworld.json")
|
6
|
+
|
7
|
+
|
8
|
+
class ReadOnContract(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def curate(self, account, contentUrl):
|
14
|
+
txn_params = self.build_generic_data(account.address, True)
|
15
|
+
|
16
|
+
txn_params['data'] = f'0x7859bb8d{contentUrl}'
|
17
|
+
txn_params['gasPrice'] = self.web3.eth.gas_price
|
18
|
+
|
19
|
+
return txn_params
|
@@ -0,0 +1,31 @@
|
|
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/rubyscore.json")
|
7
|
+
|
8
|
+
|
9
|
+
class RubyscoreContract(Contract):
|
10
|
+
def __init__(self, contract_address, web3):
|
11
|
+
super().__init__(contract_address, web3, abi)
|
12
|
+
|
13
|
+
@evm_transaction
|
14
|
+
def attest_rubyscore(self, account, signature, schemaId, expirationDate):
|
15
|
+
txn_params = self.build_generic_data(account.address, False)
|
16
|
+
|
17
|
+
txn_params['value'] = 500000000000000
|
18
|
+
|
19
|
+
signature_bytes = Web3.to_bytes(hexstr=signature[2:])
|
20
|
+
|
21
|
+
contract_txn = self.contract.functions.attestRubyscore(
|
22
|
+
(
|
23
|
+
Web3.to_bytes(hexstr=schemaId[2:]),
|
24
|
+
expirationDate,
|
25
|
+
Web3.to_bytes(hexstr=f'000000000000000000000000{account.address[2:]}'),
|
26
|
+
Web3.to_bytes(hexstr='0000000000000000000000000000000000000000000000000000000000000000'),
|
27
|
+
),
|
28
|
+
[signature_bytes] # Encapsulate in a list to match bytes[]
|
29
|
+
).build_transaction(txn_params)
|
30
|
+
|
31
|
+
return contract_txn
|
@@ -0,0 +1,29 @@
|
|
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/satoshi_universe.json")
|
6
|
+
|
7
|
+
|
8
|
+
class SatoshiUniverseContract(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def mint(self, account, amount):
|
14
|
+
txn_params = self.build_generic_data(account.address, False)
|
15
|
+
|
16
|
+
txn_params['value'] = 150000000000000
|
17
|
+
|
18
|
+
contract_txn = self.contract.functions.mint(
|
19
|
+
(
|
20
|
+
account.address,
|
21
|
+
'0xFf9B136F19D1Ad1f1716e2Ebe98b4A773f263275',
|
22
|
+
amount,
|
23
|
+
[],
|
24
|
+
1,
|
25
|
+
'0x'
|
26
|
+
)
|
27
|
+
).build_transaction(txn_params)
|
28
|
+
|
29
|
+
return contract_txn
|
@@ -0,0 +1,24 @@
|
|
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/scroll_bridge.json")
|
6
|
+
|
7
|
+
|
8
|
+
class ScrollBridgeContract(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def withdraw(
|
14
|
+
self,
|
15
|
+
account,
|
16
|
+
amount_wei
|
17
|
+
):
|
18
|
+
txn_params = self.build_generic_data(account.address, False)
|
19
|
+
txn_params['value'] = amount_wei
|
20
|
+
|
21
|
+
return self.contract.functions.withdrawETH(
|
22
|
+
amount_wei,
|
23
|
+
0
|
24
|
+
).build_transaction(txn_params)
|
@@ -0,0 +1,26 @@
|
|
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/scroll_canvas_mint.json")
|
6
|
+
|
7
|
+
|
8
|
+
class ScrollCanvasMintContract(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def mint(
|
14
|
+
self,
|
15
|
+
account,
|
16
|
+
username,
|
17
|
+
referral,
|
18
|
+
value
|
19
|
+
):
|
20
|
+
txn_params = self.build_generic_data(account.address, False)
|
21
|
+
txn_params['value'] = value
|
22
|
+
|
23
|
+
return self.contract.functions.mint(
|
24
|
+
username,
|
25
|
+
referral
|
26
|
+
).build_transaction(txn_params)
|
@@ -0,0 +1,11 @@
|
|
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/scroll_oracle.json")
|
5
|
+
|
6
|
+
class ScrollOracle(Contract):
|
7
|
+
def __init__(self, contract_address, web3):
|
8
|
+
super().__init__(contract_address, web3, abi)
|
9
|
+
|
10
|
+
def estimateCrossDomainMessageFee(self):
|
11
|
+
return self.contract.functions.estimateCrossDomainMessageFee(168000).call()
|
@@ -0,0 +1,16 @@
|
|
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/snap.json")
|
6
|
+
|
7
|
+
|
8
|
+
class SnapContract(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def stake(self, account, token_id):
|
14
|
+
txn_params = self.build_generic_data(account.address, False)
|
15
|
+
|
16
|
+
return self.contract.functions.stake(token_id).build_transaction(txn_params)
|
@@ -0,0 +1,20 @@
|
|
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/socialscan.json")
|
6
|
+
|
7
|
+
|
8
|
+
class SocialScanContract(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def set_approval_for_all(self, account, operator, approved):
|
14
|
+
txn_params = self.build_generic_data(account.address, False)
|
15
|
+
|
16
|
+
contract_txn = self.contract.functions.setApprovalForAll(
|
17
|
+
operator, approved
|
18
|
+
).build_transaction(txn_params)
|
19
|
+
|
20
|
+
return contract_txn
|
@@ -0,0 +1,37 @@
|
|
1
|
+
from sybil_engine.contract.contract import Contract
|
2
|
+
from sybil_engine.contract.transaction_executor import evm_transaction
|
3
|
+
|
4
|
+
with open("resources/abi/stargate_farming.json") as f:
|
5
|
+
abi = f.read()
|
6
|
+
|
7
|
+
|
8
|
+
class StargateFarming(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def deposit(self, account, pool_amount):
|
14
|
+
sender = account.address
|
15
|
+
txn_params = self.build_generic_data(sender, False)
|
16
|
+
|
17
|
+
contract_txn = self.contract.functions.deposit(0, pool_amount.wei).build_transaction(txn_params)
|
18
|
+
contract_txn['gas'] = int(self.web3.eth.estimate_gas(contract_txn) * 1.05)
|
19
|
+
|
20
|
+
return contract_txn
|
21
|
+
|
22
|
+
@evm_transaction
|
23
|
+
def withdraw(self, account, amount_to_bridge):
|
24
|
+
sender = account.address
|
25
|
+
|
26
|
+
txn_params = self.build_generic_data(sender, False)
|
27
|
+
|
28
|
+
contract_txn = self.contract.functions.withdraw(
|
29
|
+
0,
|
30
|
+
amount_to_bridge
|
31
|
+
).build_transaction(txn_params)
|
32
|
+
contract_txn['gas'] = int(self.web3.eth.estimate_gas(contract_txn) * 1.05)
|
33
|
+
|
34
|
+
return contract_txn
|
35
|
+
|
36
|
+
def user_info(self, account):
|
37
|
+
return int(self.contract.functions.userInfo(0, account.address).call()[0])
|
@@ -0,0 +1,84 @@
|
|
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
|
+
)
|
@@ -0,0 +1,41 @@
|
|
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
|
@@ -0,0 +1,45 @@
|
|
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()
|
@@ -0,0 +1,36 @@
|
|
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()
|
@@ -0,0 +1,15 @@
|
|
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()
|