An open API service indexing awesome lists of open source software.

https://github.com/lugondev/ca-abi-interact

This is a modern web application for interacting with smart contracts, built with Next.js 16 and Tailwind CSS v4.
https://github.com/lugondev/ca-abi-interact

evm-bytecode interface-builder smartcontract-dapp

Last synced: 19 days ago
JSON representation

This is a modern web application for interacting with smart contracts, built with Next.js 16 and Tailwind CSS v4.

Awesome Lists containing this project

README

          

# Contract ABI Interact v2.0

A modern, feature-rich web application for interacting with smart contracts across multiple blockchain networks. Built with Next.js 16, React 19, and Tailwind CSS v4.

## ๐Ÿš€ Getting Started

### Prerequisites

- Node.js 18+
- pnpm (recommended package manager)

### Installation

1. Clone the repository:
```bash
git clone
cd ca-abi-interact
```

2. Install dependencies:
```bash
pnpm install
```

3. Start the development server:
```bash
pnpm dev
```

4. Open [http://localhost:3000](http://localhost:3000) in your browser.

### Available Scripts

- `pnpm dev` - Start development server with Turbopack
- `pnpm build` - Build for production
- `pnpm start` - Start production server
- `pnpm lint` - Run ESLint
- `pnpm ts` - Type check with TypeScript

## ๐Ÿงญ Screens at a Glance

- **Home / Contract Browser (`/`)** - Manage saved contracts per chain, browse ABI tabs, run reads/writes, and stream events in one place.
- **ABI Builder (`/abi-builder`)** - Compose ABI items visually, import/export JSON, and encode call or deployment data into ready-to-use hex blobs.
- **Tools (`/tools`)** - Access a collection of blockchain utilities including unit converters, calldata decoder, epoch converter, and encoding tools.

## โœจ Features

### Core Functionality
- ๐Ÿ”— **Chain-aware contract workspace** - Save ABIs per network, add/edit/duplicate/remove entries, and toggle noisy ABI items while the Zustand store persists your library and current selection locally.
- ๐Ÿ—‚๏ธ **Sidebar & quick actions** - The contracts list surfaces Add/Duplicate/Edit/Remove controls plus explorer shortcuts, making it easy to swap between contracts without leaving the page.
- ๐Ÿงญ **Tabbed contract browser** - Switch between Properties (auto/one-click refresh), Calls (view functions with parameters), Operations (state-changing transactions), and Events (log streaming) to cover every ABI surface.

### Transactions & Event Tooling
- โœ๏ธ **Transaction builder with dual modes** - Generate call data from ABI inputs, auto-fill to/from/value/nonce/gas via wagmi + viem helpers, then either *Sign & Broadcast* or *Sign Only* to obtain serialized raw transactions, signatures, and downloadable tx JSON.
- ๐Ÿ“ก **Event explorer** - Filter logs by indexed topics and block ranges, auto-refresh the latest results, and inspect payloads in a paginated table.
- ๐Ÿ” **Refresh controls** - Use the global refresh button, per-call refreshers, or configurable auto-refresh intervals to keep property values and events in sync.

### ABI Builder & Hex Tools
- ๐Ÿงฑ **Visual ABI composer** - Add functions, events, and constructors through guided forms, import existing JSON, update items inline, and export or copy the assembled ABI whenever you need it.
- ๐Ÿงฎ **Hex generator** - Encode function calls or deployment bytecode for any ABI item, copy/share the output, and inspect length/byte metrics without leaving the builder.

### Developer Tools & Utilities
- ๐Ÿ”ง **Eth Unit Converter** - Convert between wei, gwei, and ether with real-time conversion and copy-to-clipboard functionality.
- ๐Ÿ’ฑ **Token Unit Converter** - Convert token amounts based on custom decimals for any ERC-20 token.
- โฐ **Epoch Converter** - Convert between Unix timestamps and human-readable dates in both directions.
- ๐Ÿ”ข **Base Converter** - Convert numbers between decimal, hexadecimal, binary, and octal representations.
- ๐Ÿ“ **String <> Bytes32 Converter** - Encode strings to bytes32 format and decode bytes32 back to readable strings.
- ๐Ÿ” **Calldata Decoder** - Decode raw transaction calldata using contract ABIs to inspect function calls and parameters.

### Settings & Customization
- ๐ŸŒ **Custom chains & RPC overrides** - Extend the built-in network registry, override RPC endpoints per chain, and swap networks from a searchable combobox.
- โฑ๏ธ **Refresh profiles** - Toggle automatic refresh intervals for contract properties/events or stick to manual โ€œRefresh Allโ€ control based on your workflow.
- ๐Ÿ’พ **Persistent preferences** - Custom chains, RPC overrides, contracts, and refresh settings survive reloads thanks to local storageโ€“backed stores.

### User Experience
- ๐ŸŽฏ Sticky header with navigation, wallet status, chain selector, and settings dialog, plus a drawer-based navigation pattern for mobile screens.
- ๐ŸŒ“ **Dark/Light theme toggle** - Switch between dark and light modes with system preference detection and persistent theme selection.
- ๐Ÿงฑ Sidebar + main panel layout keeps contract context visible while browsing functions, with accordions and tables powered by Radix UI + shadcn components.
- ๐Ÿ”” Wallet menu offers explorer shortcuts, copy-to-clipboard, and disconnect actions, while notifications surface transaction send/sign outcomes.
- โ™ฟ Accessible comboboxes, dialogs, accordions, and tabs provide a polished UX built on Tailwind CSS v4 and Radix primitives.

### Developer Experience
- ๐Ÿ—๏ธ Feature-Sliced architecture (`app`, `_entities`, `_features`, `_widgets`, `_pages`, `_shared`) keeps domain logic, UI, and widgets isolated for easier scaling.
- ๐Ÿ”’ Zustand (with `persist` + Immer) powers client-side state, TanStack Query handles caching inside `Web3Provider`, and strict TypeScript typing covers the entire surface area.
- โš™๏ธ Wagmi + viem unify RPC access, MetaMask connection, chain switching, gas estimation, and transaction signing across every supported network.
- ๐Ÿงฐ Tailwind CSS v4, shadcn/ui, Lucide, ESLint 9, Turbopack, and TypeScript 5.7 create a modern DX for rapid iteration.

## ๐Ÿ› ๏ธ Tech Stack

### Frontend Framework
- **Next.js 16** - React framework with App Router
- **React 19** - Latest React with concurrent features
- **TypeScript 5.7** - Static type checking

### Styling & UI
- **Tailwind CSS v4** - Utility-first CSS framework
- **Radix UI** - Accessible component primitives
- **Lucide React** - Beautiful icon library
- **shadcn/ui** - Pre-built component library

### Web3 Integration
- **Wagmi v2** - React hooks for Ethereum
- **Viem v2** - TypeScript interface for Ethereum
- **React Blockies** - Ethereum address avatars

### State Management & Data
- **Zustand** - Lightweight state management
- **TanStack Query v5** - Server state management
- **SWR** - Data fetching with caching
- **Immer** - Immutable state updates

### Development Tools
- **ESLint 9** - Code linting with Next.js config
- **Prettier** - Code formatting
- **PostCSS** - CSS processing
- **Turbopack** - Fast bundler for development

## ๐Ÿ“ Project Structure

The project follows **Feature-Sliced Design** methodology for better maintainability and scalability:

```
โ”œโ”€โ”€ app/ # Next.js App Router pages
โ”‚ โ”œโ”€โ”€ deploy/ # Contract deployment page
โ”‚ โ”œโ”€โ”€ tools/ # Developer tools & utilities
โ”‚ โ”‚ โ”œโ”€โ”€ base-converter/ # Number base conversion
โ”‚ โ”‚ โ”œโ”€โ”€ calldata-decoder/ # Transaction calldata decoder
โ”‚ โ”‚ โ”œโ”€โ”€ epoch-converter/ # Unix timestamp converter
โ”‚ โ”‚ โ”œโ”€โ”€ eth-unit-converter/ # ETH unit conversions
โ”‚ โ”‚ โ”œโ”€โ”€ string-bytes32/ # String/bytes32 encoding
โ”‚ โ”‚ โ””โ”€โ”€ token-unit-converter/ # Token decimal conversions
โ”‚ โ”œโ”€โ”€ globals.css # Global styles
โ”‚ โ”œโ”€โ”€ layout.tsx # Root layout
โ”‚ โ””โ”€โ”€ page.tsx # Home page
โ”œโ”€โ”€ components/ # shadcn/ui components
โ”‚ โ””โ”€โ”€ ui/ # Reusable UI primitives
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ _app/ # Application initialization
โ”‚ โ”‚ โ”œโ”€โ”€ index.tsx # Main app component
โ”‚ โ”‚ โ””โ”€โ”€ Web3LoadingGuard.tsx
โ”‚ โ”œโ”€โ”€ _entities/ # Business entities
โ”‚ โ”‚ โ”œโ”€โ”€ chain/ # Blockchain network logic
โ”‚ โ”‚ โ”œโ”€โ”€ contract/ # Smart contract management
โ”‚ โ”‚ โ””โ”€โ”€ wallet/ # Wallet connection logic
โ”‚ โ”œโ”€โ”€ _features/ # Feature modules
โ”‚ โ”‚ โ”œโ”€โ”€ add-contract/ # Add new contracts
โ”‚ โ”‚ โ”œโ”€โ”€ connect-wallet/ # Wallet connection
โ”‚ โ”‚ โ”œโ”€โ”€ edit-contract/ # Contract editing
โ”‚ โ”‚ โ”œโ”€โ”€ execute-contract/ # Contract interaction
โ”‚ โ”‚ โ”œโ”€โ”€ fetch-events/ # Event monitoring
โ”‚ โ”‚ โ”œโ”€โ”€ remove-contract/ # Contract removal
โ”‚ โ”‚ โ”œโ”€โ”€ set-current-chain/# Chain switching
โ”‚ โ”‚ โ”œโ”€โ”€ sign-transaction/ # Transaction signing
โ”‚ โ”‚ โ””โ”€โ”€ theme-toggle/ # Dark/light theme switching
โ”‚ โ”œโ”€โ”€ _pages/ # Page components
โ”‚ โ”‚ โ”œโ”€โ”€ browser/ # Contract browser page
โ”‚ โ”‚ โ”œโ”€โ”€ deploy/ # Deployment page
โ”‚ โ”‚ โ””โ”€โ”€ error/ # Error pages
โ”‚ โ”œโ”€โ”€ _shared/ # Shared utilities
โ”‚ โ”‚ โ”œโ”€โ”€ config/ # Application configuration
โ”‚ โ”‚ โ”œโ”€โ”€ lib/ # Utility libraries
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ theme/ # Theme management utilities
โ”‚ โ”‚ โ””โ”€โ”€ ui/ # Shared UI components
โ”‚ โ””โ”€โ”€ _widgets/ # Complex UI widgets
โ”‚ โ”œโ”€โ”€ contract-browser/ # Contract exploration widget
โ”‚ โ”œโ”€โ”€ contracts-list/ # Contract list widget
โ”‚ โ”œโ”€โ”€ layout/ # Layout components
โ”‚ โ””โ”€โ”€ loading-screen/ # Loading states
โ””โ”€โ”€ lib/ # External library configurations
โ””โ”€โ”€ utils.ts # Utility functions
```

### Architecture Principles

- **Entities** (`_entities/`) - Core business logic and domain models
- **Features** (`_features/`) - User-facing functionality and use cases
- **Widgets** (`_widgets/`) - Complex UI components combining multiple features
- **Pages** (`_pages/`) - Route-level components and page layouts
- **Shared** (`_shared/`) - Reusable utilities, components, and configurations

## ๐Ÿ”ง Configuration

### Environment Variables

Create a `.env.local` file for local development:

```bash
# Optional: Custom RPC endpoints
NEXT_PUBLIC_ETHEREUM_RPC_URL=your_ethereum_rpc_url
NEXT_PUBLIC_POLYGON_RPC_URL=your_polygon_rpc_url
```

### Supported Networks

The application supports multiple blockchain networks out of the box:
- Ethereum Mainnet
- Polygon
- Arbitrum
- Optimism
- Base
- And more...

## ๐Ÿค Contributing

1. Fork the repository
2. Create a feature branch: `git checkout -b feature/amazing-feature`
3. Commit your changes: `git commit -m 'Add amazing feature'`
4. Push to the branch: `git push origin feature/amazing-feature`
5. Open a Pull Request

### Development Guidelines

- Follow the Feature-Sliced Design architecture
- Keep components under 500 lines of code
- Use TypeScript for all new code
- Write meaningful commit messages
- Test your changes thoroughly

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

## ๐Ÿ™ Acknowledgments

- [Next.js](https://nextjs.org/) - The React framework for production
- [Tailwind CSS](https://tailwindcss.com/) - A utility-first CSS framework
- [Wagmi](https://wagmi.sh/) - React hooks for Ethereum
- [Radix UI](https://www.radix-ui.com/) - Low-level UI primitives
- [shadcn/ui](https://ui.shadcn.com/) - Beautifully designed components