powerdlz23 1.1.5 → 1.1.7

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 (46) hide show
  1. package/Zefoy-Automation/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  2. package/Zefoy-Automation/README.md +134 -0
  3. package/Zefoy-Automation/captcha.png +0 -0
  4. package/Zefoy-Automation/donation-userlist.md +7 -0
  5. package/Zefoy-Automation/main.py +257 -0
  6. package/Zefoy-Automation/output/Zefoy Automation for Windows.exe +0 -0
  7. package/Zefoy-Automation/requirements.txt +5 -0
  8. package/Zefoy-Automation/src/captcha.png +0 -0
  9. package/Zefoy-Automation/src/process.py +269 -0
  10. package/package.json +1 -1
  11. package/polymer/polymer-template/.env.example +27 -0
  12. package/polymer/polymer-template/.gitmodules +6 -0
  13. package/polymer/polymer-template/.gitpod.yml +10 -0
  14. package/polymer/polymer-template/Justfile +97 -0
  15. package/polymer/polymer-template/README.md +312 -0
  16. package/polymer/polymer-template/config/alt-config.json +42 -0
  17. package/polymer/polymer-template/config.json +42 -0
  18. package/polymer/polymer-template/contracts/XCounter.sol +89 -0
  19. package/polymer/polymer-template/contracts/XCounterUC.sol +100 -0
  20. package/polymer/polymer-template/contracts/arguments.js +7 -0
  21. package/polymer/polymer-template/contracts/base/CustomChanIbcApp.sol +205 -0
  22. package/polymer/polymer-template/contracts/base/GeneralMiddleware.sol +200 -0
  23. package/polymer/polymer-template/contracts/base/UniversalChanIbcApp.sol +93 -0
  24. package/polymer/polymer-template/foundry.toml +6 -0
  25. package/polymer/polymer-template/hardhat.config.js +66 -0
  26. package/polymer/polymer-template/ibc.json +26 -0
  27. package/polymer/polymer-template/img/gh_template.png +0 -0
  28. package/polymer/polymer-template/package-lock.json +7672 -0
  29. package/polymer/polymer-template/package.json +34 -0
  30. package/polymer/polymer-template/remappings.txt +5 -0
  31. package/polymer/polymer-template/scripts/deploy.js +51 -0
  32. package/polymer/polymer-template/scripts/private/_create-channel-config.js +62 -0
  33. package/polymer/polymer-template/scripts/private/_create-channel.js +96 -0
  34. package/polymer/polymer-template/scripts/private/_deploy-config.js +62 -0
  35. package/polymer/polymer-template/scripts/private/_events.js +241 -0
  36. package/polymer/polymer-template/scripts/private/_helpers.js +113 -0
  37. package/polymer/polymer-template/scripts/private/_sanity-check-custom.js +69 -0
  38. package/polymer/polymer-template/scripts/private/_sanity-check-universal.js +120 -0
  39. package/polymer/polymer-template/scripts/private/_sanity-check.js +21 -0
  40. package/polymer/polymer-template/scripts/private/_send-packet-config.js +53 -0
  41. package/polymer/polymer-template/scripts/private/_set-contracts-config.js +50 -0
  42. package/polymer/polymer-template/scripts/private/_switch-clients.js +90 -0
  43. package/polymer/polymer-template/scripts/private/_update-vibc-address.js +52 -0
  44. package/polymer/polymer-template/scripts/private/_vibc-helpers.js +118 -0
  45. package/polymer/polymer-template/scripts/send-packet.js +38 -0
  46. package/polymer/polymer-template/scripts/send-universal-packet.js +44 -0
