Skip to content

Instantly share code, notes, and snippets.

@M4cs
Last active June 20, 2023 17:47
Show Gist options
  • Save M4cs/42e7a19b55a188f54e81baedf94d10d3 to your computer and use it in GitHub Desktop.
Save M4cs/42e7a19b55a188f54e81baedf94d10d3 to your computer and use it in GitHub Desktop.
const ethers = require('ethers');
const privatekey = '0X_PRIVATE_KEY';
const provider = new ethers.JsonRpcProvider('ALCHEMY_OR_INFURA_KEY');
const wallet = new ethers.Wallet(privatekey, provider);
const addresses = [];
async function batchETHScribe() {
let count = 0;
for (const address in addresses) {
const data = `data:,${count}-test`;
const hex = ethers.hexlify(ethers.toUtf8Bytes(data));
let tx = {
to: address,
value: 0,
data: hex
};
const txn = await wallet.sendTransaction(tx);
const rec = await txn.wait();
console.log(rec);
count++;
}
}
(async () => {
await batchETHScribe()
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment