Skip to content

Instantly share code, notes, and snippets.

View anonymoussprocket's full-sized avatar
🌴
On vacation

anonymoussprocket

🌴
On vacation
View GitHub Profile
@anonymoussprocket
anonymoussprocket / README.md
Last active January 15, 2022 04:35
Querying Tezos historical data with Conseil

Querying Tezos historical data with Conseil

I am attesting that this GitHub handle anonymoussprocket is linked to the Tezos account tz1eU1NCk7U6sNxDKos7CJMM7P97bW3wyGB1 for tzprofiles
sig:edsigtwwTgkiJZuqnGFDgsHsfV1Ejt8K2WXhD6Nei8WKgHr8CnbHrvcqJoUpT1LwRgzHWtPzqxQZ5itS4LHTC3KNX7iyNbhSCq1
@anonymoussprocket
anonymoussprocket / mockContract.ts
Created July 21, 2022 21:35
Mock a mainnet contract dynamically
import fetch from 'node-fetch';
import { smock } from '@defi-wonderland/smock';
async function deployMockContractFromAddress(contractAddress: string, etherscanKey: string) {
const abi = await fetch(`https://api.etherscan.io/api?module=contract&action=getabi&address=${contractAddress}&apikey=${etherscanKey}`)
.then(response => response.json())
.then(data => JSON.parse(data['result']));
return smock.fake(abi, {address: contractAddress});
}