@@ -0,0 +1,269 @@
1
+ from urllib.parse import urlparse
2
+ from bs4 import BeautifulSoup
3
+ import urllib.parse
4
+ import requests
5
+ import base64
6
+ import re
7
+
8
+ #
9
+ # for debug
10
+ # from requests_toolbelt.utils import dump
11
+
12
+
13
+ class ZefoyViews:
14
+ API_ZEFOY = 'https://zefoy.com/'
15
+ API_VISION = 'https://api.sandroputraa.com/zefoy.php'
16
+
17
+ STATIC_HEADERS = {
18
+ "Host": "zefoy.com",
19
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
20
+ "x-requested-with": "XMLHttpRequest",
21
+ "origin": "https://zefoy.com",
22
+ }
23
+
24
+ STATIC_ENDPOINT = {}
25
+
26
+ def __init__(self):
27
+ self.key_views = None
28
+ self.session = requests.Session()
29
+ self.captcha = None
30
+ self.phpsessid = None
31
+
32
+ def google_ads_inject(self):
33
+
34
+ request_gfp = self.session.get(
35
+ url='https://partner.googleadservices.com/gampad/cookie.js?domain=zefoy.com&callback=_gfp_s_&client=ca-pub-3192305768699763&gpid_exp=1 ',
36
+ headers={
37
+ "Host": "partner.googleadservices.com",
38
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
39
+ }
40
+ )
41
+
42
+ self.session.cookies.set("_gads", request_gfp.text.strip().split('_value_":"')[1].split('","_expires_')[0],
43
+ domain='zefoy.com')
44
+ self.session.cookies.set("__gpi", request_gfp.text.strip().split('_value_":"')[2].split('","_expires_')[0],
45
+ domain='zefoy.com')
46
+
47
+ def captcha_solver(self):
48
+ try:
49
+ solve_captcha = requests.post(
50
+ url=self.API_VISION,
51
+ headers={
52
+ 'Content-Type': 'application/json',
53
+ 'Auth': 'sandro_putraa',
54
+ 'Host': 'api.sandroputraa.com',
55
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36',
56
+ },
57
+ json={
58
+ "img": base64.b64encode(open('captcha.png', 'rb').read()).decode('utf-8')
59
+ }
60
+ )
61
+
62
+ if "RESOURCE_EXHAUSTED" in solve_captcha.text:
63
+ exit("API Limit Reached")
64
+
65
+ if "PERMISSION_DENIED" in solve_captcha.text:
66
+ exit("API Limit Reached")
67
+
68
+ if not solve_captcha.json()['Data'].isascii():
69
+ return "reload"
70
+
71
+ # is special character in captcha
72
+ if any(char in solve_captcha.json()['Data'] for char in
73
+ ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '_', '+', '=', '[', ']', '{', '}', '|', ';',
74
+ ':', '"', "'", ',', '<', '.', '>', '/', '?']):
75
+ return "reload"
76
+
77
+ # is number in captcha
78
+ if any(char.isdigit() for char in solve_captcha.json()['Data']):
79
+ return "reload"
80
+
81
+ if solve_captcha.status_code == 200 and solve_captcha.json()['message'] == 'Success':
82
+
83
+ return solve_captcha.json()['Data'].split('\n')[0].strip()
84
+
85
+ else:
86
+ exit("Error: " + solve_captcha.json()['message'])
87
+
88
+ except TypeError:
89
+ return "reload"
90
+
91
+ def get_session_captcha(self):
92
+
93
+ homepage = self.session.get(
94
+ url=self.API_ZEFOY,
95
+ headers=self.STATIC_HEADERS
96
+ )
97
+ soup = BeautifulSoup(homepage.text, 'html.parser')
98
+
99
+ if homepage.cookies.get_dict().get('gfp') is None:
100
+ self.google_ads_inject()
101
+
102
+ # Download Captcha Image
103
+ try:
104
+
105
+ request_captcha_image = self.session.get(
106
+ url=self.API_ZEFOY + soup.find('img', {'alt': 'CAPTCHA code'}).get('src'),
107
+ headers=self.STATIC_HEADERS,
108
+ )
109
+
110
+ with open('captcha.png', 'wb') as f:
111
+ f.write(request_captcha_image.content)
112
+
113
+ except AttributeError:
114
+ self.get_session_captcha()
115
+
116
+ def post_solve_captcha(self, captcha_result):
117
+ try:
118
+
119
+ self.STATIC_HEADERS['content-type'] = "application/x-www-form-urlencoded; charset=UTF-8"
120
+
121
+ post_captcha = self.session.post(
122
+ url=self.API_ZEFOY,
123
+ headers=self.STATIC_HEADERS,
124
+ data={
125
+ 'captcha_secure': captcha_result,
126
+ 'r75619cf53f5a5d7aa6af82edfec3bf0': '',
127
+ }
128
+ )
129
+ soup = BeautifulSoup(post_captcha.text, 'html.parser')
130
+ self.key_views = soup.find('input', {'placeholder': 'Enter Video URL'}).get('name')
131
+ return True
132
+ except Exception as e:
133
+ return "Error: " + str(e)
134
+
135
+ def get_status_services(self):
136
+ try:
137
+ temp_status_1 = []
138
+ temp_status_2 = []
139
+
140
+ self.STATIC_HEADERS['content-type'] = "application/x-www-form-urlencoded; charset=UTF-8"
141
+
142
+ get_status_services = self.session.get(
143
+ url=self.API_ZEFOY,
144
+ headers=self.STATIC_HEADERS,
145
+ )
146
+ soup = BeautifulSoup(get_status_services.text, 'html.parser')
147
+
148
+ for x in soup.find_all('div', {'class': 'col-sm-9 col-xs-12 p-1 container'}):
149
+ temp_status_1.append({
150
+ 'name': x.find('h5').text.strip(),
151
+ 'key': x.find('form').get('action').strip(),
152
+ })
153
+
154
+ for i in soup.find_all('div', {'class': 'col-sm-4 col-xs-12 p-1 colsmenu'}):
155
+ temp_status_2.append({
156
+ 'name': i.findNext('h5').text.strip(),
157
+ 'status': i.findNext('small').text.strip()
158
+ })
159
+
160
+ for key in temp_status_1:
161
+ for status in temp_status_2:
162
+ if key['name'] == status['name']:
163
+ self.STATIC_ENDPOINT.update(
164
+ {
165
+ status['name']: key['key']
166
+ }
167
+ )
168
+
169
+ return temp_status_2
170
+
171
+ except Exception:
172
+ self.get_status_services()
173
+
174
+ def send_multi_services(self, url_video, services):
175
+ global soup
176
+ try:
177
+
178
+ self.STATIC_HEADERS['content-type'] = "application/x-www-form-urlencoded; charset=UTF-8"
179
+
180
+ post_services = self.session.post(
181
+ url=self.API_ZEFOY + self.STATIC_ENDPOINT[services],
182
+ headers=self.STATIC_HEADERS,
183
+ data={
184
+ self.key_views: url_video,
185
+ },
186
+ )
187
+
188
+ decode_old = base64.b64decode(urllib.parse.unquote(post_services.text[::-1])).decode()
189
+ soup = BeautifulSoup(decode_old, 'html.parser')
190
+ if "This service is currently not working" in soup.text:
191
+ exit("This service is currently not working")
192
+
193
+ if "An error occurred. Please try again." in decode_old:
194
+
195
+ decode = self.force_send_multi_services(
196
+ url_video=url_video,
197
+ old_request=decode_old,
198
+ services=services
199
+ )
200
+
201
+ # print("Force Send: " + decode.__str__())
202
+ soupDecode = BeautifulSoup(decode, 'html.parser')
203
+ if "Successfully " + services.lower() + " sent." in soupDecode.text:
204
+ return {
205
+ 'message': 'Successfully ' + services.lower() + ' sent.',
206
+ 'data': soup.find('button').text.strip()
207
+ }
208
+
209
+ elif services + " successfully sent" in soupDecode.find('span').text:
210
+ return {
211
+ 'message': services + ' successfully sent.',
212
+ 'data': soup.find('button').text.strip() + " > " + soupDecode.find('span').text.strip()
213
+ }
214
+
215
+ else:
216
+ return {
217
+ 'message': 'Another State',
218
+ 'data': soup.find('button').text.strip()
219
+ }
220
+
221
+ elif "Successfully " + services.lower() + " sent." in decode_old:
222
+ return {
223
+ 'message': 'Successfully ' + services.lower() + ' sent.',
224
+ 'data': soup.find('button').text.strip()
225
+ }
226
+
227
+ elif "Session Expired. Please Re Login!" in decode_old:
228
+ return {
229
+ 'message': 'Please try again later. Server too busy.',
230
+ }
231
+
232
+ elif "Not found video." in decode_old:
233
+ return {
234
+ 'message': 'Video not found.',
235
+ }
236
+
237
+ # Getting Timer
238
+ try:
239
+
240
+ return {
241
+ 'message': re.search(r"var ltm=[0-9]+;", decode_old).group(0).replace("ltm=", "") \
242
+ .replace(";", "").replace("var", "").strip()
243
+ }
244
+ except:
245
+ pass
246
+
247
+ except Exception as e:
248
+
249
+ return "Error: " + str(e)
250
+
251
+ def force_send_multi_services(self, url_video, services, old_request):
252
+ if 'tiktok' in url_video:
253
+ if len(urlparse(url_video).path.split('/')[-1]) == 19:
254
+ valid_id = urlparse(url_video).path.split('/')[-1]
255
+ else:
256
+ return False
257
+ else:
258
+ return False
259
+
260
+ parse = BeautifulSoup(old_request, 'html.parser')
261
+ request_force_multiple_services = self.session.post(
262
+ url=self.API_ZEFOY + self.STATIC_ENDPOINT[services],
263
+ headers=self.STATIC_HEADERS,
264
+ data={
265
+ parse.find('input', {'type': 'text'}).get('name'): valid_id,
266
+ }
267
+ )
268
+ decode = base64.b64decode(urllib.parse.unquote(request_force_multiple_services.text[::-1])).decode()
269
+ return decode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerdlz23",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "scripts": {
5
5
  "dev": "next dev",
