Last active
March 10, 2020 19:18
-
-
Save franckc/2317156398c5bdb883ad19bcab6050ec to your computer and use it in GitHub Desktop.
Feb drawing hashes
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
// Script that queries Etherscan to download all the tx hashes eligible for the Origin February 2020 drawing. | |
// The tx hashes can then be used as input for the drawing script at: https://gist.github.com/franckc/cb78cc9220e5c1c47d3790b6658c1124 | |
const fetch = require('node-fetch') | |
const address = '0x698ff47b84837d3971118a369c570172ee7e54c2' | |
const fromBlock = '9393349' | |
const toBlock = '9594889' | |
const topic0 = '0x6ee68cb753f284cf771c1a32c236d7ffcab6011345186a30e57837d761e86837' | |
const topic2 = '0x0000000000000000000000000000000000000000000000000000000000000051' | |
const url = `https://api.etherscan.io/api?module=logs&action=getLogs&fromBlock=${fromBlock}&toBlock=${toBlock}&address=${address}&topic0=${topic0}&topic2=${topic2}` | |
fetch(url) | |
.then(res => res.json()) | |
.then(json => { | |
let txs = json.result | |
txs = txs.sort(function(a, b) { return parseInt(b.timeStamp)-parseInt(a.timeStamp) } ) | |
txs.map(tx => console.log(tx.transactionHash)) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment