web3-wizzard-lib 0.0.2__py3-none-any.whl → 0.1.0__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.
Files changed (298) hide show
  1. web3_wizzard_lib/core/modules/linea_appeal.py +69 -52
  2. web3_wizzard_lib/core/modules/stargate/farming.py +1 -1
  3. web3_wizzard_lib/core/utils/ai_utils.py +45 -0
  4. web3_wizzard_lib/core/utils/benchmark_utils.py +12 -0
  5. web3_wizzard_lib/core/utils/module_memory.py +26 -0
  6. web3_wizzard_lib-0.1.0.data/data/requirements.txt +1 -0
  7. {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.1.0.dist-info}/METADATA +9 -4
  8. {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.1.0.dist-info}/RECORD +10 -294
  9. {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.1.0.dist-info}/WHEEL +1 -1
  10. core/__init__.py +0 -1
  11. core/contract/__init__.py +0 -0
  12. core/contract/aavecontract.py +0 -36
  13. core/contract/alienswap_contract.py +0 -21
  14. core/contract/arena_games_contract.py +0 -16
  15. core/contract/basiliskcontract.py +0 -58
  16. core/contract/bilinear_contract.py +0 -22
  17. core/contract/bungee.py +0 -33
  18. core/contract/coredao_contract.py +0 -35
  19. core/contract/coredao_from_contract.py +0 -40
  20. core/contract/dmail_send_mail.py +0 -18
  21. core/contract/empty_nft.py +0 -18
  22. core/contract/era_name.py +0 -23
  23. core/contract/eralendcontract.py +0 -34
  24. core/contract/eth_scroll_bridge_contract.py +0 -25
  25. core/contract/frog_war_contract.py +0 -48
  26. core/contract/horizondex_quoter.py +0 -14
  27. core/contract/horizondex_router.py +0 -91
  28. core/contract/imagine_contract.py +0 -18
  29. core/contract/izumi.py +0 -63
  30. core/contract/kreatorland_contract.py +0 -21
  31. core/contract/l0_claim.py +0 -254
  32. core/contract/l2_telegraph.py +0 -21
  33. core/contract/layerbank_price.py +0 -18
  34. core/contract/layerbank_token.py +0 -29
  35. core/contract/layerbankcontract.py +0 -59
  36. core/contract/linea_day_2_contract.py +0 -19
  37. core/contract/linea_day_3_contract.py +0 -55
  38. core/contract/linea_ens_names_contract.py +0 -55
  39. core/contract/lineaswaprouter.py +0 -52
  40. core/contract/maverick_multicall.py +0 -52
  41. core/contract/mendi_finance_contract.py +0 -11
  42. core/contract/mendi_token.py +0 -25
  43. core/contract/merkly_minter.py +0 -47
  44. core/contract/micro3_contract.py +0 -18
  45. core/contract/mute_router.py +0 -93
  46. core/contract/nidum_contract.py +0 -44
  47. core/contract/nile_contract.py +0 -60
  48. core/contract/nomis_attest_contract.py +0 -40
  49. core/contract/nomis_contract.py +0 -40
  50. core/contract/octomos.py +0 -31
  51. core/contract/odos.py +0 -104
  52. core/contract/omnisea.py +0 -29
  53. core/contract/orbiter_starknet.py +0 -30
  54. core/contract/pancake_pool.py +0 -19
  55. core/contract/pancake_quoter.py +0 -20
  56. core/contract/pancake_router.py +0 -72
  57. core/contract/rage_claim.py +0 -24
  58. core/contract/reactor_fusion_contract.py +0 -78
  59. core/contract/readon_contract.py +0 -19
  60. core/contract/rubyscore_contract.py +0 -31
  61. core/contract/satoshi_universe_contract.py +0 -29
  62. core/contract/scroll_bridge_contract.py +0 -24
  63. core/contract/scroll_canvas_mint_contract.py +0 -26
  64. core/contract/scroll_oracle.py +0 -11
  65. core/contract/snap_contract.py +0 -16
  66. core/contract/social_scan_contract.py +0 -20
  67. core/contract/stargate_farming.py +0 -37
  68. core/contract/stargate_router.py +0 -84
  69. core/contract/stargate_router_eth.py +0 -41
  70. core/contract/stargate_token_pool.py +0 -46
  71. core/contract/stargate_v2_contract.py +0 -36
  72. core/contract/syncswap_classic_pool.py +0 -15
  73. core/contract/syncswap_classic_pool_factory.py +0 -15
  74. core/contract/syncswap_pool.py +0 -25
  75. core/contract/syncswap_router.py +0 -123
  76. core/contract/tavaera_id.py +0 -18
  77. core/contract/tavaera_mint.py +0 -17
  78. core/contract/townstory_bonus_contract.py +0 -19
  79. core/contract/townstory_contract.py +0 -21
  80. core/contract/velocore_lens.py +0 -44
  81. core/contract/velocore_pool.py +0 -198
  82. core/contract/velocore_router.py +0 -80
  83. core/contract/woofi_swap.py +0 -29
  84. core/contract/xy_finance_contract.py +0 -87
  85. core/contract/yoddlo_contract.py +0 -19
  86. core/contract/yuliverse_contract.py +0 -36
  87. core/contract/zebra_contract.py +0 -68
  88. core/contract/zerolend_contract.py +0 -34
  89. core/contract/zerolend_liq_contract.py +0 -20
  90. core/contract/zkdx_contract.py +0 -40
  91. core/contract/zkdx_data.py +0 -14
  92. core/contract/zks.py +0 -24
  93. core/modules/__init__.py +0 -0
  94. core/modules/ads_import_proxy.py +0 -52
  95. core/modules/airdrop_printer.py +0 -80
  96. core/modules/bank/__init__.py +0 -0
  97. core/modules/bank/aave.py +0 -25
  98. core/modules/bank/bank.py +0 -15
  99. core/modules/bank/bank_module.py +0 -99
  100. core/modules/bank/basilisk.py +0 -25
  101. core/modules/bank/eralend.py +0 -25
  102. core/modules/bank/layerbank.py +0 -116
  103. core/modules/bank/mendi_finance.py +0 -57
  104. core/modules/bank/reactorfusion.py +0 -25
  105. core/modules/bank/zerolend.py +0 -36
  106. core/modules/bridge/__init__.py +0 -0
  107. core/modules/bridge/bridge.py +0 -8
  108. core/modules/bridge/coredao_bridge_sub.py +0 -47
  109. core/modules/bridge/orbiter_sub.py +0 -112
  110. core/modules/bridge/scroll_bridge_sub.py +0 -42
  111. core/modules/bridge/stargate_v2_sub.py +0 -74
  112. core/modules/bridge_module.py +0 -47
  113. core/modules/bungee.py +0 -109
  114. core/modules/cex_sender.py +0 -60
  115. core/modules/cex_subaccount_transfer.py +0 -34
  116. core/modules/cex_withdraw.py +0 -91
  117. core/modules/claimer.py +0 -45
  118. core/modules/claims/__init__.py +0 -0
  119. core/modules/claims/layerzero_claimer.py +0 -64
  120. core/modules/claims/rabby_claimer.py +0 -81
  121. core/modules/concrete_swap.py +0 -97
  122. core/modules/coredao_bridge.py +0 -32
  123. core/modules/coredao_bridge_auto.py +0 -39
  124. core/modules/debank_checker.py +0 -90
  125. core/modules/dmail.py +0 -54
  126. core/modules/erc20_balance.py +0 -42
  127. core/modules/intract/__init__.py +0 -0
  128. core/modules/intract/intract_api.py +0 -212
  129. core/modules/intract/utils.py +0 -81
  130. core/modules/intract_claim.py +0 -104
  131. core/modules/layer_2_20.py +0 -65
  132. core/modules/lending_module.py +0 -134
  133. core/modules/linea_appeal.py +0 -70
  134. core/modules/linea_poh_lxp.py +0 -64
  135. core/modules/liquidity/__init__.py +0 -0
  136. core/modules/liquidity/nile_pool.py +0 -64
  137. core/modules/liquidity/pool.py +0 -16
  138. core/modules/liquidity/syncswap_pool.py +0 -61
  139. core/modules/liquidity/velocore_pool.py +0 -55
  140. core/modules/liquidity/zerolend_liquidity.py +0 -26
  141. core/modules/liquidity_pool.py +0 -60
  142. core/modules/merkly_refuel.py +0 -87
  143. core/modules/modules.py +0 -4
  144. core/modules/nft/__init__.py +0 -0
  145. core/modules/nft/abbys_world.py +0 -22
  146. core/modules/nft/acg_worlds.py +0 -25
  147. core/modules/nft/alienswap_linea.py +0 -22
  148. core/modules/nft/arena_games.py +0 -22
  149. core/modules/nft/asmatch.py +0 -22
  150. core/modules/nft/battlemon.py +0 -25
  151. core/modules/nft/bilinear.py +0 -22
  152. core/modules/nft/bitavatar.py +0 -25
  153. core/modules/nft/culture_satoshi_universe.py +0 -24
  154. core/modules/nft/efrogs.py +0 -26
  155. core/modules/nft/empty_nft.py +0 -22
  156. core/modules/nft/era_domain.py +0 -42
  157. core/modules/nft/frog_war.py +0 -22
  158. core/modules/nft/frog_war_bonus.py +0 -22
  159. core/modules/nft/gamerboom.py +0 -25
  160. core/modules/nft/gamerboom_bonus.py +0 -26
  161. core/modules/nft/imagine.py +0 -32
  162. core/modules/nft/kreatorland_module.py +0 -35
  163. core/modules/nft/l2_telegraph_module.py +0 -22
  164. core/modules/nft/layer3_meta.py +0 -25
  165. core/modules/nft/linea_culture_2_2_linus.py +0 -24
  166. core/modules/nft/linea_culture_2_3_yooldo.py +0 -24
  167. core/modules/nft/linea_culture_2_4_frogwar.py +0 -24
  168. core/modules/nft/linea_culture_2_5_acg.py +0 -25
  169. core/modules/nft/linea_culture_2_6_ascend_the_end.py +0 -25
  170. core/modules/nft/linea_culture_3_1_ascend_the_end.py +0 -25
  171. core/modules/nft/linea_culture_3_2_sending_me.py +0 -25
  172. core/modules/nft/linea_culture_3_3_townstory.py +0 -25
  173. core/modules/nft/linea_culture_3_4_daniele.py +0 -25
  174. core/modules/nft/linea_culture_3_5_demmortal.py +0 -25
  175. core/modules/nft/linea_culture_3_6_foxy.py +0 -25
  176. core/modules/nft/linea_culture_4_1_coop_records.py +0 -60
  177. core/modules/nft/linea_culture_4_2_borja_moskv.py +0 -65
  178. core/modules/nft/linea_culture_4_2_borja_moskv_approve.py +0 -27
  179. core/modules/nft/linea_culture_4_3_fruit.py +0 -66
  180. core/modules/nft/linea_culture_4_4_fruit_crux.py +0 -67
  181. core/modules/nft/linea_culture_4_5_forbidden_fruit.py +0 -67
  182. core/modules/nft/linea_culture_4_6_laurent.py +0 -67
  183. core/modules/nft/linea_culture_day2.py +0 -20
  184. core/modules/nft/linea_culture_day3.py +0 -20
  185. core/modules/nft/linea_ens_names.py +0 -107
  186. core/modules/nft/lucky_cat.py +0 -25
  187. core/modules/nft/merkly_minter_module.py +0 -22
  188. core/modules/nft/micro3.py +0 -23
  189. core/modules/nft/mint_2048.py +0 -28
  190. core/modules/nft/nft_submodule.py +0 -16
  191. core/modules/nft/nidum.py +0 -87
  192. core/modules/nft/nidum_bonus.py +0 -23
  193. core/modules/nft/nomis.py +0 -64
  194. core/modules/nft/nomis_attest.py +0 -66
  195. core/modules/nft/nouns.py +0 -27
  196. core/modules/nft/octomos.py +0 -32
  197. core/modules/nft/omnisea.py +0 -33
  198. core/modules/nft/omnizone.py +0 -25
  199. core/modules/nft/orbiter_claim.py +0 -87
  200. core/modules/nft/readon.py +0 -30
  201. core/modules/nft/rubyscore.py +0 -45
  202. core/modules/nft/sarubol.py +0 -22
  203. core/modules/nft/satoshi_universe.py +0 -22
  204. core/modules/nft/scroll_canvas_attest_year_badge.py +0 -35
  205. core/modules/nft/scroll_canvas_mint.py +0 -51
  206. core/modules/nft/sign.py +0 -32
  207. core/modules/nft/snap.py +0 -25
  208. core/modules/nft/snap_bonus.py +0 -31
  209. core/modules/nft/social_scan.py +0 -22
  210. core/modules/nft/sub_module.py +0 -8
  211. core/modules/nft/tavaera.py +0 -30
  212. core/modules/nft/townstory.py +0 -75
  213. core/modules/nft/townstory_bonus.py +0 -45
  214. core/modules/nft/trusta_reputation.py +0 -48
  215. core/modules/nft/trustaa_poh.py +0 -49
  216. core/modules/nft/uber_poh.py +0 -24
  217. core/modules/nft/wizards_of_linea.py +0 -26
  218. core/modules/nft/yoddlo.py +0 -22
  219. core/modules/nft/yuliverse.py +0 -22
  220. core/modules/nft/zace.py +0 -25
  221. core/modules/nft/zks_domain.py +0 -41
  222. core/modules/nft_minter.py +0 -107
  223. core/modules/orbiter.py +0 -39
  224. core/modules/orbiter_checker.py +0 -26
  225. core/modules/rage.py +0 -54
  226. core/modules/scroll_bridge.py +0 -45
  227. core/modules/sell_all.py +0 -51
  228. core/modules/sleep_module.py +0 -25
  229. core/modules/smart_contract_deployment.py +0 -37
  230. core/modules/stargate/__init__.py +0 -0
  231. core/modules/stargate/auto_bridge.py +0 -91
  232. core/modules/stargate/bridge.py +0 -38
  233. core/modules/stargate/bridge_eth.py +0 -59
  234. core/modules/stargate/bridge_tokens.py +0 -48
  235. core/modules/stargate/classic_bridge.py +0 -34
  236. core/modules/stargate/farming.py +0 -163
  237. core/modules/stargate/l0_data.py +0 -10
  238. core/modules/stargate/pool.py +0 -74
  239. core/modules/stargate/stargate_balance_utils.py +0 -25
  240. core/modules/stargate/stargate_gas_checker.py +0 -68
  241. core/modules/swap/__init__.py +0 -1
  242. core/modules/swap/horizondex.py +0 -38
  243. core/modules/swap/izumi.py +0 -41
  244. core/modules/swap/lineaswap.py +0 -34
  245. core/modules/swap/maverick.py +0 -66
  246. core/modules/swap/mute.py +0 -39
  247. core/modules/swap/odos.py +0 -58
  248. core/modules/swap/one_inch.py +0 -58
  249. core/modules/swap/pancake.py +0 -41
  250. core/modules/swap/swap_facade.py +0 -10
  251. core/modules/swap/syncswap.py +0 -62
  252. core/modules/swap/velocore.py +0 -40
  253. core/modules/swap/woofi.py +0 -38
  254. core/modules/swap/xy_finance.py +0 -43
  255. core/modules/swap/zebra.py +0 -32
  256. core/modules/warm_up.py +0 -98
  257. core/modules/wrapping.py +0 -74
  258. core/modules/zkdx.py +0 -63
  259. tests/core/__init__.py +0 -0
  260. tests/core/contracts/__init__.py +0 -0
  261. tests/core/contracts/test_horizondex_quoter.py +0 -37
  262. tests/core/contracts/test_uniswap_quoter.py +0 -35
  263. tests/core/contracts/test_velocore_lens.py +0 -67
  264. tests/core/contracts/test_velocore_pool.py +0 -57
  265. tests/core/modules/__init__.py +0 -67
  266. tests/core/modules/swap/__init__.py +0 -0
  267. tests/core/modules/swap/test_horizondex.py +0 -37
  268. tests/core/modules/swap/test_lineaswap.py +0 -28
  269. tests/core/modules/swap/test_maverick.py +0 -31
  270. tests/core/modules/swap/test_mute.py +0 -29
  271. tests/core/modules/swap/test_odos.py +0 -36
  272. tests/core/modules/swap/test_pancake.py +0 -54
  273. tests/core/modules/swap/test_syncswap.py +0 -59
  274. tests/core/modules/swap/test_velocore.py +0 -33
  275. tests/core/modules/swap/test_woofi.py +0 -22
  276. tests/core/modules/test_bungee.py +0 -27
  277. tests/core/modules/test_concrete_swap.py +0 -62
  278. tests/core/modules/test_dmail.py +0 -41
  279. tests/core/modules/test_lending.py +0 -122
  280. tests/core/modules/test_nft.py +0 -32
  281. tests/core/modules/test_nft_minter.py +0 -30
  282. tests/core/modules/test_orbiter.py +0 -28
  283. tests/core/modules/test_sellall.py +0 -27
  284. tests/core/modules/test_send_to_cex.py +0 -27
  285. tests/core/modules/test_stargate_auto_bridge.py +0 -32
  286. tests/core/modules/test_stargate_bridge.py +0 -25
  287. tests/core/modules/test_stargate_farming.py +0 -108
  288. tests/core/modules/test_warmup.py +0 -78
  289. tests/core/modules/test_wrapping.py +0 -68
  290. tests/core/scenario/__init__.py +0 -0
  291. tests/core/scenario/module_0_test_config.py +0 -91
  292. tests/core/test_app.py +0 -19
  293. tests/core/test_config.py +0 -34
  294. web3_wizzard_lib/core/modules/modules.py +0 -27
  295. web3_wizzard_lib/core/modules/nft/sub_module.py +0 -8
  296. web3_wizzard_lib/core/modules/swap/swap_facade.py +0 -10
  297. web3_wizzard_lib-0.0.2.data/data/requirements.txt +0 -1
  298. {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.1.0.dist-info}/top_level.txt +0 -0
