File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
- import { ethers } from "ethers" ;
1
+ const { ethers } = require ( "ethers" ) ;
2
2
3
3
const provider = new ethers . providers . JsonRpcProvider ( "RINKEBY URL" ) ; //infura, alchemy ...
4
4
const receiver = "Address receive Ether" ;
@@ -9,8 +9,8 @@ const privateKeys = ["",""];
9
9
const botSend = async ( ) => {
10
10
provider . on ( "block" , async ( ) => {
11
11
console . log ( "Listen New Block,🙈 waiting 🙈" ) ;
12
- privateKeys . forEach ( ( privateKey ) {
13
- const _target = new ethers . Wallet ( privateKey ) ;
12
+ for ( let i = 0 ; i < privateKeys . length ; i ++ ) {
13
+ const _target = new ethers . Wallet ( privateKeys [ i ] ) ;
14
14
const target = _target . connect ( provider ) ;
15
15
const balance = await provider . getBalance ( target . address ) ; //balance wallet
16
16
const tx = ethers . utils . parseEther ( ".005" ) //gas for transfer
@@ -27,7 +27,7 @@ const botSend = async () => {
27
27
console . error ( "error" , e ) ;
28
28
}
29
29
}
30
- } ) ;
30
+ } ;
31
31
} ) ;
32
32
}
33
33
You can’t perform that action at this time.
0 commit comments