Back to App
HookSmith Docs

How It Works

Under the hood, HookSmith is a bridge between raw Ethereum smart contract data and modern frontend development.

1. ABI Parsing

When you paste your JSON ABI, HookSmith's parser analyzes every function and event. It identifies:

  • Read Functions: View functions that don't require gas (`view`, `pure`).
  • Write Functions: State-changing functions (`payable`, `nonpayable`).
  • Events: Contract events that can be listened to.
  • Input/Output Types: Precision mapping of Solidity types to TypeScript types (e.g., `uint256` → `bigint`).

2. Hook Generation

Using the parsed schema, the engine constructs a custom React hook (e.g., `useMyContract`).

  • It wraps Wagmi v2 hooks (`useReadContract`, `useWriteContract`).
  • It generates strictly typed interfaces for all arguments.
  • It handles common patterns like loading states and error handling automatically.

3. Project Scaffolding

If you choose to download the Starter Project, HookSmith generates a complete Next.js application on the fly.

  • Dynamic Zip Generation: The backend creates a zip file in-memory containing your specific hook and configured Wagmi providers.
  • Design System: It includes a pre-configured Tailwind CSS setup with the "Bento" UI system.
  • Wallet Connection: RainbowKit or similar connectors are pre-installed and configured.

Ready to try it?

Go back to the generator and paste your contract ABI to see the magic in real-time.

Go to Generator