Skip to content

Generate a Solidity interface or TypeScript types from a contract ABI.

Loading tool

About ABI to Interface

Generate a Solidity interface or TypeScript code from a contract ABI. Input can be a JSON ABI, a Hardhat/Foundry artifact or human-readable signatures. The Solidity output turns tuples into structs named from internalType and uses calldata for dynamic external parameters; the TypeScript output is an as const ABI for viem/wagmi type inference plus explicit struct, argument and return types.

Common uses

  • Call a verified third-party contract from your own Solidity code
  • Write a minimal interface for a contract you only have the ABI for
  • Get typed contract calls in a viem or wagmi front end
  • Turn human-readable signatures into a full interface file

FAQ

How do I get a Solidity interface from an ABI?
Each ABI entry maps to a declaration: functions become external function declarations, and events and errors are copied with their parameters. Tuple parameters need struct definitions, which this tool generates.
Why use as const for an ABI in TypeScript?
viem and wagmi infer function names, argument types and return types from the literal ABI type. Without as const, TypeScript widens the ABI to generic strings and that inference is lost.