Skip to content

Instantly share code, notes, and snippets.

@alexkroeger
Created December 8, 2021 16:16
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 alexkroeger/d3ee86e32fb52ed41f796ad27ac11f9f to your computer and use it in GitHub Desktop.
Save alexkroeger/d3ee86e32fb52ed41f796ad27ac11f9f to your computer and use it in GitHub Desktop.
async function getContractAbiFromEtherscan(contractAddress: string): Promise<string> {
const url = `https://api.etherscan.io/api?module=contract&action=getabi&address=${contractAddress}`;
const response = await axios.get(url);
return response.data.result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment