Contract ABI

What a smart contract ABI is and how GitMyABI uses it.

Concepts

A smart contract ABI (Application Binary Interface) is a JSON document that describes a contract's callable surface: its functions, their parameter types and return types, its events, its custom errors, and its constructor. Web3 libraries use the ABI to encode calls to a deployed contract and to decode the contract's responses and emitted events.

What an ABI contains

  • Functions — name, inputs, outputs, and state mutability (view, pure, nonpayable, payable).
  • Events — name, indexed and non-indexed parameters.
  • Errors — custom revert types with their parameters.
  • Constructor — inputs accepted at deployment.

Example

A minimal ABI fragment for an ERC-20-style transfer plus its event:

[
  {
    "type": "function",
    "name": "transfer",
    "stateMutability": "nonpayable",
    "inputs": [
      { "name": "to", "type": "address" },
      { "name": "amount", "type": "uint256" }
    ],
    "outputs": [{ "name": "", "type": "bool" }]
  },
  {
    "type": "event",
    "name": "Transfer",
    "inputs": [
      { "name": "from", "type": "address", "indexed": true },
      { "name": "to", "type": "address", "indexed": true },
      { "name": "value", "type": "uint256", "indexed": false }
    ]
  }
]

How GitMyABI uses ABIs

GitMyABI compiles a smart contract repository from GitHub, extracts the ABI from the framework's build output, uploads it to a public CDN, and — in the same build — wraps it in a typed TypeScript class that is published to an npm registry. See ABI and TypeScript bindings publishing for the pipeline, generated contract bindings for the typed package, and review the package format for the exact artifact shape.

Related