Skip to main content

Contract Info

PropertyValue
AddressSee Addresses
NetworkKasplex (see Addresses for chain details)

Write Functions

createToken

Create a new token. Requires a platform signature obtained through kas.fun.
CreateTokenParams:
FieldTypeDescription
namestringToken name
symbolstringToken symbol
metadataUristringMetadata URI
creatorBuyAmountuint256Optional initial buy amount (wei)
saltbytes32Salt for deterministic address
nonceuint256Anti-replay nonce
deadlineuint256Signature expiry timestamp
signaturebytesPlatform EIP-712 signature
Value: creationFee + creatorBuyAmount

buy

Buy tokens with KAS.
ParameterTypeDescription
tokenaddressToken to buy
minTokensOutuint256Minimum tokens to receive (slippage protection)
Value: Amount of KAS to spend (wei)

sell

Sell tokens for KAS. Requires prior ERC-20 approval.
ParameterTypeDescription
tokenaddressToken to sell
tokenAmountuint256Amount of tokens to sell (wei)
minKasOutuint256Minimum KAS to receive (slippage protection)

Read Functions

getTokenInfo

Returns (TokenInfo):
FieldTypeDescription
tokenIduint256Token ID (0 if not found)
creatoraddressToken creator
pooladdressPool address
tokenReservesuint256Token reserves in pool (wei)
kasReservesuint256KAS reserves in pool (wei)
createdAtuint256Creation timestamp
fulfilledboolBonding curve threshold reached
graduatedboolLiquidity migrated to DEX
metadataUristringMetadata URI
paramVersionuint256Curve parameter version

getCurrentPrice

Returns the current price in KAS per token (18 decimals).

getBondingCurveProgress

Returns progress from 0 to 10000 (representing 0.00% to 100.00%).

getTokenParamVersion

Returns (ParamVersion):
FieldTypeDescription
graduationThresholduint256KAS amount needed to graduate (wei)
virtualTokenuint256Virtual token reserve for curve
virtualKasuint256Virtual KAS reserve for curve
sqrtPriceX96Token0uint160Uniswap V3 sqrt price (token0)
sqrtPriceX96Token1uint160Uniswap V3 sqrt price (token1)
activeboolWhether this param version is active

computeTokenAddress

Predict the token contract address before creation.

bondingCurve

Returns the BondingCurve contract address.

creationFee

Returns the token creation fee in KAS (wei).

authorizedSigner

Returns the platform’s authorized signer address.

Events

Created

Buy

Sell

Full ABI (JSON)