BondingCurve.sol
Sells 0x1 along a linear price curve in exchange for ETH. One-way; the contract has no sell-back. 900M 0x1 are held in the contract at deploy and sold over ~521 ETH.
Mint amount 0x1 to the caller's address against the current curve price. Caller must attach cost = ((s+a)² - s²) / (2·SCALE) ETH or more.
Reverts with AmountIsZero, AmountAboveCap, CurveExhausted, or InsufficientEth.
Return the ETH cost to mint amount 0x1 at the current supply. Useful for slippage-aware UIs.
Forward the contract's full ETH balance to the Treasury contract. Anyone can call. No keeper required.
ECTRouter.sol
User-facing entry point for swaps. Routes through 0x1 automatically when called with two non-0x1 tokens.
Swap attached ETH for tokenOut. Reverts if output is below amountOutMin. Routes ETH → 0x1 → tokenOut (two hops) unless tokenOut == 0x1.
Swap tokenIn → tokenOut. If neither is 0x1, routes via 0x1 in two hops. Caller must approve the router for amountIn.
ECTPairFactory.sol
Deploys 0x1-anchored Uniswap-V2-style pairs. Enforces that one side of every pair is 0x1.
Deploy a new pair. Reverts with MustIncludeZeroX1 if neither tokenA nor tokenB equals 0x1. The pair becomes immediately routable through the Router.
TokenFactory.sol
Deploys fresh fixed-supply ERC-20s in exchange for 1000 0x1, 980 of which are burned.
Deploy a new token contract with fixed supply minted to to. Caller must approve 1000 0x1 to the factory. 980 burned, 20 to treasury.
NFTFactory.sol
Deploys ERC-721 collections in exchange for 500 0x1, 490 burned.
Deploy a new ERC-721 collection. mintPrice is denominated in 0x1. Creator gets 99% of mint proceeds, treasury gets 1%.
Treasury.sol
Ownable2Step holding all protocol revenue. Owner is a recommended multisig.
Withdraw amount ETH to to. Owner-only. See SECURITY.md for the threat model.
Custom errors
All revert conditions are typed. Use them in your error handling.
Indexed events
All public actions emit indexed events for off-chain consumption.