Skip to content

dansan566/encode_deai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solidity Developer Assistant

A dual-assistant chat interface for Solidity development and security auditing, powered by OpenAI and integrated with Ethereum wallet functionality.

Features

  • Dual Assistant Interface:
    • Developer Assistant for Solidity code development
    • Security Auditor Assistant for code review and vulnerability detection
  • Real-time Code Analysis: Get instant feedback on your Solidity code
  • Security Auditing: Receive detailed security assessments of your smart contracts
  • Wallet Integration: Connect your Ethereum wallet using RainbowKit
  • Code Deployment: Deploy your verified contracts directly to Ethereum networks
  • Markdown Support: Code blocks and formatting in chat messages
  • Dark Mode: Built-in dark mode support

Prerequisites

  • Node.js 18+ and pnpm
  • An Ethereum wallet (MetaMask, Rainbow, etc.)
  • OpenAI API key
  • WalletConnect Project ID

Environment Setup

  1. Create a .env.local file in the root directory with the following variables:
OPENAI_API_KEY=your_openai_api_key
  1. Get a WalletConnect Project ID:
    • Go to WalletConnect Cloud
    • Create a new project
    • Copy your Project ID
    • Replace YOUR_PROJECT_ID in components/wallet-provider.tsx with your actual Project ID

Installation

  1. Clone the repository
  2. navigate to solidity-dev directory
  3. install pnpm globally if needed
npm install -g pnpm
  1. Install dependencies:
pnpm install
  1. Start the development server:
pnpm dev

Usage

  1. Connect Your Wallet:

    • Click the "Connect Wallet" button in the top right
    • Choose your preferred wallet provider
    • Approve the connection request
  2. Developer Assistant:

    • Write or paste your Solidity code
    • Get instant feedback and suggestions
    • Receive code improvements and best practices
  3. Security Auditor:

    • Submit your code for security review
    • Get detailed vulnerability analysis
    • Receive recommendations for security improvements
  4. Deploy Contracts:

    • After getting your code reviewed
    • Click the "Deploy" button
    • Confirm the transaction in your wallet
    • View the deployed contract address

Project Structure

solidity-dev/
├── app/
│   ├── api/              # API routes for OpenAI integration
│   ├── components/       # React components
│   ├── lib/             # Utility functions and configurations
│   └── page.tsx         # Main application page
├── components/
│   ├── chat-message.tsx # Chat message component
│   ├── code-editor.tsx  # Code editor component
│   ├── deploy-contract.tsx # Contract deployment component
│   ├── theme-provider.tsx # Theme management
│   └── wallet-provider.tsx # Wallet integration
└── public/              # Static assets

Technologies Used

  • Next.js 14
  • React
  • TypeScript
  • Tailwind CSS
  • OpenAI API
  • RainbowKit
  • wagmi
  • shadcn/ui
  • Monaco Editor
  • React Markdown

Contributing

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

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • OpenAI for providing the GPT models
  • Next.js team for the framework
  • Shadcn UI for the component library

About

Homework for the encode DeAI Bootcamp (Q1/2025)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5