---
name: pandafree
description: "Get a free Panda Head Club head on BNB Chain. Use when an agent is asked to claim the free mint or to register a wallet for the free list."
version: 1.0.0
license: MIT
---

# Panda Head Club, free claim skill

The paid mint is a separate skill. This one is only about the hundred free heads.

- **Chain** BNB Smart Chain, chainId 56
- **RPC** `https://bsc-dataseed.binance.org`
- **NFT contract** `0x1DD09f964b1bc8476ef200b29558EFBd586eb705`
- **Free list API** `https://pandaheadclub.site/api/slot`
- **Proof endpoint** `POST https://pandaheadclub.site/api/proof`
- **Registration page** `https://pandaheadclub.site/register`

## Step 0, always ask the site first

A person may have registered on the website already. Registration is one record, so
never register again, just look it up:

```bash
curl -s "https://pandaheadclub.site/api/status?address=0xWALLET&agentId=name.ai"
```

- `registered: true` means the wallet or the agent id is already on the list. Skip
  straight to the proof step, do not register twice.
- `walletBound: false` means a place is held but no wallet is attached yet, so bind
  one with `POST /api/slot` before claiming, the contract only knows addresses.
- `proofReady: true` means the list is on chain and the proof can be fetched.
- `left` is how many of the hundred places remain.

## Step 1, check the queue

```bash
curl -s https://pandaheadclub.site/api/slot
```

The answer carries `count`, `cap` and `left`. One hundred slots exist. When `left`
is zero the list is closed for good.

## Step 2, if the user gives an Agent ID instead of an address

A Binance Agent ID looks like `name.ai` (`heyi.ai`, `cz4.ai`). Our site cannot read
that name, the mapping lives on Binance. Resolve it locally first, then register the
address that comes back:

```bash
baw wallet resolve-domain --name heyi.ai --binanceChainId 56 --json
```

Read `data.address` from the answer. Never guess or invent an address if the
resolve fails, stop and tell the user. Then register that address below, with the
name as `agentId`.

## Step 2b, register the wallet

```bash
curl -s -X POST https://pandaheadclub.site/api/slot \
  -H 'content-type: application/json' \
  -d '{"agentId":"name.ai","address":"0xWALLET"}'
```

An agent id on its own is enough to hold a place:
`{"agentId":"name.ai"}`. The wallet can be bound in a second call, which is the
only way the head can ever be claimed, because the contract checks addresses.

Read `ok` and `position`. `already: true` means the wallet is on the list and
nothing else is needed. Registering does not cost anything and does not touch the
chain, it only reserves a place.

A human registering by hand uses `https://pandaheadclub.site/register`, which does
the same three steps: follow `@pandaheadclub`, reply and repost the pinned post,
then submit the address.

## Step 3, wait for the root to be published

The owner sets a merkle root on chain once the list closes. Until that happens
`mintFree` reverts for every wallet, so never tell a user they already hold a free
head. Check whether the root is live:

```bash
cast call 0x1DD09f964b1bc8476ef200b29558EFBd586eb705 "merkleRoot()(bytes32)" \
  --rpc-url https://bsc-dataseed.binance.org
```

`0x0000...0000` means the free route is still closed.

## Step 4, claim

Only the owner of a registered wallet can claim, and only once per wallet. The
proof is looked up by address in the published proofs file.

```bash
# the proof is issued per wallet, it is never published as a list
curl -s -X POST https://pandaheadclub.site/api/proof \
  -H 'content-type: application/json' \
  -d '{"address":"0xWALLET"}'

cast send 0x1DD09f964b1bc8476ef200b29558EFBd586eb705 "mintFree(bytes32[])" \
  "[0xPROOF1,0xPROOF2]" --rpc-url https://bsc-dataseed.binance.org --private-key $PK
```

`ready: false` means the list has not been written on chain yet. Stop there and
tell the user, do not retry in a loop.

Confirm with `freeClaimed(address)` and `totalSupply()`. Gas is paid by the
claiming wallet, the head itself costs nothing.

## Rules

- Never ask for a private key in chat.
- One free head per wallet, enforced by the contract. The free route and the paid
  route are counted separately, so a wallet that bought three can still claim one free.
- Do not promise a free head before the merkle root is set. Registration alone
  gives a place, not a token.
- Report the transaction hash and the block, or the revert reason if it fails.
  `NotEligible` means the wallet is not on the list, `AlreadyClaimed` means it
  already took its free head.
