Skip to main content

Architecture

KasFun consists of three core contracts:

MemeFactory

The central contract. All token creation and bonding curve trading goes through MemeFactory.
FunctionDescription
createToken(params)Create a new token (payable, requires platform signature)
buy(token, minTokensOut)Buy tokens with KAS (payable)
sell(token, tokenAmount, minKasOut)Sell tokens for KAS (requires ERC-20 approval)
getTokenInfo(token)Get token state (reserves, graduated, etc.)
getCurrentPrice(token)Get current price in KAS
getBondingCurveProgress(token)Get fundraising progress (0–10000 = 0–100%)
getTokenParamVersion(token)Get bonding curve parameters (virtualToken, virtualKas, etc.)
bondingCurve()Get the BondingCurve contract address
Each token created by MemeFactory is ERC-20 compatible.

BondingCurve

A stateless math contract. All functions are pure or view — they don’t modify state. Used by MemeFactory internally and available for external price calculations.
The BondingCurve contract address is not fixed — read it from MemeFactory.bondingCurve().
const bcAddress = await factory.bondingCurve();
FunctionDescription
calculateBuyReturnWithParams(...)KAS in → tokens out
calculateSellReturnWithParams(...)Tokens in → KAS out
calculateBuyCostWithParams(...)Desired tokens out → required KAS in

Council V1

Per-token governance contract, activated after a token graduates. Each graduated token can have its own Council with elected members, proposals, and voting.
FeatureDescription
ElectionsToken holders vote to elect Council members
ProposalsCouncil members create proposals for the community
VotingToken holders vote on proposals by locking tokens
Tax ConfigCommunity can set token tax through proposals
Council addresses are per-token. You can find a token’s Council address on its community page at kas.fun.

Token Standards

  • All tokens are ERC-20 compatible (transfer, approve, balanceOf, etc.)
  • Total supply: 1,000,000,000 (1 billion) tokens per token, all 18 decimals
  • Tokens are minted entirely at creation. 80% goes into the bonding curve pool, 20% is reserved.