Background

Vibe Coding: Smart Contracts at Hackathon Speed

Build Secure Smart Contracts with AI - Fast & Safe

Background
Decoration

Today's Plan

1

1. What is Vibe Coding

for smart contracts

2

2. AI Tools for Solidity

Foundry, Hardhat, more

3

3. Solidity Prompts That Work

copy-paste examples

4

4. Step-by-Step Workflow

exact process

5

5. Security with AI

critical considerations

6

6. Demo Prep

what judges care about

Background

Part 1: What is Vibe Coding

What is Vibe Coding for Smart Contracts?

Not random. Strategic speed with AI. You review security.

It's simple:

  • Use AI to write Solidity faster
  • Build contract functions quickly
  • Compile and test immediately
  • Deploy and demo often
Background

Part 1: What is Vibe Coding

Old Way vs. Vibe Coding for Smart Contracts

❌ Old Way

Read Solidity docs → Write functions → Compile → Debug → Fix Takes hours. One contract.

✅ Vibe Coding

Tell AI what you want → Review security → Adjust → Deploy Takes minutes. Multiple contracts.

Background

Part 2: AI Tools

Essential AI Tools for Smart Contracts

All work together. Use all of them.

Get these now:

  • 🔧 Cursor IDE - Best for Solidity coding with AI
  • 🔧 GitHub Copilot - Auto-complete for Solidity
  • 🔧 Claude / GPT / GLM - For smart contract explanations
  • 🔧 Foundry - Fast compilation and testing
  • 🔧 Slither - AI-assisted security analysis

Part 3: AI Prompts

Good Prompt = Good Smart Contract

More details = better results. Always specify security requirements.

Structure your Solidity prompts:

  • 1. Role: "Act as Solidity auditor"
  • 2. Context: "Building ERC20 token for hackathon"
  • 3. Task: "Create a standard ERC20 implementation"
  • 4. Requirements: "OpenZeppelin v5, gas optimized, Solidity 0.8.20"
Background

Part 3: AI Prompts

Bad vs. Good Prompts

❌ Bad Prompt

"Make a token contract" No standard specified No features listed No version mentioned Vague and generic AI has to guess everything

✅ Good Prompt

"Act as Solidity expert. Create an ERC20 token using OpenZeppelin v5. Features: mint, burn, transfer. Gas optimized. Solidity 0.8.20." Role: Solidity expert Standard: OpenZeppelin v5 Features: Listed Context: Hackathon demo

Background

Part 3: AI Prompts

Good vs. Better Prompts

More details = fewer iterations = faster deployment.

Good prompt is okay, but better is faster:

  • ✅ GOOD: "Solidity expert. Create ERC20 with OpenZeppelin v5. Gas optimized. Solidity 0.8.20."
  • ✅ BETTER: "Solidity auditor. ERC20 implementation. - OpenZeppelin v5 - Solidity 0.8.20 - Gas optimized - Mint function with access control - Burn function - Transfer function - Events for all operations - SafeMath usage - Reentrancy protection"

Part 3: AI Prompts

Solidity Prompt Templates

Save these. Modify for your project.

Use these patterns:

  • "Create a [contract type] using [standard]. Features: [list]. Gas optimized. Solidity [version]."
  • "Debug this contract. It should [expected behavior]. Here's error: [paste error]."
  • "Refactor this for [gas optimization/security]. Keep functionality same."
  • "Generate Foundry tests for [function]. Cover reentrancy, overflow, underflow cases."
Background

Part 4: Workflow

The Smart Contract Vibe Coding Loop

Each cycle = 2-5 minutes. Not 30 minutes.

Repeat this 20 times:

  • 1. Say what contract does (to AI)
  • 2. AI writes Solidity
  • 3. Compile and test
  • 4. Fix compilation errors
  • 5. Move to next function

Part 4: Workflow

Step 1: First Working Contract (30 min)

Deployed is better than perfect.

Build something that compiles:

  • AI: "Create a basic [ERC20 token] with [mint function]"
  • Accept basic implementation
  • Use OpenZeppelin for security
  • No complex features
  • Just compile and deploy to testnet
Background

Part 4: Workflow

Step 2: Add Functions (1-2 hours)

Never build 5 functions at once.

One function at a time:

  • Pick most important function
  • Prompt AI: "Add [function] to existing contract"
  • Compile and test
  • Then pick next function
Background

Part 4: Workflow

Step 3: Security & Optimization (last hour)

Skip optimization if core functions not done.

