forked from karamelniycoder/l0_sybil_checker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
30 lines (23 loc) · 1.04 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from excel import Excel
print(f'\n\nLayerZero Sybil Checker\n')
L0_sybils_raw = []
L0_sybils = {}
for i in range(1, 6):
with open(f'sybil_list/L0_sybils{i}.txt') as f: L0_sybils_raw += f.read().splitlines()
L0_sybils = {sybil.split(',')[-1].lower(): sybil.split(',')[0] for sybil in L0_sybils_raw}
with open('addresses.txt') as f: addresses = f.read().splitlines()
excel = Excel(total_len=len(addresses), name="sybil")
total_sybil = 0
for index, address in enumerate(addresses):
sybil = address.lower() in L0_sybils
if sybil:
print(f'[-] [{index+1}/{len(addresses)}] {address}: SYBIL !!!')
total_sybil += 1
status = "Sybil"
data = [address, "Sybil", L0_sybils[address.lower()]]
else:
print(f'[+] [{index+1}/{len(addresses)}] {address}: not sybil')
data = [address, "Not sybil"]
excel.edit_table(data=data)
excel.edit_table(data=[f"Total sybils: {total_sybil}/{len(addresses)}"])
input(f'\nTotal sybils: {total_sybil}/{len(addresses)}\nResults saved in results/{excel.file_name}\n\n> Exit')