web3-wizzard-lib 0.0.2__py3-none-any.whl → 0.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- web3_wizzard_lib/core/modules/linea_appeal.py +12 -45
- web3_wizzard_lib/core/modules/stargate/farming.py +1 -1
- web3_wizzard_lib/core/utils/ai_utils.py +27 -0
- {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.0.3.dist-info}/METADATA +8 -3
- {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.0.3.dist-info}/RECORD +8 -294
- {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.0.3.dist-info}/WHEEL +1 -1
- core/__init__.py +0 -1
- core/contract/__init__.py +0 -0
- core/contract/aavecontract.py +0 -36
- core/contract/alienswap_contract.py +0 -21
- core/contract/arena_games_contract.py +0 -16
- core/contract/basiliskcontract.py +0 -58
- core/contract/bilinear_contract.py +0 -22
- core/contract/bungee.py +0 -33
- core/contract/coredao_contract.py +0 -35
- core/contract/coredao_from_contract.py +0 -40
- core/contract/dmail_send_mail.py +0 -18
- core/contract/empty_nft.py +0 -18
- core/contract/era_name.py +0 -23
- core/contract/eralendcontract.py +0 -34
- core/contract/eth_scroll_bridge_contract.py +0 -25
- core/contract/frog_war_contract.py +0 -48
- core/contract/horizondex_quoter.py +0 -14
- core/contract/horizondex_router.py +0 -91
- core/contract/imagine_contract.py +0 -18
- core/contract/izumi.py +0 -63
- core/contract/kreatorland_contract.py +0 -21
- core/contract/l0_claim.py +0 -254
- core/contract/l2_telegraph.py +0 -21
- core/contract/layerbank_price.py +0 -18
- core/contract/layerbank_token.py +0 -29
- core/contract/layerbankcontract.py +0 -59
- core/contract/linea_day_2_contract.py +0 -19
- core/contract/linea_day_3_contract.py +0 -55
- core/contract/linea_ens_names_contract.py +0 -55
- core/contract/lineaswaprouter.py +0 -52
- core/contract/maverick_multicall.py +0 -52
- core/contract/mendi_finance_contract.py +0 -11
- core/contract/mendi_token.py +0 -25
- core/contract/merkly_minter.py +0 -47
- core/contract/micro3_contract.py +0 -18
- core/contract/mute_router.py +0 -93
- core/contract/nidum_contract.py +0 -44
- core/contract/nile_contract.py +0 -60
- core/contract/nomis_attest_contract.py +0 -40
- core/contract/nomis_contract.py +0 -40
- core/contract/octomos.py +0 -31
- core/contract/odos.py +0 -104
- core/contract/omnisea.py +0 -29
- core/contract/orbiter_starknet.py +0 -30
- core/contract/pancake_pool.py +0 -19
- core/contract/pancake_quoter.py +0 -20
- core/contract/pancake_router.py +0 -72
- core/contract/rage_claim.py +0 -24
- core/contract/reactor_fusion_contract.py +0 -78
- core/contract/readon_contract.py +0 -19
- core/contract/rubyscore_contract.py +0 -31
- core/contract/satoshi_universe_contract.py +0 -29
- core/contract/scroll_bridge_contract.py +0 -24
- core/contract/scroll_canvas_mint_contract.py +0 -26
- core/contract/scroll_oracle.py +0 -11
- core/contract/snap_contract.py +0 -16
- core/contract/social_scan_contract.py +0 -20
- core/contract/stargate_farming.py +0 -37
- core/contract/stargate_router.py +0 -84
- core/contract/stargate_router_eth.py +0 -41
- core/contract/stargate_token_pool.py +0 -46
- core/contract/stargate_v2_contract.py +0 -36
- core/contract/syncswap_classic_pool.py +0 -15
- core/contract/syncswap_classic_pool_factory.py +0 -15
- core/contract/syncswap_pool.py +0 -25
- core/contract/syncswap_router.py +0 -123
- core/contract/tavaera_id.py +0 -18
- core/contract/tavaera_mint.py +0 -17
- core/contract/townstory_bonus_contract.py +0 -19
- core/contract/townstory_contract.py +0 -21
- core/contract/velocore_lens.py +0 -44
- core/contract/velocore_pool.py +0 -198
- core/contract/velocore_router.py +0 -80
- core/contract/woofi_swap.py +0 -29
- core/contract/xy_finance_contract.py +0 -87
- core/contract/yoddlo_contract.py +0 -19
- core/contract/yuliverse_contract.py +0 -36
- core/contract/zebra_contract.py +0 -68
- core/contract/zerolend_contract.py +0 -34
- core/contract/zerolend_liq_contract.py +0 -20
- core/contract/zkdx_contract.py +0 -40
- core/contract/zkdx_data.py +0 -14
- core/contract/zks.py +0 -24
- core/modules/__init__.py +0 -0
- core/modules/ads_import_proxy.py +0 -52
- core/modules/airdrop_printer.py +0 -80
- core/modules/bank/__init__.py +0 -0
- core/modules/bank/aave.py +0 -25
- core/modules/bank/bank.py +0 -15
- core/modules/bank/bank_module.py +0 -99
- core/modules/bank/basilisk.py +0 -25
- core/modules/bank/eralend.py +0 -25
- core/modules/bank/layerbank.py +0 -116
- core/modules/bank/mendi_finance.py +0 -57
- core/modules/bank/reactorfusion.py +0 -25
- core/modules/bank/zerolend.py +0 -36
- core/modules/bridge/__init__.py +0 -0
- core/modules/bridge/bridge.py +0 -8
- core/modules/bridge/coredao_bridge_sub.py +0 -47
- core/modules/bridge/orbiter_sub.py +0 -112
- core/modules/bridge/scroll_bridge_sub.py +0 -42
- core/modules/bridge/stargate_v2_sub.py +0 -74
- core/modules/bridge_module.py +0 -47
- core/modules/bungee.py +0 -109
- core/modules/cex_sender.py +0 -60
- core/modules/cex_subaccount_transfer.py +0 -34
- core/modules/cex_withdraw.py +0 -91
- core/modules/claimer.py +0 -45
- core/modules/claims/__init__.py +0 -0
- core/modules/claims/layerzero_claimer.py +0 -64
- core/modules/claims/rabby_claimer.py +0 -81
- core/modules/concrete_swap.py +0 -97
- core/modules/coredao_bridge.py +0 -32
- core/modules/coredao_bridge_auto.py +0 -39
- core/modules/debank_checker.py +0 -90
- core/modules/dmail.py +0 -54
- core/modules/erc20_balance.py +0 -42
- core/modules/intract/__init__.py +0 -0
- core/modules/intract/intract_api.py +0 -212
- core/modules/intract/utils.py +0 -81
- core/modules/intract_claim.py +0 -104
- core/modules/layer_2_20.py +0 -65
- core/modules/lending_module.py +0 -134
- core/modules/linea_appeal.py +0 -70
- core/modules/linea_poh_lxp.py +0 -64
- core/modules/liquidity/__init__.py +0 -0
- core/modules/liquidity/nile_pool.py +0 -64
- core/modules/liquidity/pool.py +0 -16
- core/modules/liquidity/syncswap_pool.py +0 -61
- core/modules/liquidity/velocore_pool.py +0 -55
- core/modules/liquidity/zerolend_liquidity.py +0 -26
- core/modules/liquidity_pool.py +0 -60
- core/modules/merkly_refuel.py +0 -87
- core/modules/modules.py +0 -4
- core/modules/nft/__init__.py +0 -0
- core/modules/nft/abbys_world.py +0 -22
- core/modules/nft/acg_worlds.py +0 -25
- core/modules/nft/alienswap_linea.py +0 -22
- core/modules/nft/arena_games.py +0 -22
- core/modules/nft/asmatch.py +0 -22
- core/modules/nft/battlemon.py +0 -25
- core/modules/nft/bilinear.py +0 -22
- core/modules/nft/bitavatar.py +0 -25
- core/modules/nft/culture_satoshi_universe.py +0 -24
- core/modules/nft/efrogs.py +0 -26
- core/modules/nft/empty_nft.py +0 -22
- core/modules/nft/era_domain.py +0 -42
- core/modules/nft/frog_war.py +0 -22
- core/modules/nft/frog_war_bonus.py +0 -22
- core/modules/nft/gamerboom.py +0 -25
- core/modules/nft/gamerboom_bonus.py +0 -26
- core/modules/nft/imagine.py +0 -32
- core/modules/nft/kreatorland_module.py +0 -35
- core/modules/nft/l2_telegraph_module.py +0 -22
- core/modules/nft/layer3_meta.py +0 -25
- core/modules/nft/linea_culture_2_2_linus.py +0 -24
- core/modules/nft/linea_culture_2_3_yooldo.py +0 -24
- core/modules/nft/linea_culture_2_4_frogwar.py +0 -24
- core/modules/nft/linea_culture_2_5_acg.py +0 -25
- core/modules/nft/linea_culture_2_6_ascend_the_end.py +0 -25
- core/modules/nft/linea_culture_3_1_ascend_the_end.py +0 -25
- core/modules/nft/linea_culture_3_2_sending_me.py +0 -25
- core/modules/nft/linea_culture_3_3_townstory.py +0 -25
- core/modules/nft/linea_culture_3_4_daniele.py +0 -25
- core/modules/nft/linea_culture_3_5_demmortal.py +0 -25
- core/modules/nft/linea_culture_3_6_foxy.py +0 -25
- core/modules/nft/linea_culture_4_1_coop_records.py +0 -60
- core/modules/nft/linea_culture_4_2_borja_moskv.py +0 -65
- core/modules/nft/linea_culture_4_2_borja_moskv_approve.py +0 -27
- core/modules/nft/linea_culture_4_3_fruit.py +0 -66
- core/modules/nft/linea_culture_4_4_fruit_crux.py +0 -67
- core/modules/nft/linea_culture_4_5_forbidden_fruit.py +0 -67
- core/modules/nft/linea_culture_4_6_laurent.py +0 -67
- core/modules/nft/linea_culture_day2.py +0 -20
- core/modules/nft/linea_culture_day3.py +0 -20
- core/modules/nft/linea_ens_names.py +0 -107
- core/modules/nft/lucky_cat.py +0 -25
- core/modules/nft/merkly_minter_module.py +0 -22
- core/modules/nft/micro3.py +0 -23
- core/modules/nft/mint_2048.py +0 -28
- core/modules/nft/nft_submodule.py +0 -16
- core/modules/nft/nidum.py +0 -87
- core/modules/nft/nidum_bonus.py +0 -23
- core/modules/nft/nomis.py +0 -64
- core/modules/nft/nomis_attest.py +0 -66
- core/modules/nft/nouns.py +0 -27
- core/modules/nft/octomos.py +0 -32
- core/modules/nft/omnisea.py +0 -33
- core/modules/nft/omnizone.py +0 -25
- core/modules/nft/orbiter_claim.py +0 -87
- core/modules/nft/readon.py +0 -30
- core/modules/nft/rubyscore.py +0 -45
- core/modules/nft/sarubol.py +0 -22
- core/modules/nft/satoshi_universe.py +0 -22
- core/modules/nft/scroll_canvas_attest_year_badge.py +0 -35
- core/modules/nft/scroll_canvas_mint.py +0 -51
- core/modules/nft/sign.py +0 -32
- core/modules/nft/snap.py +0 -25
- core/modules/nft/snap_bonus.py +0 -31
- core/modules/nft/social_scan.py +0 -22
- core/modules/nft/sub_module.py +0 -8
- core/modules/nft/tavaera.py +0 -30
- core/modules/nft/townstory.py +0 -75
- core/modules/nft/townstory_bonus.py +0 -45
- core/modules/nft/trusta_reputation.py +0 -48
- core/modules/nft/trustaa_poh.py +0 -49
- core/modules/nft/uber_poh.py +0 -24
- core/modules/nft/wizards_of_linea.py +0 -26
- core/modules/nft/yoddlo.py +0 -22
- core/modules/nft/yuliverse.py +0 -22
- core/modules/nft/zace.py +0 -25
- core/modules/nft/zks_domain.py +0 -41
- core/modules/nft_minter.py +0 -107
- core/modules/orbiter.py +0 -39
- core/modules/orbiter_checker.py +0 -26
- core/modules/rage.py +0 -54
- core/modules/scroll_bridge.py +0 -45
- core/modules/sell_all.py +0 -51
- core/modules/sleep_module.py +0 -25
- core/modules/smart_contract_deployment.py +0 -37
- core/modules/stargate/__init__.py +0 -0
- core/modules/stargate/auto_bridge.py +0 -91
- core/modules/stargate/bridge.py +0 -38
- core/modules/stargate/bridge_eth.py +0 -59
- core/modules/stargate/bridge_tokens.py +0 -48
- core/modules/stargate/classic_bridge.py +0 -34
- core/modules/stargate/farming.py +0 -163
- core/modules/stargate/l0_data.py +0 -10
- core/modules/stargate/pool.py +0 -74
- core/modules/stargate/stargate_balance_utils.py +0 -25
- core/modules/stargate/stargate_gas_checker.py +0 -68
- core/modules/swap/__init__.py +0 -1
- core/modules/swap/horizondex.py +0 -38
- core/modules/swap/izumi.py +0 -41
- core/modules/swap/lineaswap.py +0 -34
- core/modules/swap/maverick.py +0 -66
- core/modules/swap/mute.py +0 -39
- core/modules/swap/odos.py +0 -58
- core/modules/swap/one_inch.py +0 -58
- core/modules/swap/pancake.py +0 -41
- core/modules/swap/swap_facade.py +0 -10
- core/modules/swap/syncswap.py +0 -62
- core/modules/swap/velocore.py +0 -40
- core/modules/swap/woofi.py +0 -38
- core/modules/swap/xy_finance.py +0 -43
- core/modules/swap/zebra.py +0 -32
- core/modules/warm_up.py +0 -98
- core/modules/wrapping.py +0 -74
- core/modules/zkdx.py +0 -63
- tests/core/__init__.py +0 -0
- tests/core/contracts/__init__.py +0 -0
- tests/core/contracts/test_horizondex_quoter.py +0 -37
- tests/core/contracts/test_uniswap_quoter.py +0 -35
- tests/core/contracts/test_velocore_lens.py +0 -67
- tests/core/contracts/test_velocore_pool.py +0 -57
- tests/core/modules/__init__.py +0 -67
- tests/core/modules/swap/__init__.py +0 -0
- tests/core/modules/swap/test_horizondex.py +0 -37
- tests/core/modules/swap/test_lineaswap.py +0 -28
- tests/core/modules/swap/test_maverick.py +0 -31
- tests/core/modules/swap/test_mute.py +0 -29
- tests/core/modules/swap/test_odos.py +0 -36
- tests/core/modules/swap/test_pancake.py +0 -54
- tests/core/modules/swap/test_syncswap.py +0 -59
- tests/core/modules/swap/test_velocore.py +0 -33
- tests/core/modules/swap/test_woofi.py +0 -22
- tests/core/modules/test_bungee.py +0 -27
- tests/core/modules/test_concrete_swap.py +0 -62
- tests/core/modules/test_dmail.py +0 -41
- tests/core/modules/test_lending.py +0 -122
- tests/core/modules/test_nft.py +0 -32
- tests/core/modules/test_nft_minter.py +0 -30
- tests/core/modules/test_orbiter.py +0 -28
- tests/core/modules/test_sellall.py +0 -27
- tests/core/modules/test_send_to_cex.py +0 -27
- tests/core/modules/test_stargate_auto_bridge.py +0 -32
- tests/core/modules/test_stargate_bridge.py +0 -25
- tests/core/modules/test_stargate_farming.py +0 -108
- tests/core/modules/test_warmup.py +0 -78
- tests/core/modules/test_wrapping.py +0 -68
- tests/core/scenario/__init__.py +0 -0
- tests/core/scenario/module_0_test_config.py +0 -91
- tests/core/test_app.py +0 -19
- tests/core/test_config.py +0 -34
- web3_wizzard_lib/core/modules/modules.py +0 -27
- web3_wizzard_lib/core/modules/nft/sub_module.py +0 -8
- web3_wizzard_lib/core/modules/swap/swap_facade.py +0 -10
- {web3_wizzard_lib-0.0.2.data → web3_wizzard_lib-0.0.3.data}/data/requirements.txt +0 -0
- {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.0.3.dist-info}/top_level.txt +0 -0
@@ -1,107 +0,0 @@
|
|
1
|
-
from random import choices
|
2
|
-
from string import ascii_letters, digits
|
3
|
-
|
4
|
-
import requests
|
5
|
-
from eth_utils import keccak
|
6
|
-
from faker import Faker
|
7
|
-
from loguru import logger
|
8
|
-
from sybil_engine.data.networks import get_chain_instance
|
9
|
-
from sybil_engine.utils.app_account_utils import AppAccount
|
10
|
-
from sybil_engine.utils.retry import retry
|
11
|
-
from sybil_engine.utils.web3_utils import init_web3
|
12
|
-
|
13
|
-
from web3_wizzard_lib.core.contract.linea_ens_names_contract import LineaEnsNamesContract
|
14
|
-
from web3_wizzard_lib.core.modules import SubModule
|
15
|
-
from web3_wizzard_lib.core.modules import SkipRetryException
|
16
|
-
|
17
|
-
|
18
|
-
class LineaENSNames(SubModule):
|
19
|
-
module_name = 'LINEA_ENS'
|
20
|
-
nft_address = '0xDb75Db974B1F2bD3b5916d503036208064D18295'
|
21
|
-
|
22
|
-
def execute(self, account: AppAccount, chain='LINEA'):
|
23
|
-
self.sleep_after_conf = True
|
24
|
-
|
25
|
-
chain_instance = get_chain_instance(chain)
|
26
|
-
web3 = init_web3(chain_instance, account.proxy)
|
27
|
-
|
28
|
-
contract = LineaEnsNamesContract(self.nft_address, web3)
|
29
|
-
|
30
|
-
linea_name = self.get_available_name(contract)
|
31
|
-
|
32
|
-
if contract.redeemed(account):
|
33
|
-
#logger.info("[+] Web3 | Wallet already redeemed Linea name.")
|
34
|
-
raise SkipRetryException("[+] Web3 | Wallet already redeemed Linea name.")
|
35
|
-
|
36
|
-
logger.info(f"Minting {linea_name}.linea.eth for {account.address}")
|
37
|
-
duration = 60 * 60 * 24 * 365 * 3 # 3 years
|
38
|
-
secret, data = self.commit(account, linea_name, duration, contract)
|
39
|
-
|
40
|
-
# Uncomment the following line to perform the registration
|
41
|
-
self.register_poh(account, contract, data, duration, linea_name, secret)
|
42
|
-
|
43
|
-
def get_available_name(self, contract):
|
44
|
-
while True:
|
45
|
-
linea_name = self.generate_linea_name()
|
46
|
-
if contract.available(linea_name):
|
47
|
-
break
|
48
|
-
logger.warning(f'[-] Web3 | Linea name "{linea_name}.linea.eth" is unavailable. Retrying...')
|
49
|
-
return linea_name
|
50
|
-
|
51
|
-
@retry(max_attempts=20, retry_interval={'from': 10, 'to': 20})
|
52
|
-
def register_poh(self, account, contract, data, duration, linea_name, secret):
|
53
|
-
contract.register_poh(account, linea_name, duration, secret, data, self.get_poh_signature(account))
|
54
|
-
|
55
|
-
def generate_linea_name(self):
|
56
|
-
return Faker().user_name().replace('_', '-')
|
57
|
-
|
58
|
-
def log(self):
|
59
|
-
return "LINEA ENS"
|
60
|
-
|
61
|
-
def commit(self, account, linea_name: str, duration: int, linea_ens_contract):
|
62
|
-
secret = "0x" + ''.join(choices(ascii_letters + digits, k=10)).encode().hex().ljust(64, '0')
|
63
|
-
hashed_name = self.namehash(f"{linea_name}.linea.eth")
|
64
|
-
data = linea_ens_contract.addr_contract.functions.setAddr(
|
65
|
-
hashed_name, 60,
|
66
|
-
account.address
|
67
|
-
)._encode_transaction_data()
|
68
|
-
|
69
|
-
commitment = linea_ens_contract.make_commitment(
|
70
|
-
account,
|
71
|
-
linea_name,
|
72
|
-
duration,
|
73
|
-
secret,
|
74
|
-
data,
|
75
|
-
)
|
76
|
-
|
77
|
-
linea_ens_contract.commit(account, commitment)
|
78
|
-
|
79
|
-
return secret, data
|
80
|
-
|
81
|
-
def namehash(self, name: str):
|
82
|
-
labels = name.split('.')
|
83
|
-
labels.reverse()
|
84
|
-
result = "0000000000000000000000000000000000000000000000000000000000000000"
|
85
|
-
|
86
|
-
for label in labels:
|
87
|
-
hashed = keccak(text=label).hex()
|
88
|
-
result = keccak(hexstr=result + hashed).hex()
|
89
|
-
|
90
|
-
return "0x" + result
|
91
|
-
|
92
|
-
def sleep_after_conf(self):
|
93
|
-
return self.sleep_after_conf
|
94
|
-
|
95
|
-
def get_poh_signature(self, account):
|
96
|
-
headers = {
|
97
|
-
"Origin": "https://relay.link",
|
98
|
-
"Referer": "https://relay.link/"
|
99
|
-
}
|
100
|
-
|
101
|
-
r = requests.get(f'https://linea-poh-signer-api.linea.build/poh/{account.address}', headers=headers)
|
102
|
-
if len(r.text) == 132 and r.text.startswith("0x"):
|
103
|
-
return {"sign": r.text, "success": True, "msg": ""}
|
104
|
-
elif "address not POH" in r.text:
|
105
|
-
return {"sign": "", "success": False, "msg": "This wallet dont have POH"}
|
106
|
-
else:
|
107
|
-
raise Exception(r.text)
|
core/modules/nft/lucky_cat.py
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.send import Send
|
2
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
3
|
-
from sybil_engine.data.networks import get_chain_instance
|
4
|
-
from sybil_engine.domain.balance.balance import NativeBalance
|
5
|
-
from sybil_engine.utils.web3_utils import init_web3
|
6
|
-
|
7
|
-
from web3_wizzard_lib.core.modules import SubModule
|
8
|
-
|
9
|
-
|
10
|
-
class LuckyCat(SubModule):
|
11
|
-
module_name = 'LUCKYCAT'
|
12
|
-
|
13
|
-
def execute(self, account, chain='LINEA'):
|
14
|
-
chain_instance = get_chain_instance(chain)
|
15
|
-
web3 = init_web3(chain_instance, account.proxy)
|
16
|
-
|
17
|
-
contract_address = get_contracts_for_chain(chain)['LUCKYCAT']
|
18
|
-
|
19
|
-
send = Send(None, web3)
|
20
|
-
send.send_to_wallet(
|
21
|
-
account, contract_address, NativeBalance(0, chain, "ETH"), "0x70245bdc"
|
22
|
-
)
|
23
|
-
|
24
|
-
def log(self):
|
25
|
-
return "LUCKYCAT"
|
@@ -1,22 +0,0 @@
|
|
1
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
2
|
-
from sybil_engine.data.networks import get_chain_instance
|
3
|
-
from sybil_engine.utils.web3_utils import init_web3
|
4
|
-
|
5
|
-
from web3_wizzard_lib.core.contract.merkly_minter import MerklyMinter
|
6
|
-
from web3_wizzard_lib.core.modules import SubModule
|
7
|
-
|
8
|
-
|
9
|
-
class MerklyMinterModule(SubModule):
|
10
|
-
module_name = "MERKLY_MINTER"
|
11
|
-
|
12
|
-
def execute(self, account, chain='ZKSYNC'):
|
13
|
-
chain_instance = get_chain_instance(chain)
|
14
|
-
web3 = init_web3(chain_instance, account.proxy)
|
15
|
-
|
16
|
-
contract_address = get_contracts_for_chain(chain)['MERKLY']
|
17
|
-
merkly_minter = MerklyMinter(contract_address, web3)
|
18
|
-
|
19
|
-
merkly_minter.mint(account)
|
20
|
-
|
21
|
-
def log(self):
|
22
|
-
return "MERKLY MINTER"
|
core/modules/nft/micro3.py
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
2
|
-
from sybil_engine.data.networks import get_chain_instance
|
3
|
-
from sybil_engine.utils.web3_utils import init_web3
|
4
|
-
|
5
|
-
from web3_wizzard_lib.core.contract.micro3_contract import Micro3Contract
|
6
|
-
from web3_wizzard_lib.core.modules import SubModule
|
7
|
-
|
8
|
-
|
9
|
-
class Micro3(SubModule):
|
10
|
-
module_name = 'MICRO3'
|
11
|
-
|
12
|
-
def execute(self, account, chain='LINEA'):
|
13
|
-
chain_instance = get_chain_instance(chain)
|
14
|
-
web3 = init_web3(chain_instance, account.proxy)
|
15
|
-
|
16
|
-
contract_address = get_contracts_for_chain(chain)['MICRO3']
|
17
|
-
|
18
|
-
micro3_cotnract = Micro3Contract(contract_address, web3)
|
19
|
-
|
20
|
-
micro3_cotnract.purchase(account, 1)
|
21
|
-
|
22
|
-
def log(self):
|
23
|
-
return "MICRO3 NFT"
|
core/modules/nft/mint_2048.py
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
import secrets
|
2
|
-
|
3
|
-
from sybil_engine.contract.send import Send
|
4
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
5
|
-
from sybil_engine.data.networks import get_chain_instance
|
6
|
-
from sybil_engine.domain.balance.balance import NativeBalance
|
7
|
-
from sybil_engine.utils.web3_utils import init_web3
|
8
|
-
|
9
|
-
from web3_wizzard_lib.core.modules import SubModule
|
10
|
-
|
11
|
-
|
12
|
-
class Mint2048(SubModule):
|
13
|
-
module_name = '2048'
|
14
|
-
|
15
|
-
def execute(self, account, chain='LINEA'):
|
16
|
-
chain_instance = get_chain_instance(chain)
|
17
|
-
web3 = init_web3(chain_instance, account.proxy)
|
18
|
-
|
19
|
-
contract_address = get_contracts_for_chain(chain)['2048']
|
20
|
-
|
21
|
-
data = f'0x36ab86c4{secrets.token_hex(32)}0000000000000000000000000000000000000000000000000000000000000001'
|
22
|
-
send = Send(None, web3)
|
23
|
-
send.send_to_wallet(
|
24
|
-
account, contract_address, NativeBalance(0, chain, "ETH"), data
|
25
|
-
)
|
26
|
-
|
27
|
-
def log(self):
|
28
|
-
return "2048 NFT"
|
@@ -1,16 +0,0 @@
|
|
1
|
-
from sybil_engine.data.networks import get_chain_instance
|
2
|
-
from sybil_engine.utils.web3_utils import init_web3
|
3
|
-
|
4
|
-
from web3_wizzard_lib.core.modules import SubModule
|
5
|
-
|
6
|
-
|
7
|
-
class NftSubmodule(SubModule):
|
8
|
-
def execute(self, *args):
|
9
|
-
pass
|
10
|
-
|
11
|
-
def log(self):
|
12
|
-
pass
|
13
|
-
|
14
|
-
def create_web3(self, account, chain):
|
15
|
-
chain_instance = get_chain_instance(chain)
|
16
|
-
return init_web3(chain_instance, account.proxy)
|
core/modules/nft/nidum.py
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
from json import dumps
|
2
|
-
|
3
|
-
import requests
|
4
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
5
|
-
from sybil_engine.data.networks import get_chain_instance
|
6
|
-
from sybil_engine.utils.web3_utils import init_web3
|
7
|
-
|
8
|
-
from web3_wizzard_lib.core.contract.nidum_contract import NidumContract
|
9
|
-
from web3_wizzard_lib.core.modules.nft.sign import sign_msg
|
10
|
-
from web3_wizzard_lib.core.modules import SubModule
|
11
|
-
|
12
|
-
|
13
|
-
class Nidum(SubModule):
|
14
|
-
module_name = 'NIDUM'
|
15
|
-
|
16
|
-
def execute(self, account, chain='LINEA'):
|
17
|
-
chain_instance = get_chain_instance(chain)
|
18
|
-
web3 = init_web3(chain_instance, account.proxy)
|
19
|
-
|
20
|
-
contract_address = get_contracts_for_chain(chain)['NIDUM']
|
21
|
-
nidus_nft = NidumContract(contract_address, web3)
|
22
|
-
|
23
|
-
claim_data = request_ops(account, web3)
|
24
|
-
|
25
|
-
nidus_nft.mint_nft(account, claim_data)
|
26
|
-
|
27
|
-
def log(self):
|
28
|
-
return "NIDUM NFT"
|
29
|
-
|
30
|
-
|
31
|
-
def register_wallet(wallet):
|
32
|
-
url = f'https://auth.sidusheroes.com/api/v1/users'
|
33
|
-
headers = {'Content-Type': 'application/json'}
|
34
|
-
data = {'address': wallet.address.lower()}
|
35
|
-
json_data = dumps(data)
|
36
|
-
requests.post(url, data=json_data, headers=headers)
|
37
|
-
|
38
|
-
|
39
|
-
def get_msg(wallet):
|
40
|
-
url = 'https://auth.sidusheroes.com/api/v1/users/' + wallet.address.lower()
|
41
|
-
r = requests.get(url)
|
42
|
-
response = r.json()
|
43
|
-
nonce = response['data']['nonce']
|
44
|
-
msg_text = f'Please sign this message to connect to sidusheroes.com: {nonce}'
|
45
|
-
return msg_text
|
46
|
-
|
47
|
-
|
48
|
-
def auth(wallet, signature):
|
49
|
-
data = {"address": f"{wallet.address}", "signature": f"{signature}"}
|
50
|
-
json_data = dumps(data)
|
51
|
-
url = 'https://auth.sidusheroes.com/api/v1/auth'
|
52
|
-
headers = {'Content-Type': 'application/json'}
|
53
|
-
r = requests.post(url, data=json_data, headers=headers)
|
54
|
-
response = r.json()
|
55
|
-
bearer = response['data']['accessToken']
|
56
|
-
return bearer
|
57
|
-
|
58
|
-
|
59
|
-
def get_token_data(wallet, bearer):
|
60
|
-
url = f'https://plsrv.sidusheroes.com/shadow-game-linea/api/v1/item'
|
61
|
-
headers = {'Content-Type': 'application/json', 'Authorization': f'Bearer {bearer}'}
|
62
|
-
data = {"user": f"{wallet.address.lower()}", "contract": "0x34Be5b8C30eE4fDe069DC878989686aBE9884470", "tokenId": 9}
|
63
|
-
json_data = dumps(data)
|
64
|
-
r = requests.post(url, data=json_data, headers=headers)
|
65
|
-
|
66
|
-
|
67
|
-
def get_claim_data(wallet, bearer):
|
68
|
-
url = 'https://plsrv.sidusheroes.com/shadow-game-linea/api/v1/claim'
|
69
|
-
headers = {'Content-Type': 'application/json', 'Authorization': f'Bearer {bearer}',
|
70
|
-
'Content-Length': '151', 'If-None-Match': 'W/"81-IPXBWNB48bs1CNK6NL+XgeHJooA"'}
|
71
|
-
data = {"contract": "0x34Be5b8C30eE4fDe069DC878989686aBE9884470",
|
72
|
-
"user": f'{wallet.address.lower()}',
|
73
|
-
"tokensData": [{"tokenId": 9, "amount": 1}]}
|
74
|
-
json_data = dumps(data)
|
75
|
-
r = requests.post(url, data=json_data, headers=headers)
|
76
|
-
response = r.json()
|
77
|
-
return response
|
78
|
-
|
79
|
-
|
80
|
-
def request_ops(wallet, web3):
|
81
|
-
register_wallet(wallet)
|
82
|
-
msg_text = get_msg(wallet)
|
83
|
-
signature = sign_msg(wallet, msg_text, web3)
|
84
|
-
bearer = auth(wallet, signature)
|
85
|
-
get_token_data(wallet, bearer)
|
86
|
-
claim_data = get_claim_data(wallet, bearer)
|
87
|
-
return claim_data
|
core/modules/nft/nidum_bonus.py
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
2
|
-
from sybil_engine.data.networks import get_chain_instance
|
3
|
-
from sybil_engine.utils.web3_utils import init_web3
|
4
|
-
|
5
|
-
from web3_wizzard_lib.core.contract.nidum_contract import NidumContract
|
6
|
-
from web3_wizzard_lib.core.modules import SubModule
|
7
|
-
|
8
|
-
|
9
|
-
class NidumBonus(SubModule):
|
10
|
-
module_name = 'NIDUM_BONUS'
|
11
|
-
allow_reuse_address = True
|
12
|
-
|
13
|
-
def execute(self, account, chain='LINEA'):
|
14
|
-
chain_instance = get_chain_instance(chain)
|
15
|
-
web3 = init_web3(chain_instance, account.proxy)
|
16
|
-
|
17
|
-
contract_address = get_contracts_for_chain(chain)['NIDUM']
|
18
|
-
nidum_nft = NidumContract(contract_address, web3)
|
19
|
-
|
20
|
-
nidum_nft.burn(account)
|
21
|
-
|
22
|
-
def log(self):
|
23
|
-
return "NIDUM BONUS NFT"
|
core/modules/nft/nomis.py
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
import requests
|
2
|
-
from loguru import logger
|
3
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
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.nomis_contract import NomisContract
|
8
|
-
from web3_wizzard_lib.core.modules import SubModule
|
9
|
-
|
10
|
-
|
11
|
-
class Nomis(SubModule):
|
12
|
-
module_name = 'NOMIS'
|
13
|
-
|
14
|
-
def execute(self, account, chain='LINEA'):
|
15
|
-
chain_instance = get_chain_instance(chain)
|
16
|
-
web3 = init_web3(chain_instance, account.proxy)
|
17
|
-
|
18
|
-
contract_address = get_contracts_for_chain(chain)['NOMIS']
|
19
|
-
|
20
|
-
response = requests.get(f'https://bg.nomis.cc/api/proxy/linea/wallet/{account.address}/score?scoreType=0&calculationModel=14&UseTokenLists=false&nonce=0&deadline=1790647549&GetCyberConnectProtocolData=false&prepareToMint=true&MintChain=0&ShouldGetReferrerCode=false&disableProxy=true&referrerCode=nomis', timeout=10)
|
21
|
-
|
22
|
-
signature = response.json()['data']['mintData']['signature']
|
23
|
-
mintedScore = response.json()['data']['mintData']['mintedScore']
|
24
|
-
deadline = response.json()['data']['mintData']['deadline']
|
25
|
-
metadataUrl = response.json()['data']['mintData']['metadataUrl']
|
26
|
-
chainId = response.json()['data']['mintData']['chainId']
|
27
|
-
referralCode = response.json()['data']['mintData']['referralCode']
|
28
|
-
referrerCode = response.json()['data']['mintData']['referrerCode']
|
29
|
-
calculationModel = response.json()['data']['mintData']['calculationModel']
|
30
|
-
onftMetadataUrl = response.json()['data']['mintData']['onftMetadataUrl']
|
31
|
-
|
32
|
-
nomis_contract = NomisContract(contract_address, web3)
|
33
|
-
|
34
|
-
if mintedScore < 3000:
|
35
|
-
formatted_score = "{:.2f}".format(mintedScore / 100)
|
36
|
-
logger.info(f"Minted score is {formatted_score}, minimum 30 is required, skip account")
|
37
|
-
return
|
38
|
-
|
39
|
-
nomis_contract.set_score(
|
40
|
-
account,
|
41
|
-
signature,
|
42
|
-
mintedScore,
|
43
|
-
calculationModel,
|
44
|
-
deadline,
|
45
|
-
metadataUrl,
|
46
|
-
chainId,
|
47
|
-
referralCode,
|
48
|
-
referrerCode,
|
49
|
-
onftMetadataUrl
|
50
|
-
)
|
51
|
-
|
52
|
-
def log(self):
|
53
|
-
return "NOMIS POH"
|
54
|
-
|
55
|
-
|
56
|
-
def get_attest_data_media(token_auth):
|
57
|
-
url = 'https://mp.trustalabs.ai/accounts/attest_calldata?attest_type=media'
|
58
|
-
headers = {'Authorization': f'TOKEN {token_auth}', 'Accept': 'application/json'}
|
59
|
-
r = requests.get(url, headers=headers)
|
60
|
-
if r.status_code == 200:
|
61
|
-
res = [r.json()]
|
62
|
-
if res[0]['code'] == 0:
|
63
|
-
txn_calldata = res[0]['data']
|
64
|
-
return txn_calldata
|
core/modules/nft/nomis_attest.py
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
import requests
|
2
|
-
from loguru import logger
|
3
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
4
|
-
from sybil_engine.data.networks import get_chain_instance
|
5
|
-
from sybil_engine.utils.retry import retry
|
6
|
-
from sybil_engine.utils.web3_utils import init_web3
|
7
|
-
|
8
|
-
from web3_wizzard_lib.core.contract.nomis_attest_contract import NomisAttestContract
|
9
|
-
from web3_wizzard_lib.core.modules import SubModule
|
10
|
-
|
11
|
-
|
12
|
-
class NomisAttest(SubModule):
|
13
|
-
module_name = 'NOMIS_ATTEST'
|
14
|
-
|
15
|
-
def execute(self, account, chain='LINEA'):
|
16
|
-
chain_instance = get_chain_instance(chain)
|
17
|
-
web3 = init_web3(chain_instance, account.proxy)
|
18
|
-
|
19
|
-
contract_address = get_contracts_for_chain(chain)['NOMIS_ATTEST']
|
20
|
-
|
21
|
-
url_template = f'http://nomis.cc/api/proxy/verax/attestation-data?address={account.address}&nonce=0'
|
22
|
-
|
23
|
-
response = self.get_attest(url_template)
|
24
|
-
|
25
|
-
mintedScore = response['data']['value']
|
26
|
-
|
27
|
-
if mintedScore < 3000:
|
28
|
-
formatted_score = "{:.2f}".format(mintedScore / 100)
|
29
|
-
logger.info(f"Minted score is {formatted_score}, minimum 30 is required, skip account")
|
30
|
-
return
|
31
|
-
|
32
|
-
schema = response['data']['schema']
|
33
|
-
expirationTime = response['data']['expirationTime']
|
34
|
-
revocable = response['data']['revocable']
|
35
|
-
tokenId = response['data']['tokenId']
|
36
|
-
updated = response['data']['updated']
|
37
|
-
value = response['data']['value']
|
38
|
-
chainId = response['data']['chainId']
|
39
|
-
calcModel = response['data']['calcModel']
|
40
|
-
validationPayload = response['data']['validationPayload']
|
41
|
-
|
42
|
-
nomis_attest_contract = NomisAttestContract(contract_address, web3)
|
43
|
-
|
44
|
-
nomis_attest_contract.attest(
|
45
|
-
account,
|
46
|
-
schema,
|
47
|
-
expirationTime,
|
48
|
-
revocable,
|
49
|
-
tokenId,
|
50
|
-
updated,
|
51
|
-
value,
|
52
|
-
chainId,
|
53
|
-
calcModel,
|
54
|
-
validationPayload
|
55
|
-
)
|
56
|
-
|
57
|
-
@retry(max_attempts=15, retry_interval={'from': 60 * 1, 'to': 60 * 4})
|
58
|
-
def get_attest(self, url_template):
|
59
|
-
response = requests.get(url_template)
|
60
|
-
if response.status_code == 200:
|
61
|
-
return response.json()
|
62
|
-
else:
|
63
|
-
raise Exception(f"HTTP error {response.json()}")
|
64
|
-
|
65
|
-
def log(self):
|
66
|
-
return "ATTEST NOMIS SCORE"
|
core/modules/nft/nouns.py
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.send import Send
|
2
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
3
|
-
from sybil_engine.data.networks import get_chain_instance
|
4
|
-
from sybil_engine.domain.balance.balance import NativeBalance
|
5
|
-
from sybil_engine.utils.web3_utils import init_web3
|
6
|
-
|
7
|
-
from web3_wizzard_lib.core.modules import SubModule
|
8
|
-
|
9
|
-
|
10
|
-
class Nouns(SubModule):
|
11
|
-
module_name = 'NOUNS'
|
12
|
-
|
13
|
-
def execute(self, account, chain='LINEA'):
|
14
|
-
chain_instance = get_chain_instance(chain)
|
15
|
-
web3 = init_web3(chain_instance, account.proxy)
|
16
|
-
|
17
|
-
contract_address = get_contracts_for_chain(chain)['NOUNS']
|
18
|
-
|
19
|
-
data = f'0x57bc3d78000000000000000000000000{account.address[2:]}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
|
20
|
-
|
21
|
-
send = Send(None, web3)
|
22
|
-
send.send_to_wallet(
|
23
|
-
account, contract_address, NativeBalance(0, chain, "ETH"), data
|
24
|
-
)
|
25
|
-
|
26
|
-
def log(self):
|
27
|
-
return "NOUNS NFT"
|
core/modules/nft/octomos.py
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
2
|
-
from sybil_engine.data.networks import get_chain_instance
|
3
|
-
from sybil_engine.utils.web3_utils import init_web3
|
4
|
-
from web3 import Web3
|
5
|
-
|
6
|
-
from web3_wizzard_lib.core.contract.octomos import OctomosContract
|
7
|
-
from web3_wizzard_lib.core.modules import SubModule
|
8
|
-
|
9
|
-
|
10
|
-
class Octomos(SubModule):
|
11
|
-
module_name = 'OCTOMOS'
|
12
|
-
|
13
|
-
def execute(self, account, chain='LINEA'):
|
14
|
-
chain_instance = get_chain_instance(chain)
|
15
|
-
web3 = init_web3(chain_instance, account.proxy)
|
16
|
-
|
17
|
-
contract_address = get_contracts_for_chain(chain)['OCTOMOS']
|
18
|
-
|
19
|
-
octomos_contract = OctomosContract(contract_address, web3)
|
20
|
-
|
21
|
-
octomos_contract.launchpadBuy(
|
22
|
-
account,
|
23
|
-
Web3.to_bytes(hexstr='0x0c21cfbb').ljust(4, b'\0'),
|
24
|
-
Web3.to_bytes(hexstr='0x53b93973').ljust(4, b'\0'),
|
25
|
-
0,
|
26
|
-
1,
|
27
|
-
[],
|
28
|
-
b''
|
29
|
-
)
|
30
|
-
|
31
|
-
def log(self):
|
32
|
-
return "OCTOMOS"
|
core/modules/nft/omnisea.py
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
import random
|
2
|
-
|
3
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
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.omnisea import OmniSea
|
8
|
-
from web3_wizzard_lib.core.modules import SubModule
|
9
|
-
|
10
|
-
|
11
|
-
class OmniSeaModule(SubModule):
|
12
|
-
module_name = 'OMNI_SEA'
|
13
|
-
|
14
|
-
def execute(self, account, chain='ZKSYNC'):
|
15
|
-
|
16
|
-
chain_instance = get_chain_instance(chain)
|
17
|
-
web3 = init_web3(chain_instance, account.proxy)
|
18
|
-
|
19
|
-
contract_address = get_contracts_for_chain(chain)['OMNISEA']
|
20
|
-
omnisea = OmniSea(contract_address, web3)
|
21
|
-
|
22
|
-
title, symbol = self.generate_collection_data()
|
23
|
-
|
24
|
-
omnisea.create(account, title, symbol)
|
25
|
-
|
26
|
-
@staticmethod
|
27
|
-
def generate_collection_data():
|
28
|
-
title = "".join(random.sample([chr(i) for i in range(97, 123)], random.randint(5, 15)))
|
29
|
-
symbol = "".join(random.sample([chr(i) for i in range(65, 91)], random.randint(3, 6)))
|
30
|
-
return title, symbol
|
31
|
-
|
32
|
-
def log(self):
|
33
|
-
return "OMNI SEA COLLECTION"
|
core/modules/nft/omnizone.py
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
from sybil_engine.contract.send import Send
|
2
|
-
from sybil_engine.data.contracts import get_contracts_for_chain
|
3
|
-
from sybil_engine.data.networks import get_chain_instance
|
4
|
-
from sybil_engine.domain.balance.balance import NativeBalance
|
5
|
-
from sybil_engine.utils.web3_utils import init_web3
|
6
|
-
|
7
|
-
from web3_wizzard_lib.core.modules import SubModule
|
8
|
-
|
9
|
-
|
10
|
-
class Omnizone(SubModule):
|
11
|
-
module_name = 'OMNIZONE'
|
12
|
-
|
13
|
-
def execute(self, account, chain='LINEA'):
|
14
|
-
chain_instance = get_chain_instance(chain)
|
15
|
-
web3 = init_web3(chain_instance, account.proxy)
|
16
|
-
|
17
|
-
contract_address = get_contracts_for_chain(chain)['OMNIZONE']
|
18
|
-
|
19
|
-
send = Send(None, web3)
|
20
|
-
send.send_to_wallet(
|
21
|
-
account, contract_address, NativeBalance(0, chain, "ETH"), "0x1249c58b"
|
22
|
-
)
|
23
|
-
|
24
|
-
def log(self):
|
25
|
-
return "OMNIZONE NFT"
|
@@ -1,87 +0,0 @@
|
|
1
|
-
import requests
|
2
|
-
from eth_account import Account
|
3
|
-
from eth_account.messages import encode_defunct
|
4
|
-
from loguru import logger
|
5
|
-
from sybil_engine.contract.send import Send
|
6
|
-
from sybil_engine.data.networks import get_chain_instance
|
7
|
-
from sybil_engine.domain.balance.balance import NativeBalance
|
8
|
-
from sybil_engine.utils.web3_utils import init_web3
|
9
|
-
from web3_wizzard_lib.core.modules import SubModule
|
10
|
-
|
11
|
-
|
12
|
-
class OrbiterClaim(SubModule):
|
13
|
-
module_name = 'ORBITER_CLAIM'
|
14
|
-
|
15
|
-
nft_address = "0x13dFDd3a9B39323F228Daf73B62C23F7017E4679"
|
16
|
-
|
17
|
-
def execute(self, account, chain='ARBITRUM'):
|
18
|
-
|
19
|
-
# message to sign Orbiter Airdrop
|
20
|
-
message_text = "Orbiter Airdrop"
|
21
|
-
text_hex = "0x" + message_text.encode('utf-8').hex()
|
22
|
-
text_encoded = encode_defunct(hexstr=text_hex)
|
23
|
-
signed_message = Account.sign_message(text_encoded, private_key=account.key)
|
24
|
-
|
25
|
-
signature = f'0x{signed_message.signature.hex()}'
|
26
|
-
headers = {
|
27
|
-
"token": signature
|
28
|
-
}
|
29
|
-
|
30
|
-
result = requests.post(
|
31
|
-
"https://airdrop-api.orbiter.finance/airdrop/snapshot",
|
32
|
-
headers=headers
|
33
|
-
).json()
|
34
|
-
|
35
|
-
chain_id = result['result']['chainId']
|
36
|
-
|
37
|
-
chain, data = self.form_data(chain, chain_id, result)
|
38
|
-
|
39
|
-
try:
|
40
|
-
self.send_transaction(account, chain, data)
|
41
|
-
except Exception as e:
|
42
|
-
self.send_transaction(account, chain, data.replace("0000000000000000014", "0000000000000000013"))
|
43
|
-
|
44
|
-
def form_data(self, chain, chain_id, result):
|
45
|
-
amount_str = result['result']['proof'][0]['amount']
|
46
|
-
logger.info(f"Orbiter Airdrop snapshot result: {amount_str}")
|
47
|
-
amount_int = int(amount_str.replace(".", ""))
|
48
|
-
logger.info(f"AMOUNT INT: {amount_int}")
|
49
|
-
hex_value = hex(amount_int)[2:]
|
50
|
-
logger.info(f"AMOUNT: {hex_value}")
|
51
|
-
logger.info(f"HEX {hex_value}")
|
52
|
-
if int(chain_id) == 42161:
|
53
|
-
chain = 'ARBITRUM'
|
54
|
-
data = "0xfa5c4e99071cbb2ff029ddaf4b691745b2ba185cbe9ca2f5fa9e7358bada8fbdce764291"
|
55
|
-
data += f"0000000000000000000000000000000000000000000000{hex_value}00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000014"
|
56
|
-
else:
|
57
|
-
data = "0xfa5c4e995d32ba2a988b8fa6c2ae96d3b5980c67e8d8cfbf0d4c89479b79c1e277843438"
|
58
|
-
data += f"000000000000000000000000000000000000000000000010b202b565eb37160000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000010"
|
59
|
-
chain = 'BASE'
|
60
|
-
for line_data in result['result']['proof'][0]['data']:
|
61
|
-
data += line_data[2:]
|
62
|
-
logger.info(data)
|
63
|
-
return chain, data
|
64
|
-
|
65
|
-
def send_transaction(self, account, chain, data):
|
66
|
-
chain_instance = get_chain_instance(chain)
|
67
|
-
web3 = init_web3(chain_instance, account.proxy)
|
68
|
-
Send(None, web3).send_to_wallet(
|
69
|
-
account,
|
70
|
-
self.nft_address,
|
71
|
-
NativeBalance(0, chain, "ETH"),
|
72
|
-
data
|
73
|
-
)
|
74
|
-
|
75
|
-
def log(self):
|
76
|
-
return "ORBITER NFT"
|
77
|
-
|
78
|
-
def round_to_custom_precision(number, precision):
|
79
|
-
# Find the rounding factor (10^precision)
|
80
|
-
factor = 10 ** precision
|
81
|
-
# Perform rounding
|
82
|
-
return round(number / factor) * factor
|
83
|
-
|
84
|
-
|
85
|
-
def truncate_to_decimal_places(value, decimals):
|
86
|
-
factor = 10 ** decimals
|
87
|
-
return int(float(int(value * factor)) / factor)
|