Only if you have time:

  • AI: "Run Slither security audit"
  • AI: "Optimize for gas"
  • AI: "Add access control modifiers"
  • Test all functions with Foundry
Background

Part 5: Mistakes

Common Smart Contract Mistakes

❌ Don't Do This

Plan for hours before coding Build custom ERC20 from scratch Gas optimization first Add complex auth system Write all tests yourself

✅ Do This Instead

Code immediately Use OpenZeppelin standards Basic functions first Skip complex auth for now AI generates tests, you review

Background

Part 5: Security

AI Security Mistakes to Avoid

You are the auditor. AI drafts. You review.

Critical warnings:

  • ❌ Deploy AI code without reading it
  • ❌ Skip security review of AI suggestions
  • ❌ Trust AI 100% for critical functions
  • ❌ Not checking for reentrancy/overflow bugs
  • ❌ Using vague security prompts

Part 5: Security

Security Checklist for AI-Generated Contracts

Never deploy without human security review.

Does AI use OpenZeppelin standard contracts?

Are require() statements checking msg.sender?

Are overflow/underflow checks present?

Is there reentrancy protection on external calls?

Are events emitted for all state changes?

Did you run Slither security analysis?

Part 6: Demo

What Judges Actually Care About

Complex contracts are bonus. Working is required.

Demo success = project success:

  • ✅ Problem is clear
  • ✅ Smart contract compiles and works
  • ✅ Demo is 3 minutes or less
  • ✅ No bugs in testnet demo
  • ✅ Story makes sense
Background

Part 6: Demo

Demo Script Template

Practice until you can do it without thinking.

Follow this 4-minute script:

  • 1. Problem (30 sec): "Users can't vote in decentralized way"
  • 2. Solution (2 min): "Here's our governance contract. Mint, vote..."
  • 3. Features (1 min): "Call vote function. See result."
  • 4. Value (30 sec): "True DAO voting, gas efficient"

Part 6: Demo

Demo Day Checklist

One demo failure = lost.

Deploy to testnet before demo

Have backup screenshots of successful transactions

Test on projector/speaker beforehand

Know who explains each function

Prepare for security questions

Have testnet explorer URLs ready

Background

Part 7: Your Turn

Real Example: ERC20 Token in 15 Minutes

4 prompts. 15 minutes. Deployed contract.

Try this now:

  • 1. AI: "Create ERC20 with OpenZeppelin v5. Mint, burn, transfer."
  • 2. AI: "Add access control to mint function"
  • 3. AI: "Add events for all operations"
  • 4. AI: "Generate Foundry tests"

Part 7: Your Turn

Your Hackathon Plan

Practice today. Win tomorrow.

Today:

  • ✅ Download Cursor IDE
  • ✅ Install Foundry or Hardhat
  • ✅ Practice 5 Solidity prompts
  • ✅ Build a simple ERC20
  • ✅ Time yourself
Background

Part 7: Your Turn

Quick Reference: Solidity Prompt Patterns

Take a picture. Use tomorrow.

🔧 Scaffolding:

  • "Create [contract type] using [standard]. Features: [list]. Gas optimized."

🐛 Debugging:

  • "Fix this Solidity error: [paste]. Contract: [paste]."

✨ Functions:

  • "Add [function] to [contract]. Handle [edge case]. Access control included."

🔒 Security:

  • "Review for [reentrancy/overflow]. Add checks. Use modifiers."

🧪 Testing:

  • "Generate Foundry tests for [function]. Cover [edge cases]."

Part 7: Your Turn

Team Roles (Simple Version)

Rotate if needed. Keep everyone busy.

Divide work:

  • 🎯 Vision: Keeps contract focused
  • ⚡ Builder: Writes Solidity with AI
  • 🔧 Fixer: Compiles and tests
  • 🎤 Presenter: Prepares demo
Background

Part 7: Your Turn

Recap: The Formula

Compare to old way: 4-6 functions. You're 10x faster.

Smart Contract Vibe Coding Formula:

  • 1. Clear goal
  • 2. One function
  • 3. AI writes Solidity
  • 4. Compile and test
  • 5. Fix if errors
  • 6. Repeat

Speed Stats:

  • Time per function: 5-10 minutes
  • Functions per hour: 6-12
  • Total functions in hackathon: 40-80
Background

Part 7: Your Turn

Final Message

Hackathons = Speed + Working Contracts + Security Review

AI makes speed possible.

You direct. AI writes.

You audit security.

You win.

🔥 Go deploy something. Fast and Safe. 🔥

01/25