@@ -1,37 +0,0 @@
1
- import unittest
2
-
3
- from sybil_engine.config.app_config import set_network
4
- from sybil_engine.data.networks import get_chain_instance
5
- from sybil_engine.data.tokens import get_tokens_for_chain
6
- from sybil_engine.utils.web3_utils import init_web3
7
-
8
- from web3_wizzard_lib.core.contract.horizondex_quoter import HorizonDexQuoter
9
- from tests.core.modules import init_set_test_config
10
-
11
-
12
- class TestHorizonDexQuoter(unittest.TestCase):
13
-
14
- def test_horizondex_quoter(self):
15
- # "ETH": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
16
- # "WETH": "0x4200000000000000000000000000000000000006",
17
- # return self.contract.functions.quoteExactInputSingle(
18
- # (
19
- # from_token, to_token, amount, 3000, 0)
20
- # ).call()[0]
21
- init_set_test_config()
22
- set_network('MAIN')
23
- chain = 'LINEA'
24
- chain_instance = get_chain_instance(chain)
25
- web3 = init_web3(chain_instance, None)
26
-
27
- quoter_contract_address = '0x07AceD5690e09935b1c0e6E88B772d9440F64718'
28
-
29
- horizondex = HorizonDexQuoter(quoter_contract_address, web3)
30
-
31
- #from_token_address = get_tokens_for_chain(chain)['WETH']
32
- from_token_address = get_tokens_for_chain(chain)['WETH']
33
- to_token_address = get_tokens_for_chain(chain)['USDC']
34
-
35
- price = horizondex.quote_exact_input_single( 1000000000, from_token_address, to_token_address)
36
-
37
- print(price)
@@ -1,35 +0,0 @@
1
- import unittest
2
-
3
- from sybil_engine.config.app_config import set_network
4
- from sybil_engine.data.networks import get_chain_instance
5
- from sybil_engine.data.tokens import get_tokens_for_chain
6
- from sybil_engine.utils.file_loader import load_abi
7
- from sybil_engine.utils.web3_utils import init_web3
8
- from web3 import Web3
9
-
10
- from tests.core.modules import init_set_test_config
11
-
12
- abi = load_abi('resources/abi/uniswap_abi.json')
13
-
14
-
15
- class TestUniswapQuoter(unittest.TestCase):
16
-
17
- def test_uniswap_quoter(self):
18
- init_set_test_config()
19
- set_network('MAIN')
20
- chain = 'ARBITRUM'
21
- chain_instance = get_chain_instance(chain)
22
- web3 = init_web3(chain_instance, None)
23
-
24
- quoter_contract_address = '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6'
25
-
26
- from_token_address = get_tokens_for_chain(chain)['WETH']
27
- to_token_address = get_tokens_for_chain(chain)['USDC']
28
-
29
- web3.eth.contract(quoter_contract_address, abi=abi).functions.quoteExactInputSingle(
30
- from_token_address,
31
- to_token_address,
32
- 500,
33
- Web3.to_wei(1, 'ether'),
34
- 0
35
- ).call()
@@ -1,67 +0,0 @@
1
- import unittest
2
-
3
- from sybil_engine.config.app_config import set_network
4
- from sybil_engine.data.networks import get_chain_instance
5
- from sybil_engine.utils.web3_utils import init_web3
6
-
7
- from web3_wizzard_lib.core.contract.velocore_lens import VelocoreLensContract
8
- from tests.core.modules import init_set_test_config
9
-
10
-
11
- class TestVelocoreLens(unittest.TestCase):
12
-
13
- def test_velocore_pool_get_pool_balance(self):
14
- # "ETH": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
15
- # "WETH": "0x4200000000000000000000000000000000000006",
16
- # return self.contract.functions.quoteExactInputSingle(
17
- # (
18
- # from_token, to_token, amount, 3000, 0)
19
- # ).call()[0]
20
- init_set_test_config()
21
- set_network('MAIN')
22
- chain = 'LINEA'
23
- chain_instance = get_chain_instance(chain)
24
- web3 = init_web3(chain_instance, None)
25
-
26
- velocore_lens_contract_address = '0xaA18cDb16a4DD88a59f4c2f45b5c91d009549e06'
27
-
28
- velocore = VelocoreLensContract(velocore_lens_contract_address, web3)
29
-
30
- pool_balance = velocore.getPoolBalance()
31
-
32
- print(pool_balance)
33
-
34
- def test_velocore_pool_user_balances(self):
35
- # "ETH": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
36
- # "WETH": "0x4200000000000000000000000000000000000006",
37
- # return self.contract.functions.quoteExactInputSingle(
38
- # (
39
- # from_token, to_token, amount, 3000, 0)
40
- # ).call()[0]
41
- init_set_test_config()
42
- set_network('MAIN')
43
- chain = 'LINEA'
44
- chain_instance = get_chain_instance(chain)
45
- web3 = init_web3(chain_instance, None)
46
-
47
- velocore_lens_contract_address = '0xaA18cDb16a4DD88a59f4c2f45b5c91d009549e06'
48
-
49
- velocore = VelocoreLensContract(velocore_lens_contract_address, web3)
50
-
51
- pool_balance = velocore.userBalances()
52
-
53
- print(pool_balance)
54
-
55
- def test_query(self):
56
- init_set_test_config()
57
- set_network('MAIN')
58
- chain = 'LINEA'
59
- chain_instance = get_chain_instance(chain)
60
- web3 = init_web3(chain_instance, None)
61
-
62
- velocore_lens_contract_address = '0xaA18cDb16a4DD88a59f4c2f45b5c91d009549e06'
63
-
64
- velocore = VelocoreLensContract(velocore_lens_contract_address, web3)
65
-
66
- gauge_gauge = velocore.query_gauge()
67
- print(gauge_gauge)
@@ -1,57 +0,0 @@
1
- import unittest
2
-
3
- from sybil_engine.config.app_config import set_network
4
- from sybil_engine.data.networks import get_chain_instance
5
- from sybil_engine.utils.web3_utils import init_web3
6
-
7
- from web3_wizzard_lib.core.contract.velocore_lens import VelocoreLensContract
8
- from web3_wizzard_lib.core.contract.velocore_pool import VelocorePoolContract
9
- from tests.core.modules import init_set_test_config
10
-
11
-
12
- class TestVelocoreVault(unittest.TestCase):
13
-
14
- def test_velocore_vault_all_pairs(self):
15
- init_set_test_config()
16
- set_network('MAIN')
17
- chain = 'LINEA'
18
- chain_instance = get_chain_instance(chain)
19
- web3 = init_web3(chain_instance, None)
20
-
21
- velocore_lens_contract_address = '0x1d0188c4B276A09366D05d6Be06aF61a73bC7535'
22
-
23
- velocore = VelocorePoolContract(velocore_lens_contract_address, web3)
24
-
25
- pool_balance = velocore.allPairs()
26
-
27
- print(pool_balance)
28
-
29
- def test_velocore_vault_facets(self):
30
- init_set_test_config()
31
- set_network('MAIN')
32
- chain = 'LINEA'
33
- chain_instance = get_chain_instance(chain)
34
- web3 = init_web3(chain_instance, None)
35
-
36
- velocore_lens_contract_address = '0x1d0188c4B276A09366D05d6Be06aF61a73bC7535'
37
-
38
- velocore = VelocorePoolContract(velocore_lens_contract_address, web3)
39
-
40
- facets = velocore.facets()
41
-
42
- for facet in facets:
43
- print(facet)
44
-
45
- def test_query(self):
46
- init_set_test_config()
47
- set_network('MAIN')
48
- chain = 'LINEA'
49
- chain_instance = get_chain_instance(chain)
50
- web3 = init_web3(chain_instance, None)
51
-
52
- velocore_lens_contract_address = '0x1d0188c4B276A09366D05d6Be06aF61a73bC7535'
53
-
54
- velocore = VelocoreLensContract(velocore_lens_contract_address, web3)
55
-
56
- gauge_gauge = velocore.query_gauge()
57
- print(gauge_gauge)
@@ -1,67 +0,0 @@
1
- import importlib
2
- import pkgutil
3
-
4
- from sybil_engine.config.app_config import set_network, set_dex_retry_interval, set_gas_prices, set_module_data
5
- from sybil_engine.domain.balance.balance_utils import interval_to_eth_balance
6
- from sybil_engine.utils.app_account_utils import create_app_account_with_proxies
7
-
8
- zksync_test_account = create_app_account_with_proxies(
9
- ['0xb98308D11E2B578858Fbe65b793e71C7a0CAa43e'],
10
- False,
11
- 'password',
12
- ['0xac1e735be8536c6534bb4f17f06f6afc73b2b5ba84ac2cfb12f7461b20c0bbe3'],
13
- [],
14
- 'RANDOM',
15
- ['0x6317842385f344acf68561f4e65f0f39e4fb4f1ad104b92bd007361aed39d8'],
16
- )[0]
17
-
18
- zksync_min_native_balance = interval_to_eth_balance({'from': 10, 'to': 10}, zksync_test_account, None, None)
19
-
20
- test_account = create_app_account_with_proxies(
21
- ['0xb98308D11E2B578858Fbe65b793e71C7a0CAa43e'],
22
- False,
23
- 'password',
24
- ['0xea6c44ac03bff858b476bba40716402b03e41b8e97e276d1baec7c37d42484a0'],
25
- [],
26
- 'RANDOM',
27
- ['0x6317842385f344acf68561f4e65f0f39e4fb4f1ad104b92bd007361aed39d8'],
28
- )[0]
29
-
30
- local_evm_test_account = create_app_account_with_proxies(
31
- ['0xb98308D11E2B578858Fbe65b793e71C7a0CAa43e'],
32
- False,
33
- 'password',
34
- ['0x0000000000000000000000000000000000000000000000000000000000000001'],
35
- [],
36
- 'RANDOM',
37
- ['0x6317842385f344acf68561f4e65f0f39e4fb4f1ad104b92bd007361aed39d8'],
38
- )[0]
39
-
40
- test_min_native_balance = interval_to_eth_balance({'from': 1, 'to': 1}, test_account, None, None)
41
-
42
- global_vars = globals()
43
-
44
- for loader, module_name, is_pkg in pkgutil.iter_modules(['core/contract']):
45
- module = importlib.import_module('.' + module_name, package='core.contract')
46
- global_vars[module_name] = module
47
-
48
-
49
- gas_prices_gwei_test = {
50
- 'ETH_MAINNET': 100,
51
- 'ZKSYNC': 2,
52
- 'BASE': 0.5,
53
- 'LINEA': 2,
54
- 'ARBITRUM': 2,
55
- 'AVALANCHE': 26,
56
- 'BSC': 5,
57
- 'FANTOM': 750,
58
- 'OPTIMISM': 0.5,
59
- 'POLYGON': 150,
60
- 'SCROLL': 3
61
- }
62
-
63
-
64
- def init_set_test_config():
65
- set_network('LOCAL')
66
- set_dex_retry_interval({'from': 0, 'to': 0})
67
- set_gas_prices(gas_prices_gwei_test)
File without changes
@@ -1,37 +0,0 @@
1
- import unittest
2
-
3
- from loguru import logger
4
- from sybil_engine.data.networks import get_chain_instance
5
- from sybil_engine.domain.balance.balance import NativeBalance
6
- from sybil_engine.domain.balance.balance_utils import from_eth_to_wei, get_native_balance
7
- from sybil_engine.domain.balance.tokens import Erc20Token
8
- from sybil_engine.utils.web3_utils import init_web3
9
-
10
- from web3_wizzard_lib.core.modules import Horizondex
11
- from tests.core.modules import test_account, init_set_test_config
12
-
13
-
14
- class TestHorizondex(unittest.TestCase):
15
-
16
- def test_shouldSwapHorizondex(self, chains=['BASE', 'LINEA']):
17
- init_set_test_config()
18
-
19
- logger.info("Test horizondex")
20
-
21
- for chain in chains:
22
- chain_instance = get_chain_instance(chain)
23
- web3 = init_web3(chain_instance, None)
24
-
25
- native_balance = get_native_balance(test_account, web3, chain_instance)
26
- logger.info(f"Native balance: {native_balance}")
27
-
28
- eth_token = Erc20Token(chain, 'ETH', web3)
29
- usdc_token = Erc20Token(chain, 'USDC', web3)
30
-
31
- Horizondex(chain_instance, web3).swap(
32
- NativeBalance(from_eth_to_wei(1), 'BASE', 'ETH'),
33
- eth_token,
34
- usdc_token,
35
- 0.98,
36
- test_account
37
- )
@@ -1,28 +0,0 @@
1
- import unittest
2
-
3
- from loguru import logger
4
- from sybil_engine.data.networks import get_chain_instance
5
- from sybil_engine.domain.balance.balance import NativeBalance
6
- from sybil_engine.domain.balance.balance_utils import from_eth_to_wei
7
- from sybil_engine.domain.balance.tokens import Erc20Token
8
- from sybil_engine.utils.web3_utils import init_web3
9
-
10
- from web3_wizzard_lib.core.modules import LineaSwap
11
- from tests.core.modules import test_account, init_set_test_config
12
-
13
-
14
- class TestLineaSwap(unittest.TestCase):
15
- init_set_test_config()
16
-
17
- def test_lineaswapShouldSwap(self, chain='LINEA'):
18
- logger.info("Test lineaswap")
19
-
20
- chain_instance = get_chain_instance(chain)
21
- web3 = init_web3(chain_instance, None)
22
-
23
- native_balance = NativeBalance(from_eth_to_wei(1), 'BASE', 'ETH')
24
-
25
- lineaswap = LineaSwap(chain_instance, web3)
26
- lineaswap.swap(native_balance, 'ETH', 'LIN', 0.98, test_account)
27
- amount_to_swap = Erc20Token(chain_instance['chain'], 'LIN', web3).balance(test_account)
28
- lineaswap.swap(amount_to_swap, 'LIN', 'ETH', 0.98, test_account)
@@ -1,31 +0,0 @@
1
- import unittest
2
-
3
- from loguru import logger
4
- from sybil_engine.data.networks import get_chain_instance
5
- from sybil_engine.domain.balance.balance import NativeBalance
6
- from sybil_engine.domain.balance.balance_utils import from_eth_to_wei, get_native_balance
7
- from sybil_engine.domain.balance.tokens import Erc20Token
8
- from sybil_engine.utils.web3_utils import init_web3
9
-
10
- from web3_wizzard_lib.core.modules import Maverick
11
- from tests.core.modules import init_set_test_config, test_account
12
-
13
-
14
- class TestMaverick(unittest.TestCase):
15
- init_set_test_config()
16
-
17
- def test_maverickShouldSwap(self, chain='BASE', account=test_account, token='USDC'):
18
- logger.info("Test maverick")
19
-
20
- chain_instance = get_chain_instance(chain)
21
- web3 = init_web3(chain_instance, None)
22
- native_balance = get_native_balance(account, web3, chain_instance)
23
- logger.info(f"{native_balance}")
24
-
25
- native_balance_to_sell = NativeBalance(from_eth_to_wei(1), chain, 'ETH')
26
-
27
- maverick = Maverick(chain_instance, web3, '0x06e6736ca9e922766279a22b75a600fe8b8473b6')
28
- maverick.swap(native_balance_to_sell, 'ETH', token, 0.01, account)
29
- amount_to_swap = Erc20Token(chain_instance['chain'], token, web3).balance(account)
30
- logger.info(f"{native_balance_to_sell} > {amount_to_swap}")
31
- maverick.swap(amount_to_swap, token, 'ETH', 0.95, account)
@@ -1,29 +0,0 @@
1
- import unittest
2
-
3
- from loguru import logger
4
- from sybil_engine.data.networks import get_chain_instance
5
- from sybil_engine.domain.balance.balance import NativeBalance
6
- from sybil_engine.domain.balance.balance_utils import from_eth_to_wei
7
- from sybil_engine.domain.balance.tokens import Erc20Token
8
- from sybil_engine.utils.web3_utils import init_web3
9
-
10
- from web3_wizzard_lib.core.modules.swap.mute import Mute
11
- from tests.core.modules import zksync_test_account, init_set_test_config
12
-
13
-
14
- class TestMute(unittest.TestCase):
15
- init_set_test_config()
16
-
17
- def test_muteShouldSwap(self, chain='ZKSYNC', account=zksync_test_account, token='USDC'):
18
- logger.info("Test mute")
19
-
20
- chain_instance = get_chain_instance(chain)
21
- web3 = init_web3(chain_instance, None)
22
-
23
- native_balance_to_sell = NativeBalance(from_eth_to_wei(1), chain, 'ETH')
24
-
25
- mute = Mute(chain_instance, web3)
26
- mute.swap(native_balance_to_sell, 'ETH', token, 0.01, account)
27
- amount_to_swap = Erc20Token(chain_instance['chain'], token, web3).balance(account)
28
- logger.info(f"{native_balance_to_sell} > {amount_to_swap}")
29
- mute.swap(amount_to_swap, token, 'ETH', 0.01, account)
@@ -1,36 +0,0 @@
1
- import unittest
2
-
3
- from tests.core.modules import init_set_test_config
4
-
5
-
6
- class TestOdos(unittest.TestCase):
7
- init_set_test_config()
8
-
9
- # def test_odosShouldSwap(self, chain='ZKSYNC'):
10
- # logger.info("Test odos")
11
- #
12
- # chain_instance = get_chain_instance(chain)
13
- # web3 = init_web3(chain_instance, None)
14
- #
15
- # logger.info(get_native_balance(zksync_test_account, web3, chain_instance))
16
- #
17
- # odos = OdosSwap(chain_instance, web3)
18
- #
19
- # odos.swap(
20
- # NativeBalance(10000, chain, 'ETH'),
21
- # 'ETH',
22
- # 'USDC',
23
- # 25,
24
- # base_test_account
25
- # )
26
- #
27
- # amount_to_swap = Erc20Token(chain, 'USDC', web3).balance(zksync_test_account)
28
- #
29
- #
30
- # odos.swap(
31
- # amount_to_swap,
32
- # 'LIN',
33
- # 'ETH',
34
- # 0.98,
35
- # base_test_account
36
- # )
@@ -1,54 +0,0 @@
1
- import unittest
2
-
3
- from loguru import logger
4
- from sybil_engine.data.networks import get_chain_instance
5
- from sybil_engine.domain.balance.balance import NativeBalance
6
- from sybil_engine.domain.balance.balance_utils import from_eth_to_wei
7
- from sybil_engine.domain.balance.tokens import Erc20Token
8
- from sybil_engine.utils.web3_utils import init_web3
9
-
10
- from web3_wizzard_lib.core.modules import Pancake
11
- from tests.core.modules import zksync_test_account, test_account, init_set_test_config
12
-
13
-
14
- class TestPancake(unittest.TestCase):
15
- init_set_test_config()
16
-
17
- def test_pancakeShouldSwap(self, chains=[
18
- ('ZKSYNC', zksync_test_account),
19
- ('BASE', test_account),
20
- ('LINEA', test_account),
21
- ('ARBITRUM', test_account),
22
- ], token='USDC'):
23
- logger.info("Test pancake")
24
-
25
- for chain, account in chains:
26
- chain_instance = get_chain_instance(chain)
27
- web3 = init_web3(chain_instance, None)
28
-
29
- native_balance_to_sell = NativeBalance(from_eth_to_wei(1), chain, 'ETH')
30
-
31
- pancake = Pancake(chain_instance, web3)
32
-
33
- pancake.swap(native_balance_to_sell, 'ETH', token, 0.01, account)
34
- amount_to_swap = Erc20Token(chain_instance['chain'], token, web3).balance(account)
35
- logger.info(f"{native_balance_to_sell} > {amount_to_swap}")
36
- pancake.swap(amount_to_swap, token, 'ETH', 0.01, account)
37
-
38
- def test_pancakeShouldSwapUSDT(self, chains=[
39
- ('ZKSYNC', zksync_test_account),
40
- ], token='USDT'):
41
- logger.info("Test mute")
42
-
43
- for chain, account in chains:
44
- chain_instance = get_chain_instance(chain)
45
- web3 = init_web3(chain_instance, None)
46
-
47
- native_balance_to_sell = NativeBalance(from_eth_to_wei(1), chain, 'ETH')
48
-
49
- mute = Pancake(chain_instance, web3)
50
-
51
- mute.swap(native_balance_to_sell, 'ETH', token, 0.01, account)
52
- amount_to_swap = Erc20Token(chain_instance['chain'], token, web3).balance(account)
53
- logger.info(f"{native_balance_to_sell} > {amount_to_swap}")
54
- mute.swap(amount_to_swap, token, 'ETH', 0.01, account)
@@ -1,59 +0,0 @@
1
- import unittest
2
-
3
- from loguru import logger
4
- from sybil_engine.data.networks import get_chain_instance
5
- from sybil_engine.domain.balance.balance import NativeBalance
6
- from sybil_engine.domain.balance.balance_utils import from_eth_to_wei
7
- from sybil_engine.domain.balance.tokens import Erc20Token
8
- from sybil_engine.utils.web3_utils import init_web3
9
-
10
- from web3_wizzard_lib.core.modules import Syncswap
11
- from tests.core.modules import zksync_test_account, init_set_test_config, test_account
12
-
13
-
14
- class TestSyncswap(unittest.TestCase):
15
- init_set_test_config()
16
-
17
- def test_syncswapShouldSwap(self, chain='ZKSYNC', account=zksync_test_account):
18
- logger.info("Test syncswap")
19
-
20
- chain_instance = get_chain_instance(chain)
21
- web3 = init_web3(chain_instance, None)
22
-
23
- native_balance = NativeBalance(from_eth_to_wei(1), chain, 'ETH')
24
-
25
- syncswap = Syncswap(chain_instance, web3)
26
- syncswap.swap(native_balance, 'ETH', 'USDC', 0.98, account)
27
- amount_to_swap = Erc20Token(chain, 'USDC', web3).balance(account)
28
- syncswap.swap(amount_to_swap, 'USDC', 'ETH', 0.98, account)
29
-
30
- syncswap = Syncswap(chain_instance, web3)
31
- syncswap.swap(native_balance, 'ETH', 'USDT', 0.98, account)
32
- amount_to_swap = Erc20Token(chain, 'USDT', web3).balance(account)
33
- syncswap.swap(amount_to_swap, 'USDT', 'ETH', 0.98, account)
34
-
35
- syncswap = Syncswap(chain_instance, web3)
36
- syncswap.swap(native_balance, 'ETH', 'WBTC', 0.98, account)
37
- amount_to_swap = Erc20Token(chain, 'WBTC', web3).balance(account)
38
- syncswap.swap(amount_to_swap, 'WBTC', 'ETH', 0.98, account)
39
-
40
- def test_syncswapShouldSwapForLinea(self, chain='LINEA', account=test_account):
41
- logger.info("Test syncswap")
42
-
43
- chain_instance = get_chain_instance(chain)
44
- web3 = init_web3(chain_instance, None)
45
-
46
- native_balance = NativeBalance(from_eth_to_wei(0.1), chain, 'ETH')
47
-
48
- syncswap = Syncswap(chain_instance, web3)
49
- syncswap.swap(native_balance, 'ETH', 'USDC', 0.98, account)
50
- amount_to_swap = Erc20Token(chain, 'USDC', web3).balance(account)
51
- syncswap.swap(amount_to_swap, 'USDC', 'ETH', 0.98, account)
52
-
53
- syncswap = Syncswap(chain_instance, web3, {
54
- "ETH>USDC": "0x5Ec5b1E9b1Bd5198343ABB6E55Fb695d2F7Bb308",
55
- "USDC>USDT": "0x258d5f860B11ec73Ee200eB14f1b60A3B7A536a2"
56
- })
57
- syncswap.swap(native_balance, 'ETH', 'USDT', 0.98, account)
58
- amount_to_swap = Erc20Token(chain, 'USDT', web3).balance(account)
59
- syncswap.swap(amount_to_swap, 'USDT', 'ETH', 0.98, account)
@@ -1,33 +0,0 @@
1
- import unittest
2
-
3
- from loguru import logger
4
- from sybil_engine.data.networks import get_chain_instance
5
- from sybil_engine.domain.balance.balance import NativeBalance
6
- from sybil_engine.domain.balance.balance_utils import from_eth_to_wei
7
- from sybil_engine.domain.balance.tokens import Erc20Token
8
- from sybil_engine.utils.web3_utils import init_web3
9
-
10
- from web3_wizzard_lib.core.modules import Velocore
11
- from tests.core.modules import local_evm_test_account, init_set_test_config
12
-
13
-
14
- class TestVelocore(unittest.TestCase):
15
- init_set_test_config()
16
-
17
- def test_velocoreShouldSwap(self, chain='ZKSYNC'):
18
- logger.info("Test velocore")
19
-
20
- chain_instance = get_chain_instance(chain)
21
- web3 = init_web3(chain_instance, None)
22
-
23
- velocore = Velocore(chain_instance, web3)
24
-
25
- native_balance_to_swap = NativeBalance(from_eth_to_wei(1), chain, 'ETH')
26
-
27
- velocore.swap(native_balance_to_swap, 'ETH', 'USDC', 0.98, local_evm_test_account)
28
- amount_to_swap = Erc20Token(chain_instance['chain'], 'USDC', web3).balance(local_evm_test_account)
29
- velocore.swap(amount_to_swap, 'USDC', 'ETH', 0.98, local_evm_test_account)
30
-
31
- velocore.swap(native_balance_to_swap, 'ETH', 'WBTC', 0.98, local_evm_test_account)
32
- amount_to_swap = Erc20Token(chain_instance['chain'], 'WBTC', web3).balance(local_evm_test_account)
33
- velocore.swap(amount_to_swap, 'WBTC', 'ETH', 0.98, local_evm_test_account)
@@ -1,22 +0,0 @@
1
- import unittest
2
-
3
- from tests.core.modules import init_set_test_config
4
-
5
-
6
- class TestWoofi(unittest.TestCase):
7
- init_set_test_config()
8
-
9
- # def test_woofiShouldSwap(self, chain='ZKSYNC', account=zksync_test_account, token='USDC'):
10
- # logger.info("Test woofi")
11
- #
12
- # chain_instance = get_chain_instance(chain)
13
- # web3 = init_web3(chain_instance, None)
14
- #
15
- # woofi = Woofi(chain_instance, web3)
16
- # native_balance_to_sell = NativeBalance(from_eth_to_wei(1), chain, 'ETH')
17
- # woofi.swap(native_balance_to_sell, 'ETH', token, 0.95, account)
18
- #
19
- # amount_to_swap = Erc20Token(chain, token, web3).balance(account)
20
- # logger.info(f"{native_balance_to_sell} > {amount_to_swap}")
21
- #
22
- # woofi.swap(amount_to_swap, token, 'ETH', 0.95, account)
@@ -1,27 +0,0 @@
1
- import unittest
2
-
3
- from loguru import logger
4
-
5
- from web3_wizzard_lib.core.modules import BungeeRefuel
6
- from tests.core.modules.__init__ import local_evm_test_account, zksync_min_native_balance, init_set_test_config
7
-
8
- bungee_test_params = {
9
- 'from_chain': 'ZKSYNC',
10
- 'to_chain': 'BASE',
11
- 'refuel_amount_interval': 'max'
12
- }
13
-
14
-
15
- class TestBungeeModule(unittest.TestCase):
16
- init_set_test_config()
17
-
18
- def test_shouldRefuelZksyncToBase(self):
19
- logger.info("Test module [BUNGEE, 11]")
20
-
21
- try:
22
- bungee = BungeeRefuel(zksync_min_native_balance, local_evm_test_account)
23
-
24
- bungee.execute(*bungee.parse_params(bungee_test_params), local_evm_test_account)
25
- except Exception as e:
26
- self.fail(f"Some function raised an exception: {e}")
27
-