Skip to content

lukecd/token-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bonding Curve Token Examples

This repo contains examples demonstrating how to create and interact with bonding curve tokens on Ethereum or any EVM-compatible chain. Use bonding curves to price tokens based on supply, eliminating the need for traditional liquidity pools.

What You'll Learn

  • How to implement bonding curve pricing in Solidity
  • Understanding linear bonding curves and price discovery
  • Building a React/Next.js interface for token trading
  • Connecting smart contracts to web interfaces using Next.js

Project Structure

├── contracts/         # Solidity smart contracts and tests
│   ├── src/           # Contract source code
│   ├── test/          # Foundry test suite
│   └── script/        # Deployment scripts
├── ui/                # Next.js frontend application
│   ├── app/           # React components and pages
│   ├── lib/           # Utility functions and contract integration
│   └── public/        # Static assets
└── README.md          # This file

Quick Start

Prerequisites

1. Smart Contract Development

Navigate to the contracts/ directory to work with the Solidity contracts:

cd contracts

Install dependencies:

forge install

Run tests:

forge test

For detailed contract documentation, see contracts/README.md.

2. Frontend Development

Navigate to the ui/ directory to work with the React application:

cd ui

Install dependencies:

npm install

Start development server:

npm run dev

Open http://localhost:3000 to view the application.

Understanding Bonding Curves

What is a Bonding Curve?

A bonding curve is a mathematical function that determines token price based on supply. Unlike traditional markets where price is set by supply and demand, bonding curves provide algorithmic price discovery.

Key Benefits

  • No Liquidity Pools: Tokens can be traded without external liquidity providers
  • Fair Pricing: Everyone pays the same price for the same amount of tokens
  • Continuous Trading: Buy and sell tokens at any time
  • Price Predictability: Calculate exact costs before trading
  • Bootstrap Liquidity: Create liquid markets from day one

License

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

Acknowledgments

  • OpenZeppelin for secure contract libraries
  • Foundry for the excellent development framework
  • Next.js for the React framework
  • The Ethereum community for bonding curve research and implementations

About

Collection of ERC20 token examples that demo bonding curves

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors