# Overview

Welcome to the Documentation Hub of Weero and KaiaFun!

![Weero](https://3210087417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQ1yIaW3WRLsWvUPrMDxD%2Fuploads%2Fgit-blob-3c0faf7eee9c95d94327dc06bda841acf8b92f46%2Fweero.png?alt=media)

![KaiaFun](https://kaiafun.io/og-image.jpg)

**KaiaFun** is a memecoin launchpad platform on the Kaia blockchain. KaiaFun uses the trading liquidity from memecoin transactions to fuel a sustainable growth engine ("Flywheel") across Kaia's entire DeFi ecosystem.

* **KaiaFun prevents rugs by making every coin fair-launch with no presale and no team allocation.** Anyone can create a new coin permissionlessly with on-chain metadata and trade on the bonding curve, effectively generating liquidity from thin air. Money printer go brrrrrrrr 💸💸💸
* **When all tokens in the bonding curve are sold out**, it's automatically migrated to a Constant Product Automated Market Maker (CPAMM) decentralized exchange (DEX) with about **109k** **KAIA liquidity as** [**Lair's stKAIA LSD**](https://lair-finance.gitbook.io/lair-finance/liquid-staking/stake-usdkaia-with-lair.fi#stkaia)**.**
* **ENABLE UP ONLY: Traders can 🔥BURN 10 protocol tokens to halt all sell orders** for a specific token for 8 hours (Coming Soon).


# Background

## The Rise and Evolution of Memecoins

Memecoins emerged from internet culture, initially gaining popularity for their humor and relatability. What started as fun soon turned into speculation as community support and social media buzz drove prices skyward.

Despite debates over their intrinsic value, memecoins have become a significant cultural phenomenon within the crypto community. They can be viewed as a form of contemporary pop art, reflecting public sentiment at a given time.

Memecoin trading has emerged as a major use case in the crypto ecosystem, driving substantial liquidity and user engagement.

## The success of Pump.fun

![Pump.fun is the fastest growing application by revenue in the history of the cryptoeconomy. (Days to Reach $100M in Revenue - Syncracy)](https://3210087417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQ1yIaW3WRLsWvUPrMDxD%2Fuploads%2Fgit-blob-8cee0b0e046d7a6c5bf0daffe67f80bacec27ac0%2Fsyncracy.jpg?alt=media)

Pump.fun's meteoric rise showcased the memecoin launchpad potential. According to Syncracy research, Pump.fun hit $100M revenue in just 217 days - a record pace. Daily earnings topped $2M at its peak. This trend, which began in the Solana ecosystem, set a new paradigm for memecoin launchpads and sparked the creation of various similar platforms.

## The Fair Launch Spirit

Fair Launch refers to a token issuance method that provides equal opportunities to all participants, a principle that memecoin killer launches/launchers have all embraced as their core value.

> It took a while for me to finally realize the essence behind a fair launch. It isn't giving the tokens away, it isn't because there was no presale, simply put, it was because everyone had the same advantage, everyone had the same ruleset, there was no secret 'friends and family' round, seed rounds, influencer allocation, there were no whitelists, no capped participation, the rules were provided, and anyone could participate. I finally feel comfortable in saying a fair launch is a launch in which all participants have the same ruleset.
>
> \- [Fair launches, decentralized collaboration, and Fixed Forex (Andre Cronje, Jul 25, 2021)](https://andrecronje.medium.com/fair-launches-decentralized-collaboration-and-fixed-forex-ab327a2e4fc4)

## Our Vision

KaiaFun upgrades memecoin launchpads by:

* Using the Fair Launch model
* Killer-Flywheel integration for a new ~~Solidly~~ Velodrome moment
* Decentralization of protocol desisions and revenue
* Strategic use of memecoin trading liquidity

Watch as KaiaFun harnesses memecoin liquidity to propel the Kaia ecosystem forward.


# How to launch

* Listing Fee is 10 KAIA.
* Tokens are NOT publicly tradeable/transferable before they escape the bonding curve. This is because if an external market forms, value leakage becomes possible.
* When 80% of the total supply (800 million tokens) in the bonding curve is sold out, the protocol should have raised approximately 124,424.7 KAIA. A constant value of 109322.8346456692 KAIA from it and the remaining 20% (200 million) tokens will be paired on a UniswapV2-based exchange (currently DragonSwap). The resulting LP tokens will be burned (by transferring them to the zero address) in the same migration transaction.
* Before launch, please check our [📜 Content Policy](https://github.com/weerofun/weero-docs/blob/main/kaiafun/more/content-policy.md) to ensure your token content complies with platform guidelines and regulatory requirements.


# How to trade

* Users can trade memecoins [listed](/user-guide/how-to-launch) on KaiaFun using KAIA and stKAIA as input tokens.
* 1% Trading Fees are applied to each trade.


# How to halt selling

WIP


# Token Contract Verification

* Compiler Version (solc): `v0.8.20+commit.a1b79de6`
* Open Source License Type: `MIT`
* EVM Version: `paris`
* Optimization: `true`
* Optimization Runs: `4294967295`
* Constructor Arguments:
  * `{token name}, {token symbol}, 0, 080F8b793FE69Fe9e65b5aE17b10F987c95530Bf)`

````json
{
  "language": "Solidity",
  "settings": {
    "optimizer": { "enabled": true, "runs": 4294967295 },
    "metadata": { "bytecodeHash": "none" },
    "evmVersion": "paris",
    "outputSelection": {
      "*": {
        "*": ["abi", "evm.bytecode", "evm.deployedBytecode", "evm.methodIdentifiers", "metadata"],
        "": ["ast"]
      }
    }
  },
  "sources": {
    "main.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n    address private _owner;\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    constructor(address initialOwner) {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n    mapping(address account => uint256) private _balances;\n\n    mapping(address account => mapping(address spender => uint256)) private _allowances;\n\n    uint256 private _totalSupply;\n\n    string private _name;\n    string private _symbol;\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * All two of these values are immutable: they can only be set once during\n     * construction.\n     */\n    constructor(string memory name_, string memory symbol_) {\n        _name = name_;\n        _symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual returns (string memory) {\n        return _name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual returns (string memory) {\n        return _symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual returns (uint256) {\n        return _balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP. See the note at the beginning of {ERC20}.\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            _totalSupply += value;\n        } else {\n            uint256 fromBalance = _balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                _balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                _totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                _balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     *\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n     * true using the following override:\n     * ```\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        _allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner` s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance != type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n\ninterface IBondToken is IERC20 {\n    function mint(address _to, uint256 _value) external;\n    function burn(address _from, uint256 _value) external;\n}\n\ncontract BondToken is IBondToken, ERC20, Ownable {\n    uint256 public holderCount;\n\n    mapping(address => bool) private hasBalance;\n\n    constructor(\n        string memory _name,\n        string memory _symbol,\n        uint256 _initialSupply,\n        address _owner\n    ) ERC20(_name, _symbol) Ownable(_owner) {\n        _mint(_owner, _initialSupply); // Mint initial supply to the owner\n    }\n\n    function migrate() external onlyOwner {\n        renounceOwnership();\n    }\n\n    function mint(address _to, uint256 _value) external onlyOwner {\n        _mint(_to, _value);\n    }\n\n    function burn(address _of, uint256 _value) external onlyOwner {\n        _burn(_of, _value);\n    }\n\n    function isMigrated() external view returns (bool) {\n        return owner() == address(0);\n    }\n\n    // called at mint/burn/transfer\n    function _update(address from, address to, uint256 amount) internal override {\n        bool isTokenMigrated = owner() == address(0);\n        require(\n            // if token is not migrated, allow only contract(owner)/burn\n            isTokenMigrated || (from == owner() || to == owner() || from == address(0) || to == address(0)),\n            \"not migrated yet\"\n        );\n\n        super._update(from, to, amount);\n\n        _updateHolderCount(to, balanceOf(to));\n        _updateHolderCount(from, balanceOf(from));\n    }\n\n    function _updateHolderCount(address _user, uint256 _newBalance) internal {\n        bool isCurrentlyHolder = hasBalance[_user];\n        bool isStillHolder = _newBalance > 0;\n\n        if (isStillHolder && !isCurrentlyHolder) {\n            holderCount += 1;\n            hasBalance[_user] = true;\n        } else if (!isStillHolder && isCurrentlyHolder) {\n            holderCount -= 1;\n            hasBalance[_user] = false;\n        }\n    }\n}\n"
    }
  }
}
````


# Mechanism

## 🪄 The Bonding Curve (Exponential)

The bonding curve mechanism used in KaiaFun initially follows an **Exponential** model. The equation for this curve is:

$$
P(x) = P\_0 \cdot e^{k \cdot x}
$$

Where:

* $$P(x)$$ is the price of the token at a given point
* $$P\_0$$ is the initial price
* $$k$$ is a constant that determines the steepness of the curve
* $$x$$ is the percentage of tokens sold (ranging from 0 to 1)

The value of $$k$$ can be derived from the initial and target prices:

$$
k = \ln(\frac{P\_{\text{target}}}{P\_0})
$$

## 💸 Valuation

### Initial Price

The optimal initial token price is 0.0000183 KAIA per token.

$$
P\_{\text{Token}\_\text{initial}/\text{KAIA}} = 0.0000183 \text{ KAIA}
$$

### Total Supply

Token total supply remains 1 Billion.

$$
T\_s = 1,000,000,000
$$

With 18 decimal places matching the native token, it is defined in base units as:

$$
T\_{\text{s}\_\text{units}} = 1,000,000,000 \times 10^{18}
$$

### Initial Virtual Liquidity

#### Token Reserves

80% of the total supply, equivalent to 800,000,000 tokens, is reserved into the virtual pool and tradeable via the bonding curve. The remaining 20%, constituting 200,000,000 tokens, is deployed to the DEX upon migration.

Therefore initial reserves for the token ($$R\_{t\_{initial}}$$) is:

$$
R\_{t\_{initial}} = T\_s \times \frac{80}{100} = 800,000,000
$$

### Initial Market Cap

Initial market cap can be calculated as:

$$
\text{Market Cap}*{\text{Token}*\text{final}} = T\_s \times P\_{\text{Token}*\text{initial}/\text{KAIA}} \times P*\text{KAIA/USD} \ = 1,000,000,000 \times 0.0000183 \text{ KAIA} \times 0.127 \text{ USD} \approx 2,324.1 \text{ USD}
$$

Where:

* $$T\_s$$ is the total supply of KAIA tokens
* $$P\_{\text{Token}\_\text{initial}/\text{KAIA}}$$ is the initial price of the token
* $$P\_\text{KAIA/USD}$$ is the price of KAIA in USD

## 📈 Price/Profit Projection on the Time of Migration (1/2)

### Migration Threshold

The migration threshold is set at 546,614 KAIA, which is equivalent to approximately $69,420 at a KAIA price of $0.127. This specific value was chosen as a meme number using the constants at the time of protocol deployment.

$$
\text{Migration Threshold}\_\text{KAIA} = 546,614 \text{ KAIA}
$$

$$
\text{Migration Threshold}\_\text{USD} \approx 546,614 \times 0.127 = 69,419.978 \text{ USD} \approx 69,420 \text{ USD}
$$

Using the exponential bonding curve model, we can calculate various metrics at the time of migration:

### Final Token Price

The final token price when the migration threshold is reached:

$$
P\_{\text{Token}\_\text{final}/\text{KAIA}} = 0.000546614173228346 \text{ KAIA}
$$

### Total KAIA Raised

The total amount of KAIA raised through the bonding curve:

$$
\Delta R\_b \approx 124,424.78 \text{ KAIA}
$$

In production, this value can contain a small margin of error due to the approximate operations performed in smart contracts.

### CPMM model after migration

After reaching the migration threshold, the system transitions from the exponential bonding curve to a Constant Product Market Maker (CPMM, or CPAMM) model for the DEX. The CPMM follows the equation:

$$
x \* y = k
$$

Where:

* $$x$$ represents the base token reserves (e.g. Wrapped KAIA)
* $$y$$ represents the token reserves (i.e. Newly launched token on top of KaiaFun)
* $$k$$ is a constant

The price of the token at any point can be calculated as:

$$
P = \frac{x}{y}
$$

For buying tokens:

$$
\Delta y = y - \frac{k}{x + \Delta x}
$$

For selling tokens:

$$
\Delta x = x - \frac{k}{y + \Delta y}
$$

Where:

* $$\Delta x$$ is the amount of base tokens added or removed
* $$\Delta y$$ is the amount of tokens bought or sold

To maintain price continuity during this transition, we need to calculate the appropriate KAIA liquidity to deploy to the DEX that matches the final price in the bonding curve.

### Migrated KAIA Liquidity

The amount of KAIA needed for DEX liquidity is calculated to match the final price in the bonding curve after migration to CPMM:

$$
R\_{b\_{final}} = P\_{\text{Token}*\text{final}/\text{KAIA}} \times (T\_s - R*{t\_{initial}}) \approx 109,322.83464567 \text{ KAIA}
$$

This ensures that the initial price in the CPMM DEX matches the final price of the exponential bonding curve, providing a smooth transition for traders.

### Liquidity Fees

The amount of KAIA remaining after DEX deployment:

$$
\text{Remaining KAIA} = \Delta R\_b - R\_{b\_{final}} \approx 15,101.946011 \text{ KAIA}
$$

## 🧮 Mathematical Analysis (2/2)

### Price Increase

We can calculate the percentage increase in token price from initial to final:

$$
\text{Price Increase} = \frac{P\_{\text{Token}*\text{final}/\text{KAIA}} - P*{\text{Token}*\text{initial}/\text{KAIA}}}{P*{\text{Token}\_\text{initial}/\text{KAIA}}} \times 100% \ = \frac{0.000546614173228346 - 0.0000183}{0.0000183} \times 100% \approx 2,886.96%
$$

### Market Cap at Migration

The market cap at the time of migration can be calculated as:

$$
\text{Market Cap}*\text{KAIA} = T\_s \times P*{\text{Token}\_\text{final}/\text{KAIA}} \ = 1,000,000,000 \times 0.000546614173228346 = 546,614.173228346 \text{ KAIA}
$$

Assuming a KAIA market price of $0.127, the market cap in USD is:

$$
\text{Market Cap}\_\text{USD} = 546,614.173228346 \times 0.127 \approx 69,419.9999999999 \text{ USD}
$$

Which matches the target market cap.

### Bonding Curve Constant

We can calculate the constant $$k$$ that defines our exponential curve:

$$
k = \ln(\frac{P\_{\text{Token}*\text{final}/\text{KAIA}}}{P*{\text{Token}\_\text{initial}/\text{KAIA}}}) \ = \ln(\frac{0.000546614173228346}{0.0000183}) \approx 3.396842143109809886
$$


# Protocol Fees

## 📌 TL;DR

{% hint style="info" %}
The policies below are subject to change at the discretion of the operating team or the protocol governance (yet to launch).
{% endhint %}

* Listing Fee
  * 10 KAIA listing fee (≈ $1.27)
* Trading Fee
  * 1% fee for each trades, collected in KAIA (Same as [SunPump](https://docs.sun.io/get-start/sunpump/service-fees))
* Liquidity fee
  * When the project reaches 100% of the Bonding Curve, the "migration" happen. The smart contract will add liquidity of about $14k worth of KAIA (a constant value of 109322.8346456692 KAIA) and the remaining 200 million tokens to KaiaFun's V2 liquidity pool or to an partnered DEX when trigged.
  * Additionally, the smart contract will deduct around 15k KAIA from the gathered KAIA liquidity (which is around 124,424.7 KAIA with possible, tiny [approximation errors](https://en.wikipedia.org/wiki/Approximation_error)). This fee is for the maintenance for the protocol.
* To prevent value leakage, transfers of tokens that are not to the zero address or to the KaiaFun core contract are prohibited before the migration.
* Periphery Fees
  * Flashloan Interest is 0.13% (Lower than [Klaybank](https://docs.klaybank.org/protocol/functions/flashloan#undefined))
  * Swap Fee for V2 liquidity pools are 0.3%. Fees for partner DEXes may vary.


# The $WEERO Token

$WEERO is the governance token for KaiaFun.

{% hint style="info" %}
The tokenomics of $WEERO are currently in draft form.
{% endhint %}

## Phase 1

* Fixed supply of 1 million
* 18 decimals
* Airdropped launch on early users and ecosystem partners
* $WEERO liquidity pool is deployed to WEERO's own constant product or/and concentrated liquidity DEX
* Deflationary
  * Buybacks from treasury made with protocol fees
  * Burn fixed amount of $WEERO for superpowers

## Phase 2

* *ve(3, 3)*
  * Stake to earn governance rights and staking incentives
  * An open vested escrow token model, lockup period from 1 week to 4 years
  * ve lockers accumulate all protocol fees (emissions are made by $WEERO buybacks from protocol fees)


# Flashloans

If you HODL an unmigrated token on KaiaFun, liquidity is locked in our contracts until you dump on the curve. You've got it -- IDLE locked value discovered. Developers and research firms can leverage memecoin-made liquidity to access flash loans with competitive rates and powerful capital.

## `IFlashLoanProvider`

```solidity
interface IFlashLoanProvider {
 function flashLoan(
    address receiverAddress,
    address[] calldata assets,
    uint256[] calldata amounts,
    bytes calldata params
  ) external;
}
```

## `IFlashLoanReceiver`

```solidity
interface IFlashLoanReceiver {
    function executeOperation(
        address[] calldata assets,
        uint256[] calldata amounts,
        uint256[] calldata fees,
        bytes calldata params
    ) external returns (bool);
}
```


# Weero Finance

![Weero](https://3210087417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQ1yIaW3WRLsWvUPrMDxD%2Fuploads%2Fgit-blob-3c0faf7eee9c95d94327dc06bda841acf8b92f46%2Fweero.png?alt=media)

## Introduction&#x20;

{% hint style="success" %}
We're currently updating our comprehensive documentation with improved styling and organization. Follow us on Twitter for the latest updates!
{% endhint %}

**The KaiaFun team is proud to introduce that we're launching Weero — a specialized trading infrastructure and decentralized exchange designed for the next phase of Kaia Ecosystem growth.**

Weero is initially a DEX and DEX Aggregator specifically optimized for memecoins, LST/LRT tokens, and LINE MiniDapps tokens that will grow in connection with these assets. The platform is designed to support the unique characteristics and trading patterns of these emerging token categories.

* **Exchange:** Weero has it's own V2 and V3 factories, which are completely permissionless — anyone can use it immediately without BD outreach or special approval processes. We aim to create an environment where new dApps can experiment and flourish instantly. We believe that when such an environment is established on Kaia, money legos will no longer be just a concept but will actually function in practice.
* **DEX Aggregator:** Beyond the DEX itself, we also have an on-chain queryable DEX aggregator that will be integrated by default. This aggregator will explore and provide optimal routing for various assets across connected DEXes, ensuring users get the best possible trading opportunities.

## Fees

### V3 Liquidity Pool Fees

Each V3 liquidity pool has a custom fee set by the pool creator:

* Fee tiers: 0.01%, 0.05%, 0.25%, and 1%.
* Protocol fee is 20% of the fee.

| Category              | 0.01%  | 0.05% | 0.25% | 1%    |
| --------------------- | ------ | ----- | ----- | ----- |
| ✨ Liquidity Providers | 0.008% | 0.04% | 0.20% | 0.80% |
| Protocol              | 0.002% | 0.01% | 0.05% | 0.20% |

### V2 Liquidity Pool Fees

V2 pools have a standard 0.3% trading fee, distributed as follows:

* ✨ 0.25% to Liquidity Providers
* 0.05% to Protocol

## Contracts

We are currently disclosing the contract addresses deployed for Weero's V2/V3 Exchange.

We strongly recommend using the official frontend for all interactions with Weero protocols. The frontend provides a safe and user-friendly interface that helps prevent the most common mistakes and transaction failures.

Weero and its contributors are not responsible for any losses or damages resulting from direct contract interactions or misuse of the protocol.

```json
{
  "V3": {
    "Factory": "0x6603E53b4Ae1AdB1755bAF62BcbF206f90874178",
    "NonfungiblePositionManager": "0x2d974eA8199FFA7B0Ce914070f027BC94dF2E802",
  },
  "V2": {
    "Factory": "0xdE9634D8A1b5855E3Ddb0B0712b28031e18865d9",
    "Router02": "0x20A12562BA949A8260A4Cbb66F15eC6DF91c5fa2",
  },
}
```

## Security

Weero is built on top of [Uniswap](https://uniswap.org/) V2 and V3 contracts. For all related Audits, you can refer to the ones on Uniswap's GitHub.

* <https://github.com/Uniswap/v3-core/tree/main/audits>


# Terms and Conditions


# Content Policy


# Brand Kit

Primary brand color is `#BFF009`.

## The KaiaFun Brand


