Code Monkey home page Code Monkey logo

etherscan-abi's Introduction

etherscan-abi

npm package Build Status Downloads Issues Commitizen Friendly Semantic Release

⏬🚀 Fetch the most up-to-date ABI of verified Smart Contracts (including proxy implementations) from Etherscan in seconds!

Usage

CLI

  • Fetch the ABI of a contract from an address and save it to abis/ContractName.json:
npx etherscan-abi 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984
  • Note that if a standard proxy is detected, the proxy's implementation ABI will automatically be fetched:
npx etherscan-abi 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9
  • You can optionally provide a target directory path, an Etherscan apiKey (to bypass the default query rate limit), or specify a network on which to query the Smart Contract's source code (by name or chainId, decimal or hexadecimal):
npx etherscan-abi --target abis/uniswap/ \
    --apiKey ... \
    --network polygon \
    0xb33EaAd8d922B1083446DC23f610c2567fB5180f

Javascript

const { ethers } = require("ethers");
const { getContractAt } = require("etherscan-abi");

getContractAt(
  "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
  new ethers.providers.JsonRpcProvider("...")
)
  .then((uni) => uni.balanceOf("..."))
  .then(console.log);

Install

npm install etherscan-abi
yarn add etherscan-abi

etherscan-abi's People

Contributors

rubilmax avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.