Bonding curves are powerful pricing mechanisms, commonly used in token issuance, prediction markets, DAOs, and decentralized applications to determine token prices based on supply. But with great power comes many edge cases and attack surfaces.
A bonding curve is a mathematical function that defines the price of a token in relation to its supply. As tokens are bought (minted), the supply increases and the price follows the curve. When tokens are sold (burned), the price decreases accordingly.
The bonding curve is usually backed by a reserve pool (e.g., ETH, DAI), which ensures liquidity.

Where:

function getPriceLinear(uint256 supply) public view returns (uint256) {
return a * supply + b;
}