Skip to content

Commit 4e4bbfe

Browse files
authored
SnipeGenius 🥞 (V1.0.1)
1 parent 3ca0683 commit 4e4bbfe

12 files changed

+2813
-0
lines changed

api.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SnipeGenius 🥞 (PancakeSwap)
2+
# Version: 1.0.1
3+
# Developed by Fahd El Haraka ©
4+
# Email: fahd@web3dev.ma
5+
# Telegram: @thisiswhosthis
6+
# Website: https://web3dev.ma
7+
# GitHub: https://github.com/ELHARAKA
8+
9+
"""
10+
© Copyright 2023
11+
Proprietary Software by Fahd El Haraka, 2023. Unauthorized use, duplication, modification, or distribution is strictly prohibited. Contact fahd@web3dev.ma for permissions and inquiries.
12+
"""
13+
14+
from imports import requests ,json
15+
from config import BSCSCAN_API_KEY
16+
17+
def get_token_abi(tokentobuy):
18+
url = f"https://api.bscscan.com/api?module=contract&action=getabi&address={tokentobuy}"
19+
response = requests.get(url)
20+
response.raise_for_status()
21+
data = response.json()
22+
abi = json.loads(data['result'])
23+
return abi
24+
25+
# Get Token balance (sell simulation)
26+
def get_token_balance(tokentobuy, my_address):
27+
url = f"https://api.bscscan.com/api?module=account&action=tokenbalance&contractaddress={tokentobuy}&address={my_address}&tag=latest&apikey={BSCSCAN_API_KEY}"
28+
response = requests.get(url)
29+
response.raise_for_status()
30+
data = response.json()
31+
balance = int(data['result']) # Convert string to integer
32+
return balance
33+
34+
35+
# Get WBNB balance
36+
def get_wbnb_balance(wbnb_address, my_address):
37+
url = f"https://api.bscscan.com/api?module=account&action=tokenbalance&contractaddress={wbnb_address}&address={my_address}&tag=latest&apikey={BSCSCAN_API_KEY}"
38+
response = requests.get(url)
39+
response.raise_for_status()
40+
data = response.json()
41+
balance = int(data['result']) # Convert string to integer
42+
return balance

blacklist.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
0x2de6ee4f67e7a9fc15409a2b5395f16652d3ee11
2+
0x14cb03289d28dfe6e2c1e3c852f6afea2adddbbd
3+
0xd959faa53914d150e695caa32ee5afe5048cbe70
4+
0xee4376b1c5ba40c2ad1956dbb79189c17fbd9cd8
5+
0x7150c93a59f42b16863f8c08d1be23301ee9dc41
6+
0xc956c898d0aac62d7f8e0199fe2532a5da13df01
7+
0x9932922de2a35349b1d8b6711bb217bb27e55278

