This file contains hidden or 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
| const puppeteer = require( 'puppeteer' ) | |
| const fs = require( 'fs' ) | |
| async function page( url ) { | |
| const browser = await puppeteer.launch() | |
| const page = await browser.newPage() | |
| let errors = [] | |
| page.on( 'response', ( res ) => { | |
| if( res.status() !== 200 ) { |
This file contains hidden or 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
| require 'net/http' | |
| require "active_support/core_ext/hash/indifferent_access" | |
| def repos_all( github_user: ) | |
| all = [] | |
| expand = true | |
| nr = 1 | |
| while( expand ) | |
| url = "https://api.github.com/users/#{github_user}/repos?page=#{nr}" |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
| { | |
| "meta": "This dataset contains the the corresponding ethereum block for every hours between 2017/06 to 2021/12.", | |
| "data": [ | |
| { | |
| "date": "2017-06-07T04:00:00Z", | |
| "block": 3832764, | |
| "timestamp": 1496808077 | |
| }, | |
| { | |
| "date": "2017-06-07T05:00:00Z", |
This file contains hidden or 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
| require( 'dotenv' ).config( { path: '../.env' } ) | |
| const EthDater = require( 'ethereum-block-by-date' ) | |
| const { ethers } = require( 'ethers' ) | |
| const moment = require( 'moment' ) | |
| const fs = require( 'fs' ) | |
| async function date() { | |
| try { | |
| let blocks = [] | |
| for( let i = from; i < to; i++ ) { |
This file contains hidden or 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
| const fs = require( 'fs' ) | |
| const axios = require( 'axios' ) | |
| const ethers = require( 'ethers' ) | |
| const keccak256 = require( 'keccak256' ) | |
| function humanReadable( { humanReadable, solidity } ) { | |
| const result = humanReadable | |
| .map( a => { | |
| const struct = { |
This file contains hidden or 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
| const ethers = require( 'ethers' ) | |
| function decodeTopics( { abi, data, topics } ) { | |
| const iface = new ethers.utils.Interface( abi ) | |
| const parsed = iface.parseLog( { data, topics } ) | |
| const values = {} | |
| Object.keys( parsed['args'] ) | |
| .filter( key => !Number.isInteger( parseInt( key ) ) ) |
This file contains hidden or 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
| function addExplorer( { cmd, config } ) { | |
| const id = `${cmd['network']['blockchain']}_${cmd['network']['chain']}` | |
| const template = config[ id ] | |
| const explorer = {} | |
| Object.keys( template ).forEach( type => { | |
| Object.keys( cmd['vars'] ).forEach( ( v, index ) => { | |
| if( index === 0 ) { | |
| explorer[ type ] = config[ id ][ type ] | |
| } |
This file contains hidden or 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
| const Wait = class Wait { | |
| constructor() {} | |
| init( { debug=false, max_retries=10, sleep } ) { | |
| this.condition = false | |
| this.debug = debug | |
| this.retries = null | |
| this.max_retries = max_retries | |
| this.sleep = sleep |