---
name: hongbao
description: |
  Use when the user wants to take part in HONGBAO · 红包 on BNB Chain: open the free red packet (1 share, gas only, one
  per agent), buy paid shares (0.001 BNB each, 1–10 per agent) in the 48-hour mint (HONGBAO lands in the wallet at
  once), launch the PancakeSwap pool after 48 h, or trade it. Only AI agents with a .ai Agent ID can mint.
  Triggers: hongbao, 红包, red packet, free share, HONGBAO mint.
metadata:
  version: '0.2.0'
  requires:
    bins: [baw, curl]
  install:
    - kind: node
      package: '@binance/agentic-wallet'
      bins: [baw]
      label: Binance Agentic Wallet CLI
---

# HONGBAO · 红包 skill

HONGBAO is a BEP-20 token on BNB Chain with a **48-hour mint for AI agents** (Binance Agentic Wallets holding a
**.ai Agent ID**). Half of the mint is **free**.

| | |
|---|---|
| Shares | **20,000** × **10,000 HONGBAO**: **10,000 free** + **10,000 paid** |
| Free | **1 red packet per agent**, gas only, optional, while packets last |
| Paid | **0.001 BNB** a share, **1–10 per agent** (so at most 1 free + 10 paid) |
| Launch | when both pools are empty, or after 48 h if **at least one paid share** sold. No soft cap, **no refunds** |
| Pool | 80% of the BNB + HONGBAO **at the mint price** → PancakeSwap, **LP tokens burned**; 20% → treasury |
| Delivery | **instant**: 10,000 HONGBAO per share is minted to the wallet in the same transaction. Nothing to claim |
| Transfers | **locked until launch** fills the pool (mints and burns only), then HONGBAO is a plain token |
| Tax | **none**: HONGBAO is a plain token |

Unopened free packets and unsold paid shares are never minted. If the 48 hours end with **no paid share sold**, there is
no pool and HONGBAO stays non-transferable.

## Contracts (BNB Chain, chain id 56)

| | Address |
|---|---|
| HongbaoMint | `0xfd7CA0EEa704F9aC609C51d945A9C00A368186F8` |
| HONGBAO token | `0x44e9AeC5b828092A9eBC3070caCcd556BB21C725` |

No extra CLI is needed. You read the chain with a plain JSON-RPC `eth_call`, and every transaction is previewed and
signed by the user's Binance Agentic Wallet through `baw`. **Never ask the user for a private key or seed phrase.**

Rules for you, the agent:
- Only act when the user asks. Never open, buy or sell on your own initiative, and don't schedule recurring runs.
- **Every** `requestId` needs the user's explicit "yes" before `baw contract-call execute`. Tell them what it does
  and the exact BNB amount.
- HONGBAO is a speculative token. Never promise profit, a price or a return. "Free" means the share costs no BNB, not
  that it has any value; there are no refunds on paid shares.
- Mention that the contracts are unaudited.

## 0. Preflight
```bash
npm i -g @binance/agentic-wallet
baw auth signin
baw wallet status --json
baw wallet address --json        # use the address with binanceChainId 56 as $ME
```
The wallet needs a **.ai Agent ID** (claim one in Binance Wallet) and a little BNB for gas (+ paid shares).

## 1. Reading the chain
```bash
RPC=https://bsc-rpc.publicnode.com
call() { curl -s $RPC -H 'content-type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_call\",\"params\":[{\"to\":\"$1\",\"data\":\"$2\"},\"latest\"]}"; }
MINT=0xfd7CA0EEa704F9aC609C51d945A9C00A368186F8
```
| Read | data | Returns (32-byte words, in order) |
|---|---|---|
| `state()` | `0xc19d93fb` | phase (0 not started · 1 minting · 2 ready to launch · 3 launched · 4 ended, no paid share sold), startAt, endAt, freeClaimed, sold, raised, agents, buyers, launchedAt, pair, token |
| `quote(n)` | `0xed1bd76c` + n as a 32-byte word | exact cost in wei for n paid shares |
| `agentInfo(addr)` | `0x62c885ee` + address left-padded to 32 bytes | isAgent, handle, free (opened?), shares, spent, room, delivered HONGBAO, 0, 0 |

Tell the user the phase, free packets left (10,000 − freeClaimed), paid shares left (10,000 − sold) and time left
before acting.

## 2. The mint (phase 1, 48 hours)
Open the free red packet (1 share = 10,000 HONGBAO to the wallet now, gas only, once per agent):
```bash
baw contract-call preview --binanceChainId 56 --from $ME --to $MINT --value 0 --inputData 0xf366afc9 --json
```
Buy paid shares: data = `0xd96a094a` + n (1–10) as a 32-byte word, value = `quote(n)` = n × 0.001 BNB:
```bash
# 3 shares = 0.003 BNB → 30,000 HONGBAO in the wallet right away
baw contract-call preview --binanceChainId 56 --from $ME --to $MINT --value 3000000000000000 \
  --inputData 0xd96a094a0000000000000000000000000000000000000000000000000000000000000003 --json
```
Each preview returns a `requestId`. Ask the user; only after a clear yes:
`baw contract-call execute --requestId <id> --json`. The two are independent: an agent can open the free packet, buy,
both, or neither. Overpayment is refunded automatically.

## 3. Launch (after 48 hours)
- phase **2** (ready to launch): anyone can send `launch()`: `baw contract-call preview ... --to $MINT --value 0
  --inputData 0x01339c21` (≈ 2,800,000 gas), then `execute` after the user's yes. It fills the PancakeSwap pool
  (LP burned) and opens HONGBAO transfers.
- phase **3** (launched): nothing to claim, the HONGBAO is already in the wallet and now tradable.
- phase **4**: no pool; HONGBAO stays non-transferable.

Before launch, a transfer or sell of HONGBAO reverts with `TradingNotOpen`: tell the user to wait for the pool.

## 4. Trading (after launch)
HONGBAO trades on PancakeSwap V2 (router `0x10ED43C718714eb63d5aA57B78B54704E256024E`) with no tax. Use the user's
usual swap flow in Binance Wallet.

## 5. Notes
Requests expire in about 5 minutes. If the Binance App asks for a confirmation, follow baw's `next` hint. Website:
https://hongbao.trade
