Get a Solidity contract ABI programmatically with JavaScript & Etherscan API | Stop hardcoding ABIs

Поделиться
HTML-код
  • Опубликовано: 15 ноя 2024

Комментарии • 17

  • @blockmancodes
    @blockmancodes  Год назад

    Learn to use all the Uniswap swap and liquidity functionality with code. bit.ly/3JkXYqL

  • @socrates_the_great6209
    @socrates_the_great6209 2 года назад +1

    Wow, that was easy. Great youtube channel you got. I can learn a lot from you I can see. Thanks.

  • @filippospapagewrgiou4928
    @filippospapagewrgiou4928 2 года назад +1

    love your content bro

  • @mosipvp
    @mosipvp 2 года назад

    dude you are full surprising in all videos.
    aweso0O0ome as always

  • @AmirAliabadi
    @AmirAliabadi 2 года назад

    nice job. super clear and easy to follow

  • @WienerCoin
    @WienerCoin Год назад

    Hey hows it going I did this step by step. The Abi gets fetched but when I want to see the name and total supply this error occurs: TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider')
    at getAbi (C:\Users\asuar\Fetch ABI\getAbi.js:14:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    What can I do so it will work?

    • @blockmancodes
      @blockmancodes  Год назад

      I bet you're using the new version of ethersJS 6, which I think is "ethers.JsonRpcProvider" instead of "ethers.providers.JsonRpcProvider"

  • @sippingtehpengatthekopitia1789

    why do we need to call toString on totalSupply? was totalSupply originally?

    • @blockmancodes
      @blockmancodes  Год назад

      It could have been my mistake. But some functions do require numeric inputs as strings

  • @S-K69
    @S-K69 2 года назад

    The number I get is in uint256. How would I display the totalSupply with the decimal point where it should be?

    • @blockmancodes
      @blockmancodes  2 года назад

      The number of decimal places is not dependent on the datatype. It is dependent on the token's contract. You can see the number of decimals on the token's deployed contract on etherscan.
      For example. WETH has 18 decimals. WBTC has 8 decimals. It's arbitrary and decided by the token's creator.

  • @princesspraniti6237
    @princesspraniti6237 Год назад

    How to omit contract address from eth?

    • @blockmancodes
      @blockmancodes  Год назад

      Sorry I don't understand. Can you elaborate?

  • @bluemeriadoc
    @bluemeriadoc 2 года назад

    bad idea for everyone to rely on the same trusted third party

    • @blockmancodes
      @blockmancodes  2 года назад

      Yea. A lot of crypto isn't as "decentralized" as people think