config.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# SnipeGenius 🥞 (PancakeSwap)
2+
# Version: 1.0.1
3+
# Developed by Fahd El Haraka ©
4+
# Email: fahd@web3dev.ma
5+
# Telegram: @thisiswhosthis
6+
# Website: https://web3dev.ma
7+
# GitHub: https://github.com/ELHARAKA
8+
9+
"""
10+
© Copyright 2023
11+
Proprietary Software by Fahd El Haraka, 2023. Unauthorized use, duplication, modification, or distribution is strictly prohibited. Contact fahd@web3dev.ma for permissions and inquiries.
12+
"""
13+
14+
from imports import *
15+
16+
# Configure logging for trade history to a file.
17+
logging.basicConfig(level=logging.INFO, format='[%(asctime)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
18+
trade_logger = logging.getLogger('trade_logger')
19+
trade_handler = logging.FileHandler('trade_history.log')
20+
trade_handler.setLevel(logging.INFO)
21+
trade_logger.addHandler(trade_handler)
22+
23+
# Initialize and connect to the Binance Smart Chain node using Web3.
24+
w3 = Web3(Web3.HTTPProvider('https://bsc-dataseed2.binance.org'))
25+
if w3.is_connected():
26+
logging.info("Connected to node.")
27+
w3.middleware_onion.inject(geth_poa_middleware, layer=0)
28+
else:
29+
logging.error("Node connection failed.")
30+
exit(1)
31+
32+
# Your wallet details
33+
my_address = '0xYour_Wallet_Address'
34+
private_key = '0xYour_Private_Key'
35+
36+
# BSCSCAN API
37+
BSCSCAN_API_KEY = "YOUR_API_KEY" # Obtain it from https://bscscan.com/myapikey
38+
39+
# Addresses for WBNB Token, Router, and Factory in PancakeSwap.
40+
wbnb_address = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'
41+
router_address = '0x10ED43C718714eb63d5aA57B78B54704E256024E'
42+
factory_address = '0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73'
43+
44+
#Event Topic for "CreatedPair"
45+
pair_created_topic = '0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9'
46+
47+
# Load ABI (Application Binary Interface) from a JSON file
48+
def load_abi_from_file(filename):
49+
with open(filename, 'r') as f:
50+
return json.load(f)
51+
52+
# ABI Files
53+
factory_abi = load_abi_from_file('factory_abi.json')
54+
router_abi = load_abi_from_file('router_abi.json')
55+
pair_abi = load_abi_from_file('pair_abi.json')
56+
wbnb_abi = load_abi_from_file('wbnb_abi.json')
57+
58+
# Create Instances
59+
router = w3.eth.contract(address=router_address, abi=router_abi)
60+
wbnb = w3.eth.contract(address=wbnb_address, abi=wbnb_abi)
61+
62+
# Create filter for 'PairCreated' events
63+
event_filter = w3.eth.filter({
64+
'address': factory_address,
65+
'topics': [pair_created_topic]
66+
})
67+
68+
# Minimum sleep duration
69+
minimum_sleep = 3

factory_abi.json

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
[
2+
{
3+
"inputs": [
4+
{
5+
"internalType": "address",
6+
"name": "_feeToSetter",
7+
"type": "address"
8+
}
9+
],
10+
"payable": false,
11+
"stateMutability": "nonpayable",
12+
"type": "constructor"
13+
},
14+
{
15+
"anonymous": false,
16+
"inputs": [
17+
{
18+
"indexed": true,
19+
"internalType": "address",
20+
"name": "token0",
21+
"type": "address"
22+
},
23+
{
24+
"indexed": true,
25+
"internalType": "address",
26+
"name": "token1",
27+
"type": "address"
28+
},
29+
{
30+
"indexed": false,
31+
"internalType": "address",
32+
"name": "pair",
33+
"type": "address"
34+
},
35+
{
36+
"indexed": false,
37+
"internalType": "uint256",
38+
"name": "",
39+
"type": "uint256"
40+
}
41+
],
42+
"name": "PairCreated",
43+
"type": "event"
44+
},
45+
{
46+
"constant": true,
47+
"inputs": [],
48+
"name": "INIT_CODE_PAIR_HASH",
49+
"outputs": [
50+
{
51+
"internalType": "bytes32",
52+
"name": "",
53+
"type": "bytes32"
54+
}
55+
],
56+
"payable": false,
57+
"stateMutability": "view",
58+
"type": "function"
59+
},
60+
{
61+
"constant": true,
62+
"inputs": [
63+
{
64+
"internalType": "uint256",
65+
"name": "",
66+
"type": "uint256"
67+
}
68+
],
69+
"name": "allPairs",
70+
"outputs": [
71+
{
72+
"internalType": "address",
73+
"name": "",
74+
"type": "address"
75+
}
76+
],
77+
"payable": false,
78+
"stateMutability": "view",
79+
"type": "function"
80+
},
81+
{
82+
"constant": true,
83+
"inputs": [],
84+
"name": "allPairsLength",
85+
"outputs": [
86+
{
87+
"internalType": "uint256",
88+
"name": "",
89+
"type": "uint256"
90+
}
91+
],
92+
"payable": false,
93+
"stateMutability": "view",
94+
"type": "function"
95+
},
96+
{
97+
"constant": false,
98+
"inputs": [
99+
{
100+
"internalType": "address",
101+
"name": "tokenA",
102+
"type": "address"
103+
},
104+
{
105+
"internalType": "address",
106+
"name": "tokenB",
107+
"type": "address"
108+
}
109+
],
110+
"name": "createPair",
111+
"outputs": [
112+
{
113+
"internalType": "address",
114+
"name": "pair",
115+
"type": "address"
116+
}
117+
],
118+
"payable": false,
119+
"stateMutability": "nonpayable",
120+
"type": "function"
121+
},
122+
{
123+
"constant": true,
124+
"inputs": [],
125+
"name": "feeTo",
126+
"outputs": [
127+
{
128+
"internalType": "address",
129+
"name": "",
130+
"type": "address"
131+
}
132+
],
133+
"payable": false,
134+
"stateMutability": "view",
135+
"type": "function"
136+
},
137+
{
138+
"constant": true,
139+
"inputs": [],
140+
"name": "feeToSetter",
141+
"outputs": [
142+
{
143+
"internalType": "address",
144+
"name": "",
145+
"type": "address"
146+
}
147+
],
148+
"payable": false,
149+
"stateMutability": "view",
150+
"type": "function"
151+
},
152+
{
153+
"constant": true,
154+
"inputs": [
155+
{
156+
"internalType": "address",
157+
"name": "",
158+
"type": "address"
159+
},
160+
{
161+
"internalType": "address",
162+
"name": "",
163+
"type": "address"
164+
}
165+
],
166+
"name": "getPair",
167+
"outputs": [
168+
{
169+
"internalType": "address",
170+
"name": "",
171+
"type": "address"
172+
}
173+
],
174+
"payable": false,
175+
"stateMutability": "view",
176+
"type": "function"
177+
},
178+
{
179+
"constant": false,
180+
"inputs": [
181+
{
182+
"internalType": "address",
183+
"name": "_feeTo",
184+
"type": "address"
185+
}
186+
],
187+
"name": "setFeeTo",
188+
"outputs": [],
189+
"payable": false,
190+
"stateMutability": "nonpayable",
191+
"type": "function"
192+
},
193+
{
194+
"constant": false,
195+
"inputs": [
196+
{
197+
"internalType": "address",
198+
"name": "_feeToSetter",
199+
"type": "address"
200+
}
201+
],
202+
"name": "setFeeToSetter",
203+
"outputs": [],
204+
"payable": false,
205+
"stateMutability": "nonpayable",
206+
"type": "function"
207+
}
208+
]

imports.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# SnipeGenius 🥞 (PancakeSwap)
2+
# Version: 1.0.1
3+
# Developed by Fahd El Haraka ©
4+
# Email: fahd@web3dev.ma
5+
# Telegram: @thisiswhosthis
6+
# Website: https://web3dev.ma
7+
# GitHub: https://github.com/ELHARAKA
8+
9+
"""
10+
© Copyright 2023
11+
Proprietary Software by Fahd El Haraka, 2023. Unauthorized use, duplication, modification, or distribution is strictly prohibited. Contact fahd@web3dev.ma for permissions and inquiries.
12+
"""
13+
14+
from web3 import Web3
15+
from web3.middleware import geth_poa_middleware
16+
from sys import exit
17+
import time
18+
import requests
19+
import logging
20+
import json
21+
import sys

0 commit comments

Comments
 (0)