Created
September 16, 2021 13:22
-
-
Save madhavanmalolan/9453a7cd311fe075941892937216c1c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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