Skip to content

harishkotra/mosaic

Repository files navigation

mosaic-logo

🧱 Mosaic: Mantle Smart Contract Builder

🌟 Overview

Mosaic is an innovative smart contract development platform specifically designed for the Mantle blockchain ecosystem. It offers two powerful approaches to contract creation: a visual drag-and-drop builder and an AI-powered contract generator. Whether you prefer hands-on composition or AI assistance, Mosaic empowers developers and blockchain enthusiasts to rapidly create and deploy optimized smart contracts.

Screenshots

mosaic-landing-page mosaic-how-it-works mosaic-ai-generator mosaic-ai-generator-2 mosaic-no-code-builder-1 mosaic-no-code-builder-2 mosaic-no-code-builder-3 mosaic-deploy mosaic-testnet-deploy mosaic-deployed-contract

✨ Key Features

Visual Contract Builder

  • Intuitive drag-and-drop interface for composing contracts
  • Pre-built, Mantle-optimized contract modules
  • Real-time Solidity code generation
  • Component-based architecture for maximum reusability

AI Contract Generator

  • Powered by Llama 3.2 8B parameter model via Gaia
  • Natural language contract generation
  • Context-aware code completion
  • Mantle-specific optimizations and best practices

Example AI Prompts

Here are some effective prompts to help you get started with the AI generator:

"Create an ERC20 token contract for a community rewards system with:
- Monthly distribution caps
- Vesting schedules for team tokens
- Anti-whale mechanisms limiting large transfers"
"Design a meta-transaction handler for my DeFi protocol that:
- Supports percentage-based gas fee delegation
- Includes signature verification
- Has role-based permissions for gas sponsors"
"Generate a bridge adapter contract that:
- Handles ERC20 token transfers between Ethereum and Mantle
- Includes emergency pause functionality
- Implements a challenge period for withdrawals"

Supported Contract Components

Both the visual builder and AI generator support:

  • Meta Transaction Handlers
  • ERC20 Token Implementations
  • Role-Based Access Control
  • Bridge Adapters
  • Gas Optimization Utilities
  • NFT Contract Templates

Deployment Options

  • One-click deployment to Mantle Mainnet
  • Streamlined testing on Mantle Sepolia Testnet
  • Seamless MetaMask integration
  • Built-in gas estimation and optimization

πŸš€ Quick Start

Prerequisites

  • Node.js (v18+ recommended)
  • MetaMask Browser Extension
  • MNT Tokens for deployment

Installation

  1. Clone the repository
git clone https://github.com/yourusername/mosaic.git
cd mosaic
  1. Install dependencies
npm install
  1. Run the development server
npm run dev

Open http://localhost:3000 in your browser

πŸ›  Technology Stack

Frontend:

  • Next.js 15+
  • React with TypeScript
  • Tailwind CSS
  • Shadcn UI Components
  • React DnD (Drag and Drop)

Smart Contract Integration:

  • Ethers.js
  • Web3Modal
  • MetaMask SDK

AI Integration:

  • Gaia API Client
  • Llama 3.2 8B parameter model
  • Stream-based response handling

πŸ“¦ Smart Contract Components

Meta Transaction

  • Enable gasless transactions with advanced Mantle v2 support
  • Configurable fee delegation ratios
  • Multi-signature validation options

ERC20 Token

  • Gas-optimized token implementation for Mantle
  • Built-in hooks for extensions
  • Comprehensive security features

Access Control

  • Role-based permission management
  • Time-locked role transitions
  • Emergency admin functions

Bridge Adapter

  • Seamless L1-L2 token transfers
  • State verification and challenge periods
  • Configurable bridge parameters

Gas Optimizer

  • Dynamic fee adjustment mechanisms
  • Batch transaction support
  • Priority fee management

πŸ€– AI Generator Features

The AI Generator leverages the Llama 3.2 8B parameter model to provide:

Code Generation:

  • Natural language to Solidity conversion
  • Mantle-specific optimizations
  • Best practice implementations

Context Awareness:

  • Understanding of contract requirements
  • Integration with existing code
  • Compatibility checking

Learning Resources:

  • Example prompt library
  • Code explanation generation
  • Gas optimization suggestions

πŸ”’ Security

Security Measures:

  • Pre-audited contract templates
  • Automated vulnerability scanning
  • Role-based access control
  • Mantle architecture compatibility

Best Practices:

  • Gas optimization patterns
  • Secure coding guidelines
  • Transaction safety checks

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

How to Contribute:

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

🌐 Roadmap

Upcoming Features:

  • Advanced AI prompt templates
  • Multi-contract system generation
  • Contract verification automation
  • Integration testing framework
  • Enhanced gas estimation
  • AI-powered security analysis
  • Custom component creation tools

Built with ❀️ for Web3 Developers