This repository contains the smart contracts for a decentralized bonding curve system with pre-bonding capabilities and eventual migration to Uniswap V3, featuring LP NFT locking for security.
The system implements a bonding curve mechanism with the following key features:
- Pre-bonding phase for initial token distribution
- Active trading phase with constant product AMM formula
- Automatic migration to Uniswap V3
- LP NFT locking for long-term security
- Minimal proxy pattern (EIP-1167) for gas-efficient deployment
- Foundry: Main deployer contract that manages system deployment
- Factory: Handles deployment of token and bonding curve instances
- TokenImplementation: ERC20 token with one-time mint capability
- BondingCurve: Implements the bonding curve mechanism
- Lock: Manages Uniswap V3 LP NFT locking and fee claims
- BondingMath: Handles price calculations and fee computations
- UniswapPoolCreator: Manages Uniswap V3 pool creation and position management
- Clone the repository
- Install dependencies:
npm install
- Copy the environment file:
cp .env.example .env
- Configure your environment variables in
.env
:
- Set deployment accounts and private keys
- Add API keys for various networks
- Configure network-specific variables
Run the test suite:
npm run test
For gas reporting:
npm run test:gas
For coverage report:
npm run test:coverage
The system supports deployment to multiple networks. Use the appropriate command for your target network:
# Sepolia Testnet
npm run sepolia:deploy
npm run sepolia:verify
# BSC
npm run bsc:deploy
npm run bsc:verify
# Base
npm run base:deploy
npm run base:verify
# Blast
npm run blast:deploy
npm run blast:verify
# Linea
npm run linea:deploy
npm run linea:verify
# Arbitrum
npm run arbitrum:deploy
npm run arbitrum:verify
The contracts are designed to work with the Memex DApp (GitHub Repository).
After deployment:
- Run the export command to generate DApp-compatible files:
npm run done
-
This will create contract ABIs and addresses in the
/build
directory -
To update the DApp:
- Copy all files from
/build
to/evm
in the DApp directory - Run
npm build
in the DApp directory to update the UI
- Copy all files from
For detailed DApp documentation, visit: https://docs.memex.dcriptoshi.com
- Initial Virtual ETH: 5 ETH
- Pre-bonding Target: 5 ETH
- Total Bonding Target: 30 ETH
- Token Supply: 1,000,000,000
- Lock Duration: 10 years
- Trading Fee: Configurable by platform admin
- LP NFT locking mechanism to prevent rug pulls
- One-time mint restriction on tokens
- No owner control after initialization
- Fee collection mechanisms
- Built on OpenZeppelin contracts
- Comprehensive test coverage
MIT License
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
For technical support or questions, please refer to:
- Documentation: https://docs.memex.dcriptoshi.com
- GitHub Issues: Create an issue in the repository