6
6
  "build": "next build",
@@ -0,0 +1,27 @@
1
+ # Make sure to rename this file to .env before adding your private keys!!!
2
+ PRIVATE_KEY_1=''
3
+ # Add more if your project requires more private keys
4
+
5
+ # API keys for developer tooling and infra
6
+ OP_ALCHEMY_API_KEY=''
7
+ BASE_ALCHEMY_API_KEY=''
8
+ OP_BLOCKSCOUT_API_KEY=''
9
+ BASE_BLOCKSCOUT_API_KEY=''
10
+ # TENDERLY_TOKEN=''
11
+
12
+ # Contract addresses last updated on 2024-03-05, for public testnet launch
13
+ OP_DISPATCHER='0x58f1863f75c9db1c7266dc3d7b43832b58f35e83'
14
+ BASE_DISPATCHER='0xfc1d3e02e00e0077628e8cc9edb6812f95db05dc'
15
+
16
+ OP_UC_MW='0x34a0e37cCCEdaC70EC1807e5a1f6A4a91D4AE0Ce'
17
+ BASE_UC_MW='0x50E32e236bfE4d514f786C9bC80061637dd5AF98'
18
+
19
+ # Contract addresses for the sim-client
20
+ OP_DISPATCHER_SIM="0x6C9427E8d770Ad9e5a493D201280Cc178125CEc0"
21
+ BASE_DISPATCHER_SIM="0x0dE926fE2001B2c96e9cA6b79089CEB276325E9F"
22
+
23
+ OP_UC_MW_SIM='0xC3318ce027C560B559b09b1aA9cA4FEBDDF252F5'
24
+ BASE_UC_MW_SIM='0x5031fb609569b67608Ffb9e224754bb317f174cD'
25
+
26
+ # Configuration file the scripts will use, defaulting to config.json when not set
27
+ CONFIG_PATH='config.json'
@@ -0,0 +1,6 @@
1
+ [submodule "lib/vibc-core-smart-contracts"]
2
+ path = lib/vibc-core-smart-contracts
3
+ url = https://github.com/open-ibc/vibc-core-smart-contracts
4
+ [submodule "lib/forge-std"]
5
+ path = lib/forge-std
6
+ url = https://github.com/foundry-rs/forge-std
@@ -0,0 +1,10 @@
1
+ # This configuration file was automatically generated by Gitpod.
2
+ # Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
3
+ # and commit this file to your remote git repository to share the goodness with others.
4
+
5
+ # Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
6
+
7
+ tasks:
8
+ - init: npm install
9
+
10
+
@@ -0,0 +1,97 @@
1
+ # Install dependencies
2
+ install:
3
+ echo "Installing dependencies"
4
+ npm install
5
+ forge install --shallow
6
+
7
+ # Compile contracts using the specified compiler or default to Hardhat
8
+ # The compiler argument is optional; if not provided, it defaults to "hardhat".
9
+ # Usage: just compile [compiler]
10
+ compile COMPILER='hardhat':
11
+ #!/usr/bin/env sh
12
+ if test "{{COMPILER}}" = "hardhat"; then
13
+ echo "Compiling contracts with Hardhat..."
14
+ npx hardhat compile
15
+ elif test "{{COMPILER}}" = "foundry"; then
16
+ echo "Compiling contracts with Foundry..."
17
+ forge build
18
+ else
19
+ echo "Unknown compiler: {{COMPILER}}"
20
+ exit 1
21
+ fi
22
+
23
+ # Update the config.json file with the contract type for a specified chain/rollup
24
+ # The chain and contract-type arguments are REQUIRED;
25
+ # The universal argument is optional; if not provided, it defaults to "true".
26
+ # It indicates whether the contracts to deploy are using custom or universal IBC channels to send packets.
27
+ # Usage: just set-contracts [chain] [contract-type] [universal]
28
+ set-contracts CHAIN CONTRACT_TYPE UNIVERSAL='true':
29
+ echo "Updating config.json with contract type..."
30
+ node scripts/private/_set-contracts-config.js {{CHAIN}} {{CONTRACT_TYPE}} {{UNIVERSAL}}
31
+
32
+ # Deploy the contracts in the /contracts folder using Hardhat and updating the config.json file
33
+ # The source and destination arguments are REQUIRED;
34
+ # Usage: just deploy [source] [destination]
35
+ deploy SOURCE DESTINATION:
36
+ echo "Deploying contracts with Hardhat..."
37
+ node scripts/private/_deploy-config.js {{SOURCE}} {{DESTINATION}}
38
+
39
+ # Run the sanity check script to verify that configuration (.env) files match with deployed contracts' stored values
40
+ # Usage: just sanity-check
41
+ sanity-check:
42
+ echo "Running sanity check..."
43
+ node scripts/private/_sanity-check.js
44
+
45
+ # Update the dispatcher or universal channel handler address on the IBC application, with that from the .env file
46
+ # The chain argument is REQUIRED;
47
+ # Usage: just update-vibc [chain]
48
+ update-vibc CHAIN:
49
+ echo "Updating the dispatcher or universal channel handler address..."
50
+ npx hardhat run scripts/private/_update-vibc-address.js --network {{CHAIN}}
51
+
52
+ # Create a channel by triggering a channel handshake from the source and with parameters found in the config.json file
53
+ # Usage: just create-channel
54
+ create-channel:
55
+ echo "Attempting to create a channel with the values from the config..."
56
+ node scripts/private/_create-channel-config.js
57
+
58
+ # Send a packet over the universal channel or a custom channel as defined in the config.json file
59
+ # The source argument is REQUIRED;
60
+ # Usage: just send-packet [source]
61
+ send-packet SOURCE:
62
+ echo "Sending a packet with the values from the config..."
63
+ node scripts/private/_send-packet-config.js {{SOURCE}}
64
+
65
+ # Switch between the sim client and the client with proofs
66
+ # Usage: just switch-client
67
+ switch-client:
68
+ echo "Switching between sim client and client with proofs..."
69
+ npx hardhat run scripts/private/_update-vibc-address.js --network optimism
70
+ npx hardhat run scripts/private/_update-vibc-address.js --network base
71
+ node scripts/private/_switch-clients.js
72
+
73
+ # Run the full E2E flow by setting the contracts, deploying them, creating a channel, and sending a packet
74
+ # Usage: just do-it
75
+ do-it:
76
+ echo "Running the full E2E flow..."
77
+ just set-contracts optimism XCounter false && just set-contracts base XCounter false
78
+ just deploy optimism base
79
+ just sanity-check
80
+ just create-channel
81
+ just send-packet optimism
82
+ echo "You've done it!"
83
+
84
+ # Clean up the environment by removing the artifacts and cache folders and running the forge clean command
85
+ # Usage: just clean
86
+ clean:
87
+ echo "Cleaning up environment..."
88
+ rm -rf artifacts cache
89
+ forge clean
90
+
91
+ # Fully clean the environment by removing the artifacts, the dependencies, and cache folders and running the forge clean-all command
92
+ # Usage: just clean-all
93
+ clean-all:
94
+ echo "Cleaning up environment..."
95
+ rm -rf artifacts cache
96
+ forge clean
97
+ rm -rf node_modules