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 @@
|
|
1
|
+
|
File without changes
|
@@ -0,0 +1,36 @@
|
|
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/aave.json")
|
7
|
+
|
8
|
+
|
9
|
+
class AaveContract(Contract):
|
10
|
+
def __init__(self, contract_address, web3):
|
11
|
+
super().__init__(contract_address, web3, abi)
|
12
|
+
|
13
|
+
@evm_transaction
|
14
|
+
def depositETH(self, account, amount: int):
|
15
|
+
sender = account.address
|
16
|
+
txn_params = self.build_generic_data(sender, set_contract_address=False)
|
17
|
+
|
18
|
+
txn_params['value'] = amount
|
19
|
+
|
20
|
+
return self.contract.functions.depositETH(
|
21
|
+
'0x11fCfe756c05AD438e312a7fd934381537D3cFfe',
|
22
|
+
account.address,
|
23
|
+
0
|
24
|
+
).build_transaction(txn_params)
|
25
|
+
|
26
|
+
@evm_transaction
|
27
|
+
def withdrawETH(self, account, amount: int):
|
28
|
+
sender = account.address
|
29
|
+
|
30
|
+
txn_params = self.build_generic_data(sender, False)
|
31
|
+
|
32
|
+
return self.contract.functions.withdrawETH(
|
33
|
+
'0x11fCfe756c05AD438e312a7fd934381537D3cFfe',
|
34
|
+
amount,
|
35
|
+
account.address
|
36
|
+
).build_transaction(txn_params)
|
@@ -0,0 +1,21 @@
|
|
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 AlienSwapContract(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def purchase(self, account, amount):
|
14
|
+
txn_params = self.build_generic_data(account.address, True)
|
15
|
+
|
16
|
+
txn_params['value'] = 100000000000000
|
17
|
+
|
18
|
+
txn_params['data'] = '0xefef39a10000000000000000000000000000000000000000000000000000000000000001'
|
19
|
+
txn_params['gasPrice'] = self.web3.eth.gas_price
|
20
|
+
|
21
|
+
return txn_params
|
@@ -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/arena_games.json")
|
6
|
+
|
7
|
+
|
8
|
+
class ArenaGamesContract(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def safe_mint(self, account):
|
14
|
+
txn_params = self.build_generic_data(account.address, False)
|
15
|
+
|
16
|
+
return self.contract.functions.safeMint(account.address).build_transaction(txn_params)
|
@@ -0,0 +1,58 @@
|
|
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/basiliks.json")
|
6
|
+
|
7
|
+
|
8
|
+
class BasiliskContract(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.balanceOfUnderlying(account.address).call()
|
15
|
+
|
16
|
+
@evm_transaction
|
17
|
+
def mint(self, account, amount_wei):
|
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) * 1.1)
|
22
|
+
|
23
|
+
tx_data.update({"value": amount_wei})
|
24
|
+
|
25
|
+
return tx_data
|
26
|
+
|
27
|
+
@evm_transaction
|
28
|
+
def redeem_underlying(self, account, amount):
|
29
|
+
tx_data = self.build_generic_data(account.address, False)
|
30
|
+
|
31
|
+
return self.contract.functions.redeemUnderlying(amount).build_transaction(tx_data)
|
32
|
+
|
33
|
+
# @evm_transaction
|
34
|
+
# def enable_collateral(self):
|
35
|
+
# logger.info(f"[{self.account_id}][{self.address}] Enable collateral on basilisk.py")
|
36
|
+
#
|
37
|
+
# contract = self.get_contract(BASILISK_CONTRACTS["collateral"], BASILISK_ABI)
|
38
|
+
#
|
39
|
+
# tx_data = await self.get_tx_data()
|
40
|
+
#
|
41
|
+
# transaction = await contract.functions.enterMarkets(
|
42
|
+
# [Web3.to_checksum_address(BASILISK_CONTRACTS["landing"])]
|
43
|
+
# ).build_transaction(tx_data)
|
44
|
+
#
|
45
|
+
# return transaction
|
46
|
+
#
|
47
|
+
# @evm_transaction
|
48
|
+
# def disable_collateral(self):
|
49
|
+
# logger.info(f"[{self.account_id}][{self.address}] Disable collateral on basilisk.py")
|
50
|
+
#
|
51
|
+
# contract = self.get_contract(BASILISK_CONTRACTS["collateral"], BASILISK_ABI)
|
52
|
+
#
|
53
|
+
# tx_data = await self.get_tx_data()
|
54
|
+
# transaction = await contract.functions.exitMarket(
|
55
|
+
# Web3.to_checksum_address(BASILISK_CONTRACTS["landing"])
|
56
|
+
# ).build_transaction(tx_data)
|
57
|
+
#
|
58
|
+
# return transaction
|
@@ -0,0 +1,22 @@
|
|
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/bilinear.json")
|
6
|
+
|
7
|
+
|
8
|
+
class BilinearContract(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def claim(self, account):
|
14
|
+
txn_params = self.build_generic_data(account.address, False)
|
15
|
+
|
16
|
+
return self.contract.functions.claim(
|
17
|
+
[],
|
18
|
+
([], [1]),
|
19
|
+
([], [], []),
|
20
|
+
0,
|
21
|
+
'0x307b8d76e3a3ca16066982ae42768878ec07a1b9af2679f2f9b8a3c3db25e7d5'
|
22
|
+
).build_transaction(txn_params)
|
@@ -0,0 +1,33 @@
|
|
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/bungee.json")
|
6
|
+
|
7
|
+
bungee_chain_ids = {
|
8
|
+
"BSC": 56,
|
9
|
+
"OPTIMISM": 10,
|
10
|
+
"POLYGON": 137,
|
11
|
+
"BASE": 8453,
|
12
|
+
"ARBITRUM": 42161,
|
13
|
+
"AVALANCHE": 43114,
|
14
|
+
"ZK_EVM": 1101,
|
15
|
+
"ZKSYNC": 324
|
16
|
+
}
|
17
|
+
|
18
|
+
|
19
|
+
class Bungee(Contract):
|
20
|
+
def __init__(self, contract_address, web3):
|
21
|
+
super().__init__(contract_address, web3, abi)
|
22
|
+
|
23
|
+
@evm_transaction
|
24
|
+
def refuel(self, account, to_chain, amount):
|
25
|
+
sender = account.address
|
26
|
+
|
27
|
+
txn_params = self.build_generic_data(sender, False)
|
28
|
+
txn_params['value'] = amount
|
29
|
+
|
30
|
+
return self.contract.functions.depositNativeToken(
|
31
|
+
bungee_chain_ids[to_chain],
|
32
|
+
sender
|
33
|
+
).build_transaction(txn_params)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
from sybil_engine.contract.contract import Contract
|
2
|
+
from sybil_engine.contract.transaction_executor import l0_evm_transaction
|
3
|
+
from sybil_engine.utils.file_loader import load_abi
|
4
|
+
|
5
|
+
abi = load_abi("resources/abi/coredao.json")
|
6
|
+
|
7
|
+
class CoreDaoContract(Contract):
|
8
|
+
def __init__(self, contract_address, web3):
|
9
|
+
super().__init__(contract_address, web3, abi)
|
10
|
+
|
11
|
+
@l0_evm_transaction
|
12
|
+
def bridge(self, account, amount, token, fee, to_chain):
|
13
|
+
txn_params = self.build_generic_data(account.address, False)
|
14
|
+
|
15
|
+
txn_params['value'] = fee
|
16
|
+
|
17
|
+
contract_txn = self.contract.functions.bridge(
|
18
|
+
token,
|
19
|
+
amount.wei,
|
20
|
+
account.address,
|
21
|
+
(
|
22
|
+
account.address,
|
23
|
+
'0x0000000000000000000000000000000000000000'
|
24
|
+
),
|
25
|
+
b''
|
26
|
+
).build_transaction(txn_params)
|
27
|
+
|
28
|
+
return contract_txn
|
29
|
+
|
30
|
+
def estimate_bridge_fee(self):
|
31
|
+
return self.contract.functions.estimateBridgeFee(
|
32
|
+
False,
|
33
|
+
b''
|
34
|
+
).call()[0]
|
@@ -0,0 +1,40 @@
|
|
1
|
+
from sybil_engine.contract.contract import Contract
|
2
|
+
from sybil_engine.contract.transaction_executor import l0_evm_transaction
|
3
|
+
from sybil_engine.utils.file_loader import load_abi
|
4
|
+
|
5
|
+
from web3_wizzard_lib.core.modules.stargate.l0_data import l0_chain_ids
|
6
|
+
|
7
|
+
abi = load_abi("resources/abi/coredao_bridge.json")
|
8
|
+
|
9
|
+
|
10
|
+
class CoreDaoFromContract(Contract):
|
11
|
+
def __init__(self, contract_address, web3):
|
12
|
+
super().__init__(contract_address, web3, abi)
|
13
|
+
|
14
|
+
@l0_evm_transaction
|
15
|
+
def bridge(self, account, amount, token, fee, to_chain):
|
16
|
+
txn_params = self.build_generic_data(account.address, False)
|
17
|
+
|
18
|
+
txn_params['value'] = fee
|
19
|
+
|
20
|
+
contract_txn = self.contract.functions.bridge(
|
21
|
+
token,
|
22
|
+
l0_chain_ids[to_chain],
|
23
|
+
amount.wei,
|
24
|
+
account.address,
|
25
|
+
False,
|
26
|
+
(
|
27
|
+
account.address,
|
28
|
+
'0x0000000000000000000000000000000000000000'
|
29
|
+
),
|
30
|
+
b''
|
31
|
+
).build_transaction(txn_params)
|
32
|
+
|
33
|
+
return contract_txn
|
34
|
+
|
35
|
+
def estimate_bridge_fee(self, to_chain):
|
36
|
+
return self.contract.functions.estimateBridgeFee(
|
37
|
+
l0_chain_ids[to_chain],
|
38
|
+
False,
|
39
|
+
b''
|
40
|
+
).call()[0]
|
@@ -0,0 +1,18 @@
|
|
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/dmail.json")
|
6
|
+
|
7
|
+
|
8
|
+
class DmailSend(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def send_mail(self, account, to, subject):
|
14
|
+
sender = account.address
|
15
|
+
|
16
|
+
txn_params = self.build_generic_data(sender, set_contract_address=False)
|
17
|
+
|
18
|
+
return self.contract.functions.send_mail(to, subject).build_transaction(txn_params)
|
@@ -0,0 +1,18 @@
|
|
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/empty_nft.json")
|
6
|
+
|
7
|
+
|
8
|
+
class EmptyNFT(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def mint(self, account):
|
14
|
+
sender = account.address
|
15
|
+
|
16
|
+
txn_params = self.build_generic_data(sender, False)
|
17
|
+
|
18
|
+
return self.contract.functions.mint().build_transaction(txn_params)
|
@@ -0,0 +1,23 @@
|
|
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/era_ns.json")
|
7
|
+
|
8
|
+
|
9
|
+
class EraName(Contract):
|
10
|
+
def __init__(self, contract_address, web3):
|
11
|
+
super().__init__(contract_address, web3, abi)
|
12
|
+
|
13
|
+
@evm_transaction
|
14
|
+
def register(self, account, domain_name):
|
15
|
+
sender = account.address
|
16
|
+
|
17
|
+
txn_params = self.build_generic_data(sender, False)
|
18
|
+
txn_params['value'] = Web3.to_wei(0.003, "ether")
|
19
|
+
|
20
|
+
return self.contract.functions.Register(domain_name).build_transaction(txn_params)
|
21
|
+
|
22
|
+
def check_name(self, domain_name):
|
23
|
+
return self.contract.functions._checkName(domain_name).call()
|
@@ -0,0 +1,34 @@
|
|
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/eralend.json")
|
7
|
+
|
8
|
+
|
9
|
+
class EraLendContract(Contract):
|
10
|
+
def __init__(self, contract_address, web3):
|
11
|
+
super().__init__(contract_address, web3, abi)
|
12
|
+
|
13
|
+
@evm_transaction
|
14
|
+
def mint(self, account, amount: int):
|
15
|
+
sender = account.address
|
16
|
+
|
17
|
+
txn_params = self.build_generic_data(sender)
|
18
|
+
txn_params['data'] = 0x1249c58b
|
19
|
+
txn_params['gas'] = int(self.web3.eth.estimate_gas(txn_params))
|
20
|
+
|
21
|
+
txn_params['value'] = amount
|
22
|
+
|
23
|
+
return txn_params
|
24
|
+
|
25
|
+
@evm_transaction
|
26
|
+
def redeem_underlying(self, account, amount: int):
|
27
|
+
sender = account.address
|
28
|
+
|
29
|
+
txn_params = self.build_generic_data(sender, False)
|
30
|
+
|
31
|
+
return self.contract.functions.redeemUnderlying(amount).build_transaction(txn_params)
|
32
|
+
|
33
|
+
def get_deposit_amount(self, account):
|
34
|
+
return self.contract.functions.balanceOfUnderlying(account.address).call()
|
@@ -0,0 +1,25 @@
|
|
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/eth_scroll_bridge.json")
|
6
|
+
|
7
|
+
|
8
|
+
class EthScrollBridgeContract(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def sendMessage(self, account, amount, fee):
|
14
|
+
txn_params = self.build_generic_data(account.address, False)
|
15
|
+
|
16
|
+
txn_params['value'] = amount + fee
|
17
|
+
|
18
|
+
contract_txn = self.contract.functions.sendMessage(
|
19
|
+
account.address,
|
20
|
+
amount,
|
21
|
+
b'0x',
|
22
|
+
168000
|
23
|
+
).build_transaction(txn_params)
|
24
|
+
|
25
|
+
return contract_txn
|
@@ -0,0 +1,48 @@
|
|
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 eth_abi import encode
|
5
|
+
|
6
|
+
abi = load_abi("resources/abi/frog_war_contract.json")
|
7
|
+
|
8
|
+
|
9
|
+
class FrogWarContract(Contract):
|
10
|
+
def __init__(self, contract_address, web3):
|
11
|
+
super().__init__(contract_address, web3, abi)
|
12
|
+
|
13
|
+
@evm_transaction
|
14
|
+
def claim(self, account):
|
15
|
+
txn_params = self.build_generic_data(account.address, False)
|
16
|
+
|
17
|
+
txn_params['value'] = 100000000000000
|
18
|
+
|
19
|
+
return self.contract.functions.claim(
|
20
|
+
account.address,
|
21
|
+
1,
|
22
|
+
1,
|
23
|
+
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
|
24
|
+
100000000000000,
|
25
|
+
(
|
26
|
+
['0x0000000000000000000000000000000000000000000000000000000000000000'],
|
27
|
+
# Note the brackets indicating an array
|
28
|
+
1,
|
29
|
+
0,
|
30
|
+
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
|
31
|
+
),
|
32
|
+
'0x'
|
33
|
+
).build_transaction(txn_params)
|
34
|
+
|
35
|
+
@evm_transaction
|
36
|
+
def claim_bonus(self, account):
|
37
|
+
txn_params = self.build_generic_data(account.address, False)
|
38
|
+
|
39
|
+
_receiver = account.address
|
40
|
+
_tokenId = 6
|
41
|
+
_quantity = 1
|
42
|
+
_currency = '0x21d624c846725ABe1e1e7d662E9fB274999009Aa'
|
43
|
+
_pricePerToken = 0
|
44
|
+
|
45
|
+
return self.contract.functions.claim(
|
46
|
+
_receiver, _tokenId, _quantity, _currency, _pricePerToken,
|
47
|
+
[[encode(['bytes32'], [b''])], 1, _pricePerToken, _currency], b''
|
48
|
+
).build_transaction(txn_params)
|
@@ -0,0 +1,22 @@
|
|
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/gmx_reward_router.json")
|
6
|
+
|
7
|
+
|
8
|
+
class GmxRewardRouter(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def unstake_and_redeem(self, account, glp_amount):
|
14
|
+
txn_params = self.build_generic_data(account.address, False)
|
15
|
+
|
16
|
+
contract_txn = self.contract.functions.unstakeAndRedeemGlpETH(
|
17
|
+
glp_amount,
|
18
|
+
0,
|
19
|
+
account.address,
|
20
|
+
).build_transaction(txn_params)
|
21
|
+
|
22
|
+
return contract_txn
|
@@ -0,0 +1,14 @@
|
|
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/horizondex_quoter.json")
|
5
|
+
|
6
|
+
|
7
|
+
class HorizonDexQuoter(Contract):
|
8
|
+
def __init__(self, contract_address, web3):
|
9
|
+
super().__init__(contract_address, web3, abi)
|
10
|
+
|
11
|
+
def quote_exact_input_single(self, amount: int, from_token_address: str, to_token_address: str):
|
12
|
+
return self.contract.functions.quoteExactInputSingle(
|
13
|
+
(from_token_address, to_token_address, amount, 40, 0)
|
14
|
+
).call()[1]
|
@@ -0,0 +1,91 @@
|
|
1
|
+
from datetime import datetime
|
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
|
+
swap_method_id = 'a8c9ed67'
|
8
|
+
abi = load_abi("resources/abi/horizondex.json")
|
9
|
+
|
10
|
+
|
11
|
+
class HorizonDexRouter(Contract):
|
12
|
+
def __init__(self, contract_address, web3):
|
13
|
+
super().__init__(contract_address, web3, abi)
|
14
|
+
|
15
|
+
@evm_transaction
|
16
|
+
def multicall(self, account, amount_to_swap, amount_out_min, token_in_address, token_out_address):
|
17
|
+
txn_params = self.build_generic_data(account.address, set_contract_address=False)
|
18
|
+
|
19
|
+
if amount_to_swap.token == 'ETH':
|
20
|
+
txn_params['value'] = amount_to_swap.wei # amount in for ETH
|
21
|
+
|
22
|
+
deadline_hex = decimal_to_padded_hexadecimal(int(datetime.now().timestamp() + 60 * 60 * 3), 64)
|
23
|
+
amount_in = decimal_to_padded_hexadecimal(amount_to_swap.wei, 64)
|
24
|
+
amount_out_min_hex = decimal_to_padded_hexadecimal(amount_out_min, 64)
|
25
|
+
token_in_address_padded = pad_hex(token_in_address, 64).lower()
|
26
|
+
token_out_address_padded = pad_hex(token_out_address, 64).lower()
|
27
|
+
|
28
|
+
if amount_to_swap.chain == 'BASE':
|
29
|
+
some_value = '000000000000000000000000000000000000000000000000000000000000000a'
|
30
|
+
else:
|
31
|
+
if amount_to_swap.token == 'USDC':
|
32
|
+
some_value = '000000000000000000000000000000000000000000000000000000000000012c'
|
33
|
+
else:
|
34
|
+
some_value = '0000000000000000000000000000000000000000000000000000000000000028'
|
35
|
+
|
36
|
+
swap = '0x' + swap_method_id + token_in_address_padded + token_out_address_padded + some_value + '0000000000000000000000000000000000000000000000000000000000000000' + deadline_hex + amount_in + amount_out_min_hex + '0000000000000000000000000000000000000000000000000000000000000000'
|
37
|
+
unwrapETH = self.contract.encode_abi("unwrapWeth", args=(amount_out_min, account.address))
|
38
|
+
|
39
|
+
return self.contract.functions.multicall([swap, unwrapETH]).build_transaction(txn_params)
|
40
|
+
|
41
|
+
@evm_transaction
|
42
|
+
def swap_exact_input_single(self, account, amount_to_swap, min_amount_out, token_in_address, token_out_address):
|
43
|
+
sender = account.address
|
44
|
+
|
45
|
+
deadline = int(datetime.now().timestamp() + 60 * 60 * 3)
|
46
|
+
txn_params = self.build_generic_data(sender, set_contract_address=False)
|
47
|
+
txn_params['value'] = amount_to_swap.wei
|
48
|
+
|
49
|
+
return self.contract.functions.swapExactInputSingle(
|
50
|
+
(
|
51
|
+
token_in_address,
|
52
|
+
token_out_address,
|
53
|
+
40,
|
54
|
+
sender,
|
55
|
+
deadline,
|
56
|
+
amount_to_swap.wei,
|
57
|
+
min_amount_out,
|
58
|
+
0
|
59
|
+
),
|
60
|
+
).build_transaction(txn_params)
|
61
|
+
|
62
|
+
@evm_transaction
|
63
|
+
def swap_exact_input(self, account, min_amount_out, amount_to_swap, token_in_address, token_out_address):
|
64
|
+
sender = account.address
|
65
|
+
|
66
|
+
deadline = int(datetime.now().timestamp() + 60 * 60 * 3)
|
67
|
+
path = token_in_address + '00002842000000000000000000000000000000000000060003e8' + token_out_address
|
68
|
+
|
69
|
+
txn_params = self.build_generic_data(sender)
|
70
|
+
txn_params['value'] = amount_to_swap.wei
|
71
|
+
txn_params['data'] = self.contract.encode_abi('swapExactInput', args=(
|
72
|
+
(
|
73
|
+
path,
|
74
|
+
sender,
|
75
|
+
deadline,
|
76
|
+
amount_to_swap.wei,
|
77
|
+
min_amount_out
|
78
|
+
),
|
79
|
+
)
|
80
|
+
)
|
81
|
+
return txn_params
|
82
|
+
|
83
|
+
|
84
|
+
def decimal_to_padded_hexadecimal(decimal_number, desired_length):
|
85
|
+
hex_value = hex(decimal_number)[2:]
|
86
|
+
|
87
|
+
return hex_value.zfill(desired_length)
|
88
|
+
|
89
|
+
|
90
|
+
def pad_hex(un_padded_hex, desired_length):
|
91
|
+
return un_padded_hex[2:].zfill(desired_length)
|
@@ -0,0 +1,18 @@
|
|
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/imagine.json")
|
6
|
+
|
7
|
+
|
8
|
+
class ImagineContract(Contract):
|
9
|
+
def __init__(self, contract_address, web3):
|
10
|
+
super().__init__(contract_address, web3, abi)
|
11
|
+
|
12
|
+
@evm_transaction
|
13
|
+
def mint(self, account, uri):
|
14
|
+
amount = self.web3.to_wei(0.0001, "ether")
|
15
|
+
txn_params = self.build_generic_data(account.address, set_contract_address=False)
|
16
|
+
txn_params['value'] = amount
|
17
|
+
|
18
|
+
return self.contract.functions.mint(uri).build_transaction(txn_params)
|
@@ -0,0 +1,63 @@
|
|
1
|
+
from datetime import datetime
|
2
|
+
|
3
|
+
import requests
|
4
|
+
from sybil_engine.contract.contract import Contract
|
5
|
+
from sybil_engine.contract.transaction_executor import evm_transaction
|
6
|
+
from sybil_engine.utils.file_loader import load_abi
|
7
|
+
|
8
|
+
swap_method_id = 'ac9650d8'
|
9
|
+
abi = load_abi("resources/abi/izumi.json")
|
10
|
+
|
11
|
+
|
12
|
+
class IzumiRouter(Contract):
|
13
|
+
def __init__(self, contract_address, web3):
|
14
|
+
super().__init__(contract_address, web3, abi)
|
15
|
+
|
16
|
+
@evm_transaction
|
17
|
+
def multicall(self, account, amount_to_swap, amount_out_min, token_in_address, token_out_address):
|
18
|
+
txn_params = self.build_generic_data(account.address, set_contract_address=True)
|
19
|
+
|
20
|
+
if amount_to_swap.token == 'ETH':
|
21
|
+
txn_params['value'] = amount_to_swap.wei # amount in for ETH
|
22
|
+
|
23
|
+
amount_in = decimal_to_padded_hexadecimal(amount_to_swap.wei, 64)
|
24
|
+
deadline_hex = decimal_to_padded_hexadecimal(int(datetime.now().timestamp() + 60 * 60 * 3), 64)
|
25
|
+
amount_out_min_hex = decimal_to_padded_hexadecimal(amount_out_min, 64)
|
26
|
+
token_in_address = token_in_address[2:].lower()
|
27
|
+
token_out_address = token_out_address[2:].lower()
|
28
|
+
|
29
|
+
sender_padded = pad_hex(account.address, 64).lower()
|
30
|
+
|
31
|
+
if amount_to_swap.token == 'ETH':
|
32
|
+
swap_method = f'0x{swap_method_id}00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000012475ceafe6000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a0{sender_padded}{amount_in}{amount_out_min_hex}{deadline_hex}000000000000000000000000000000000000000000000000000000000000002b{token_in_address}000bb8{token_out_address}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
|
33
|
+
refund_method = '412210e8a00000000000000000000000000000000000000000000000000000000'
|
34
|
+
txn_params['data'] = swap_method + refund_method
|
35
|
+
else:
|
36
|
+
swap_method = f'0x{swap_method_id}00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000012475ceafe6000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000{amount_in}{amount_out_min_hex}{deadline_hex}000000000000000000000000000000000000000000000000000000000000002b{token_in_address}000bb8{token_out_address}000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044'
|
37
|
+
unwrap_method = f'49404b7c0000000000000000000000000000000000000000000000000000000000000000{sender_padded}00000000000000000000000000000000000000000000000000000000'
|
38
|
+
txn_params['data'] = swap_method + unwrap_method
|
39
|
+
|
40
|
+
return txn_params
|
41
|
+
|
42
|
+
def quote_price(self, token):
|
43
|
+
BASE_URL = 'https://api.izumi.finance/api/v1/token_info/price_info/?t=USDC&t=ETH&t=WETH&t=wstETH&t=weETH'
|
44
|
+
response = requests.get(BASE_URL)
|
45
|
+
|
46
|
+
if response.status_code == 200:
|
47
|
+
data = response.json()
|
48
|
+
tokenPrice, ETH = float(data['data'][token]), float(data['data']['ETH'])
|
49
|
+
|
50
|
+
return ETH / tokenPrice
|
51
|
+
else:
|
52
|
+
print(f"Error {response.status_code}: {response.text}")
|
53
|
+
return None
|
54
|
+
|
55
|
+
|
56
|
+
def decimal_to_padded_hexadecimal(decimal_number, desired_length):
|
57
|
+
hex_value = hex(decimal_number)[2:]
|
58
|
+
|
59
|
+
return hex_value.zfill(desired_length)
|
60
|
+
|
61
|
+
|
62
|
+
def pad_hex(un_padded_hex, desired_length):
|
63
|
+
return un_padded_hex[2:].zfill(desired_length)
|