Interface

ABI & calldata

ABI to interface

Turn a JSON ABI, a Foundry or Hardhat artifact, or human-readable ABI into a Solidity interface: structs from tuples, events, custom errors, payable and view functions, receive and fallback.

runs in your browser
try
IExchange.sol
5 abi items · tap to copy
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; interface IExchange { struct Order { address maker; uint256 amount; uint64 deadline; } event Filled(address indexed maker, uint256 amount); error Expired(uint64 deadline); function balanceOf(address owner) external view returns (uint256); function fill(Order calldata order, bytes calldata signature) external payable returns (uint256 filled); receive() external payable; }

good to know

where do struct names come from?

from internalType in the abi (solc includes it). abis without it get Tuple1, Tuple2… which still encode the same.