Boncurs Bonding Curve Library
Last updated
Last updated
$ forge install dustinstacy/boncurs// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {ExpCurve} from "@boncurs/contracts/exponential/ExpCurve.sol";
// Couple with a token contract for ideal use case
contract ExampleImplementation is ExpCurve {
// Track the reserve ratio, reserve balance, and supply using desired method
uint32 private reserveRatio;
uint256 private reserveBalance;
uint256 private supply;
function exampleFunc(uint256 depositAmount) public {
// Call library methods to use pricing calculations
uint256 examplePurchaseReturn = getPurchaseReturn(supply, reserveBalance, reserveRatio, depositAmount);
}
}