- System Overview
- Contract Architecture
- Key Components
- Main Functions
- Events
- Usage Notes
- Development Information
Nad.Pump is a smart contract system for creating and managing bonding curve-based tokens. It enables creators to mint new tokens with associated bonding curves and allows traders to buy and sell these tokens through a centralized endpoint. The system uses a combination of bonding curves and automated market makers to provide liquidity and price discovery for newly created tokens.


-
Core.sol
- Central contract that coordinates all system operations
- Handles token creation, buying, and selling operations
- Manages interactions with WNative and fee collection
- Implements various safety checks and slippage protection
-
BondingCurve.sol
- Implements the bonding curve logic
- Calculates token prices based on supply
- Manages token reserves and liquidity
-
BondingCurveFactory.sol
- Deploys new bonding curve contracts
- Maintains registry of created curves
- Ensures standardization of curve parameters
-
WNative.sol
- Wrapped Native token implementation
- Provides ERC20 interface for Native
- Enables advanced trading features
-
FeeVault.sol
- Collects and manages trading fees
- Implements ERC4626 for fee distribution
- Provides revenue sharing mechanism
-
Token.sol
- Standard ERC20 implementation for created tokens
- Includes additional features for bonding curve integration
-
MintParty.sol & MintPartyFactory.sol
- Manages collective minting operations
- Coordinates group participation in token creation
-
Utils/
- Contains helper functions and libraries
- Implements common mathematical operations
- Provides security utilities
-
Interfaces/
- Defines contract interfaces
- Ensures proper contract interaction
- Facilitates upgradability
-
Errors/
- Centralizes error definitions
- Provides clear error messages
- Improves debugging experience
Component | Description |
---|---|
Creator | Initiates the creation of new coins and curves |
Trader | Interacts with the system to buy and sell tokens |
Core | Main contract handling Bonding Curve creation, buying, and selling; |
WNative | Wrapped NAD token used for transactions |
BondingCurveFactory | Deploys new Bonding Curve contracts |
BondingCurve | Manages token supply and price calculations |
ERC20 | Standard token contract deployed for each new coin |
CPMM DEX | External decentralized exchange for token trading |
Vault | Repository for accumulated trading fees; facilitates revenue sharing for token holders |
createCurve
: Creates a new token and its associated bonding curve
Function | Description |
---|---|
buy |
Market Buy tokens at the current bonding curve price. |
protectBuy |
Buys tokens with slippage protection |
exactOutBuy |
Buys an exact amount of tokens from a bonding curve |
Function | Description |
---|---|
sell |
Market sells tokens at the current bonding curve price |
sellPermit |
Market sells tokens at the current bonding curve price with permit |
protectSell |
Sells tokens with slippage protection |
protectSellWithPermit |
Sells tokens with slippage protection with permit |
exactOutSell |
Sells tokens for an exact amount of Native on the bonding curve |
exactOutSellWithPermit |
Sells tokens for an exact amount of Native on the bonding curve with permit |
getCurveData
: Retrieves data about a specific curvegetAmountOut
: Calculates the output amount for a given inputgetAmountIn
: Calculates the input amount required for a desired output
event Buy(
address indexed sender,
address indexed token,
uint256 amountIn,
uint256 amountOut
);
event Sell(
address indexed sender,
address indexed token,
uint256 amountIn,
uint256 amountOut
);
event Create(
address indexed owner,
address indexed curve,
address indexed token,
string tokenURI,
string name,
string symbol,
uint256 virtualNative,
uint256 virtualToken
);
- ⏰ Deadline parameter ensures transaction freshness
- 🔐 Some functions require pre-approval of token spending
- 💱 Supports both NAD and WNative for transactions
- 📝 EIP-2612 permit functionality available for gasless approvals
- 🛡️ Slippage protection implemented in various functions
This smart contract is part of the Nad.Pump system, designed to create and manage bonding curve-based tokens. For more detailed information about the implementation and usage, please refer to the full contract code and additional documentation.
📌 For questions or support, please open an issue in the GitHub repository.