ItsNickBarry/hardhat-abi-exporter

Contract ABI format

Closed this issue · 1 comments

Hi, I am getting this ABI output from running yarn run hardhat export-abi. It does not look like a valid contract ABI format.

[
  "constructor(string,string,uint256)",
  "event Approval(address indexed,address indexed,uint256)",
  "event Transfer(address indexed,address indexed,uint256)",
  "function allowance(address,address) view returns (uint256)",
  "function approve(address,uint256) returns (bool)",
  "function balanceOf(address) view returns (uint256)",
  "function decimals() view returns (uint8)",
  "function decreaseAllowance(address,uint256) returns (bool)",
  "function increaseAllowance(address,uint256) returns (bool)",
  "function name() view returns (string)",
  "function symbol() view returns (string)",
  "function totalSupply() view returns (uint256)",
  "function transfer(address,uint256) returns (bool)",
  "function transferFrom(address,address,uint256) returns (bool)"
]

contract

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract ERC20Contract is ERC20 {
    constructor(
        string memory name,
        string memory symbol,
        uint256 supply
    ) public ERC20(name, symbol) {
        _mint(msg.sender, supply);
    }
}

packages

"hardhat": "2.2.1",
"hardhat-abi-exporter": "^2.6.1",

node version

node --version 
v16.13.0

Don't use { pretty: true } unless you are using with Ethers.js (which supposedly supports this simplified ABI format).