Skip to content

Commit 2abaf6b

Browse files
committed
🐛 import and const
1 parent 2b054e7 commit 2abaf6b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ethers } from "ethers";
1+
const { ethers } = require("ethers");
22

33
const provider = new ethers.providers.JsonRpcProvider("RINKEBY URL"); //infura, alchemy ...
44
const receiver = "Address receive Ether";
@@ -9,8 +9,8 @@ const privateKeys = ["",""];
99
const botSend = async () => {
1010
provider.on("block", async () => {
1111
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]);
1414
const target = _target.connect(provider);
1515
const balance = await provider.getBalance(target.address); //balance wallet
1616
const tx = ethers.utils.parseEther(".005") //gas for transfer
@@ -27,7 +27,7 @@ const botSend = async () => {
2727
console.error("error", e);
2828
}
2929
}
30-
});
30+
};
3131
});
3232
}
3333

0 commit comments

Comments
 (0)