{
  "schema_version": "1.0",
  "name": "开门红",
  "symbol": "KMH",
  "tagline_zh": "初始现货估值 2.0×，到期少于 200 份可自提全额本金。",
  "tagline_en": "Initial spot valuation at 2.0×. Full principal refunds below 200 shares at deadline.",
  "chain": {
    "name": "BNB Smart Chain",
    "chain_id": 56,
    "native_symbol": "BNB",
    "rpc_url": "https://bsc-dataseed.bnbchain.org",
    "rpc_fallback_url": "https://bsc.publicnode.com",
    "explorer_url": "https://bscscan.com/address/0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a#code"
  },
  "contracts": {
    "sale": "0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a",
    "token": "0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a",
    "notification_pass": "0xb4267286388b4f342C9D839cADcb87053aaA5c97"
  },
  "security_facts": {
    "no_admin": true,
    "immutable": true,
    "non_pausable": true,
    "no_arbitrary_withdrawal": true,
    "launch_only_on_contract_conditions": true,
    "lp_lock_days": 30,
    "lp_withdrawal": "Only PAYEE after the lock.",
    "full_refund_below_threshold": true,
    "verify_url": "https://bscscan.com/address/0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a#code",
    "pass_distribution": "The deployer delivers the committed roster of 296 passes in one batch after deployment. Successful delivery permanently seals issuance."
  },
  "sale": {
    "total_shares": 1500,
    "unit_price_bnb": "0.005",
    "unit_price_wei": "5000000000000000",
    "max_paid_shares_per_wallet": 10,
    "max_paid_bnb_per_wallet": "0.05",
    "max_paid_wei_per_wallet": "50000000000000000",
    "paid_eligibility": "Wallet holding Agent ID; verify with isAgent(address).",
    "tokens_per_share": "2",
    "token_decimals": 18,
    "initial_spot_multiplier": 2,
    "initial_spot_value_per_10_shares_bnb": "0.10",
    "lp_allocation_percent": 100,
    "sale_start_iso": "2026-12-02T12:00:03Z",
    "duration_hours": 6,
    "deadline_iso": "2026-12-02T18:00:03Z",
    "launch_threshold_shares": 200,
    "launch_trigger": "Automatic on sellout. At deadline anyone may open if at least 200 shares sold. The sellout transaction includes pool creation and uses more gas.",
    "refund_percent_below_threshold": 100,
    "tax_buy_percent": 3,
    "tax_sell_percent": 3,
    "tax_transfer_percent": 0,
    "tax_scope": "Main pool transfers including liquidity adds and removals by direction.",
    "payment_settlement_rule": "Settles by floor(msg.value / price) within remaining wallet and sale caps. Excess and change return to sender in the same transaction.",
    "payment_preview": "Read quote(qty), preview identical from/to/data/value with eth_call, send only when value equals quote and preview succeeds. Buy previews before sale start revert with DoorSaleClosed().",
    "gas_limit_method": "eth_estimateGas",
    "transfer_before_pool_open": false
  },
  "free_pass": {
    "contract": "0xb4267286388b4f342C9D839cADcb87053aaA5c97",
    "free_shares_per_pass": 1,
    "agent_id_required": false,
    "pre_open_shared_cap": 375,
    "opening_cap_paid_share_percent": 25,
    "opening_cap_rounding": "floor",
    "scaling": "Allocations above the opening cap scale pro rata. New free shares after opening require room under the cap.",
    "availability_note": "Stamp from sale start while allocation remains. Ended sales below the threshold void free allocations.",
    "edition_size": 296,
    "find_ids": "Read totalSupply() and compare ownerOf(id) for IDs 1 through totalSupply() with the wallet. Read ribbonSpent(id) on the sale contract."
  },
  "referral": {
    "binds_only_on_first_paid_purchase": true,
    "check_binding": "hostOf(address)",
    "trigger_invitee_paid_shares": 10,
    "draws_earned_per_invitee": 1,
    "reward_free_shares_range": [
      1,
      5
    ],
    "flow": [
      "sealHongbao(address)",
      "revealHongbao(address)"
    ],
    "target_block_offset": 16,
    "first_reveal_block_offset": 17,
    "draw_window_blocks_after_target": 8191,
    "late_reveal_shares": 1,
    "deadline_days_after_open": 7,
    "credit_limited_by_remaining_allocation": true
  },
  "profit_reference": {
    "scenario": "First immediate seller of 10 shares after sellout on BSC fork, without external buys or free redemptions.",
    "full_wallet_shares": 10,
    "full_wallet_cost_bnb": "0.05",
    "initial_spot_value_bnb": "0.10",
    "first_sell_multiplier": "1.90898675033868626",
    "first_sell_bnb": "0.095449337516934313",
    "excludes_gas": true,
    "note_zh": "开盘后价格依池子深度与买卖变动。",
    "note_en": "Post-launch price fluctuates with pool depth and trades.",
    "threshold_open": {
      "paid_shares": 200,
      "immediate_sale_shares": 10,
      "received_bnb": "0.08771826249417093",
      "received_over_cost": "1.7543652498834186"
    }
  },
  "methods": {
    "read": [
      {
        "signature": "quote(uint256)",
        "selector": "0xed1bd76c"
      },
      {
        "signature": "totalMinted()",
        "selector": "0xa2309ff8"
      },
      {
        "signature": "price()",
        "selector": "0xa035b1fe"
      },
      {
        "signature": "MAX_SUPPLY()",
        "selector": "0x32cb6b0c"
      },
      {
        "signature": "WALLET_LIMIT()",
        "selector": "0x351ed951"
      },
      {
        "signature": "saleStart()",
        "selector": "0xab0bcc41"
      },
      {
        "signature": "deadline()",
        "selector": "0x29dcb0cf"
      },
      {
        "signature": "opened()",
        "selector": "0x5f88eade"
      },
      {
        "signature": "isAgent(address)",
        "selector": "0x1ffbb064"
      },
      {
        "signature": "sharesOf(address)",
        "selector": "0xf5eb42dc"
      },
      {
        "signature": "balanceOf(address)",
        "selector": "0x70a08231"
      },
      {
        "signature": "refundable(address)",
        "selector": "0x68ec0d99"
      },
      {
        "signature": "freeClaimable(address)",
        "selector": "0x693656a7"
      },
      {
        "signature": "hostOf(address)",
        "selector": "0xf8690568"
      },
      {
        "signature": "foldedFortuneTokens(address)",
        "selector": "0x131aa4ef"
      },
      {
        "signature": "hongbaoDeadline()",
        "selector": "0x54ec4387"
      }
    ],
    "write": [
      {
        "signature": "mint(uint256,address)",
        "selector": "0x94bf804d",
        "payable": true
      },
      {
        "signature": "mint()",
        "selector": "0x1249c58b",
        "payable": true
      },
      {
        "signature": "mintWithRibbon(uint256,address,uint256)",
        "selector": "0xd23194db",
        "payable": true
      },
      {
        "signature": "open()",
        "selector": "0xfcfff16f",
        "payable": false
      },
      {
        "signature": "refund()",
        "selector": "0x590e1ae3",
        "payable": false
      },
      {
        "signature": "refundTo(address)",
        "selector": "0x71ed4664",
        "payable": false
      },
      {
        "signature": "stampRibbon(uint256)",
        "selector": "0x0be11506",
        "payable": false
      },
      {
        "signature": "unfoldFortune()",
        "selector": "0x891bb50f",
        "payable": false
      },
      {
        "signature": "sealHongbao(address)",
        "selector": "0x55189aac",
        "payable": false
      },
      {
        "signature": "revealHongbao(address)",
        "selector": "0xe9942117",
        "payable": false
      },
      {
        "signature": "approve(address,uint256)",
        "selector": "0x095ea7b3",
        "payable": false
      }
    ]
  },
  "sell": {
    "router": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
    "wbnb": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "path": [
      "0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a",
      "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
    ],
    "quote_input": "floor(amount * 97 / 100)",
    "minimum_output": "floor(quoted_second_amount * 95 / 100)",
    "swap": "swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)",
    "preview_and_estimate": true,
    "example_arguments": "Replace amountOutMin with the quoted minimum, recipient with the intended recipient, and swapDeadline with a future Unix timestamp; then ABI-encode args. For other token amounts recalculate input net of 3% and take 95% of a fresh quote. Only gas actually used is charged."
  },
  "examples": [
    {
      "example": "quote_10",
      "to": "0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a",
      "value_wei": "0",
      "data": "0xed1bd76c000000000000000000000000000000000000000000000000000000000000000a",
      "expected_wei": "50000000000000000"
    },
    {
      "example": "buy_10",
      "to": "0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a",
      "value_wei": "50000000000000000",
      "data": "0x94bf804d000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000"
    },
    {
      "example": "buy_10_with_referrer",
      "to": "0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a",
      "value_wei": "50000000000000000",
      "signature": "mint(uint256,address)",
      "selector": "0x94bf804d",
      "args": [
        "10",
        "<你的推荐人地址>"
      ]
    },
    {
      "example": "stamp_pass_1",
      "to": "0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a",
      "value_wei": "0",
      "data": "0x0be115060000000000000000000000000000000000000000000000000000000000000001"
    },
    {
      "example": "refund",
      "to": "0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a",
      "value_wei": "0",
      "data": "0x590e1ae3"
    },
    {
      "example": "approve_20",
      "to": "0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a",
      "value_wei": "0",
      "data": "0x095ea7b300000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e000000000000000000000000000000000000000000000001158e460913d00000"
    },
    {
      "example": "sell_quote_20",
      "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
      "value_wei": "0",
      "signature": "getAmountsOut(uint256,address[])",
      "selector": "0xd06ca61f",
      "args": [
        "19400000000000000000",
        "[0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a,0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c]"
      ]
    },
    {
      "example": "sell_20",
      "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
      "value_wei": "0",
      "signature": "swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)",
      "selector": "0x791ac947",
      "args": [
        "20000000000000000000",
        "<amountOutMin>",
        "[0xc59BaFc3e32EDA0db8c0d07c8F356dC2a7c4CC1a,0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c]",
        "<recipient>",
        "<swapDeadline>"
      ]
    }
  ],
  "docs": {
    "llms_txt": "/llms.txt",
    "skill_md": "/skill.md"
  },
  "custom_errors": [
    {
      "signature": "DoorSetup()",
      "selector": "0x005e0734",
      "meaning_zh": "构造参数、依赖合约或入池转账校验失败"
    },
    {
      "signature": "DoorBusy()",
      "selector": "0x881608c0",
      "meaning_zh": "合约正在处理另一笔调用"
    },
    {
      "signature": "DoorSaleClosed()",
      "selector": "0xd341354d",
      "meaning_zh": "尚未开卖、已到截止时间或已开池"
    },
    {
      "signature": "DoorNeedsAgent()",
      "selector": "0xa3b49059",
      "meaning_zh": "付款钱包没有可核验的 Agent ID"
    },
    {
      "signature": "DoorOneSeat(uint256)",
      "selector": "0x61395e8e",
      "meaning_zh": "付款不足一份，参数为最低付款 wei"
    },
    {
      "signature": "DoorSeatLimit()",
      "selector": "0xc2a78d9c",
      "meaning_zh": "钱包额度或全盘付费份额已满"
    },
    {
      "signature": "DoorStillShut()",
      "selector": "0x6d3a3758",
      "meaning_zh": "尚未开池，暂不能转移 KMH 或兑换免费份"
    },
    {
      "signature": "DoorCannotOpen()",
      "selector": "0x894644d1",
      "meaning_zh": "尚未到期、未达 200 份或已经开池"
    },
    {
      "signature": "DoorCannotRepay()",
      "selector": "0x950f35a5",
      "meaning_zh": "尚未到期、已达 200 份或已经开池"
    },
    {
      "signature": "DoorNoRepayment()",
      "selector": "0x047deb3c",
      "meaning_zh": "该钱包没有待退本金"
    },
    {
      "signature": "DoorNativePayment(address,uint256)",
      "selector": "0x2e57c9ed",
      "meaning_zh": "BNB 转账失败，参数为收件地址与金额"
    },
    {
      "signature": "DoorAddress()",
      "selector": "0x0d39a07d",
      "meaning_zh": "指定地址无效"
    },
    {
      "signature": "DoorBalance()",
      "selector": "0x1b2e344e",
      "meaning_zh": "KMH 余额不足"
    },
    {
      "signature": "DoorAllowance()",
      "selector": "0x0e1929e9",
      "meaning_zh": "KMH 授权额度不足"
    },
    {
      "signature": "DoorRibbonUnavailable()",
      "selector": "0xfb26c18f",
      "meaning_zh": "尚未开放盖章、非持券人或该券已盖章"
    },
    {
      "signature": "DoorFortuneFull()",
      "selector": "0x732e6b0e",
      "meaning_zh": "免费份额已满"
    },
    {
      "signature": "DoorHongbaoUnavailable()",
      "selector": "0x5de776ed",
      "meaning_zh": "不符合抽奖条件、已申请或该抽奖不可开奖"
    },
    {
      "signature": "DoorHongbaoWaiting()",
      "selector": "0x481241a8",
      "meaning_zh": "尚未到开奖区块或暂时读不到目标块哈希"
    },
    {
      "signature": "DoorHongbaoClosed()",
      "selector": "0xfbc4af15",
      "meaning_zh": "抽奖已截止"
    },
    {
      "signature": "DoorNoFortune()",
      "selector": "0x187b828b",
      "meaning_zh": "没有可兑免费份或可换税额"
    },
    {
      "signature": "DoorLPHeld()",
      "selector": "0x83d9401f",
      "meaning_zh": "无权提取 LP、尚未解锁或没有可提取的 LP"
    },
    {
      "signature": "DoorPairRatio()",
      "selector": "0x5a7e8617",
      "meaning_zh": "现有池余额无法满足开盘储备配置"
    },
    {
      "signature": "DoorFeeAccess()",
      "selector": "0x10470d48",
      "meaning_zh": "内部换税条件未满足"
    },
    {
      "signature": "DoorNeedsMoreGas()",
      "selector": "0xd8acde9b",
      "meaning_zh": "转入主池时剩余 gas 不足，请重新估算"
    },
    {
      "signature": "RibbonMissing()",
      "selector": "0xfff7eaf4",
      "meaning_zh": "该通知券编号不存在"
    },
    {
      "signature": "RibbonAddress()",
      "selector": "0x630d4ab4",
      "meaning_zh": "通知券地址或 URI 无效"
    },
    {
      "signature": "RibbonPermission()",
      "selector": "0xc31d6ca7",
      "meaning_zh": "调用方没有相应的发券或转移权限"
    },
    {
      "signature": "RibbonBatchClosed()",
      "selector": "0xc2b0953f",
      "meaning_zh": "通知券已发完或本次名单为空"
    },
    {
      "signature": "RibbonWrongList()",
      "selector": "0xca5a4583",
      "meaning_zh": "名单哈希为空或与承诺不符"
    },
    {
      "signature": "RibbonReceiver()",
      "selector": "0xc968d1b6",
      "meaning_zh": "接收合约没有接受 ERC-721 转移"
    }
  ]
}
