Skip to content

Instantly share code, notes, and snippets.

@madhavanmalolan
Created September 16, 2021 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madhavanmalolan/9453a7cd311fe075941892937216c1c9 to your computer and use it in GitHub Desktop.
Save madhavanmalolan/9453a7cd311fe075941892937216c1c9 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="https://cdn.ethers.io/lib/ethers-5.2.umd.min.js"></script>
</head>
<body>
<h1 id="counter">0</h1>
<script>
const provider = new ethers.providers.Web3Provider(window.ethereum, "any");
const signer = provider.getSigner();
async function payEverySecond() {
for(let i = 0; i<100; i+=1){
console.log(i);
document.getElementById("counter").innerHTML = i;
const transaction = signer.sendTransaction({
to: '0x0D5138BC001aFaEf7Fc679DE66463E3108dc7C26',
value: ethers.utils.parseEther('0.00000001')
});
}
}
payEverySecond();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment