---
name: yellowslot
description: List, verify, enter, claim, and create Binance Agent ID-gated raffles and FCFS spot drops on YellowSlot (BNB Chain) with explicit user confirmation.
---

# YellowSlot Agent Skill

YellowSlot runs free future-blockhash raffles and first-come spot drops on BNB Chain for Binance Agent ID holders.
YellowSlot is an independent project and is not affiliated with or endorsed by Binance.

## Active deployment (BSC Mainnet)
- Chain ID: 56 (BNB Smart Chain)
- YellowSlot contract: `0xD0196DaA5c4Bc2FcA8c3aCF3F72d0B509567f6af`
- Agent ID registry: `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F` (BSC mainnet official SPACE ID Agent ID: `0x60b9262456de011f7d15a54cdd8c48baaa8b022f`)
- Owner permissions & safety: https://yellowslot.pages.dev/about
- baw CLI runnable on this deployment: yes (BSC mainnet chain 56)

## 1. List live drops
```
GET https://yellowslot.pages.dev/api/drops
GET https://yellowslot.pages.dev/api/drops?status=open&limit=100
GET https://yellowslot.pages.dev/api/drops?status=notended&limit=100
GET https://yellowslot.pages.dev/api/drops?status=ended&limit=100
GET https://yellowslot.pages.dev/api/drops?status=all&limit=100&cursor=<nextCursor>
```
Returns open, actionable drops by default (`status=open`, with `termsHash`, `termsUrl`, `calldata`, `valueWei`, and `bawPreview` / `tx`). Supports `status=open|notended|ended|all`, `limit` (default `100`, max `200`), and `cursor` pagination sorted newest-created first (`id` descending, `raffle` before `slot` on ties): `open` returns only actionable drops accepting entries/claims, `notended` returns all non-ended drops (including temporarily paused drops and unexpired, unsold slots with unavailable tokens or prices), `ended` returns ended/closed/full/sold-out drops, and `all` returns every drop. Each response includes `nextCursor` (pass as `?cursor=` for the next page, or `null` when exhausted) and `truncated` (`true` when more drops remain). Use `?status=all` for keeper discovery (entry calldata is omitted when entry is unavailable). All views are pinned to the reported `blockNumber`.

## 2. Read & verify drop terms
Fetch `GET https://yellowslot.pages.dev/terms/<termsHash>.json`, compute `keccak256` of the exact response bytes, and confirm:
1. `keccak256(bytes) === onChain.termsHash`
2. Every field (`chainId`, `endTime`, `prizeAmount`/`price`, `maxEntrants`/`maxSlots`, token) matches the on-chain drop.
For paid spot drops, do not submit a claim unless rules verification succeeds.

## 3. Check Agent ID eligibility
Call `balanceOf(<AGENT_WALLET>)` on `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F`:
- Eligible iff `balanceOf(wallet) > 0`.
- Creators must also hold an Agent ID (`balanceOf(creator) > 0`) to call `createRaffle` or `createSlotDrop`.
- Deduplication key is `bytes32(uint256(uint160(wallet)))` (one entry/claim per Agent ID wallet).
- Check `hasEnteredRaffle(id, key)` or `hasClaimedSlot(id, key)` before previewing or sending.

## 4. Enter a raffle or claim a spot (two-step preview -> confirm -> execute)
For paid ERC-20 spot drops, first check allowance and run an **exact-amount** `approve(YellowSlot, priceWei)` (never unlimited) with its own preview and user confirmation, and wait for on-chain confirmation before `claimSlot`.

1. Preview:
```bash
baw contract-call preview \
  --binanceChainId 56 \
  --from <AGENT_WALLET> \
  --to 0xD0196DaA5c4Bc2FcA8c3aCF3F72d0B509567f6af \
  --value <WEI_DECIMAL> \
  --inputData <CALLDATA> \
  --json
```
2. **SHOW** `parsedTx`, `simulationResult`, value, gas estimate, and risks to the user and **WAIT** for explicit confirmation.
3. Only after the user explicitly confirms, execute:
```bash
baw contract-call execute --requestId <REQUEST_ID> --json
```

## 5. Create a drop (publish terms first, then preview -> confirm -> execute)
1. Publish canonical `ys-terms/1` JSON (<= 4 KiB) via `POST https://yellowslot.pages.dev/api/terms`:
   - For raffles, include `"drawBounty"` (wei decimal string, min 0.0005 BNB = `500000000000000`, max 0.05 BNB) and `"winnerMethod": "future-blockhash-v1"`.
   - Returns `{ "termsHash": "0x...", "url": "https://yellowslot.pages.dev/terms/0x....json" }`.
   - Verify `keccak256(canonicalBytes) === termsHash`. Never create a drop before terms are published and verified.
2. Build calldata for `createRaffle(prizeToken, prizeAmount, endTime, maxEntrants, termsHash, drawBounty)` or `createSlotDrop(payToken, price, maxSlots, endTime, termsHash)`:
   - Native BNB raffle: `--value` = `prizeAmount + drawBounty` (no draw deposit).
   - ERC-20 raffle (configured USDT only, 18 decimals): first preview/confirm/execute an exact-amount `approve(YellowSlot, prizeAmount)`, then `createRaffle` with `--value` = `drawBounty`.
   - Spot drop: `--value 0`.
3. Preview with `baw contract-call preview ...`, show the user the prize, draw bounty, gas, and risks, wait for explicit confirmation, then run `baw contract-call execute --requestId <REQUEST_ID> --json`.

## 6. Permissionless draw lifecycle (commit -> draw -> void) & keeper
Raffles use a free future-blockhash draw (no oracle fee or deposit; `prevrandao` is not used). Anyone — or the YellowSlot keeper — can trigger each step in priority order `draw > refundEmpty > closeAndCommit > voidRaffle`:
- `draw(id)` when `canDraw(id) == true` (`block.number > targetBlock + 5`, i.e. from `targetBlock + 6`, and `<= revealDeadlineBlock(id)`, `7,800` blocks / ~58.5 min via EIP-2935 block history, or `250` blocks without history): derives `seed = keccak256(abi.encode(h0, h1, h2, id, entrantCount, contract, chainId))`, settles the prize to the winner, and pays mandatory `drawBounty` (0.0005–0.05 BNB) to `msg.sender` in the same transaction (with pull-credit fallback).
- `refundEmpty(id)` when `canRefundEmpty(id) == true` (`endTime` passed with 0 entrants): returns prize + bounty to the creator.
- `closeAndCommit(id)` when `canCommit(id) == true` (ended or full with >= 1 entrant): freezes entrants and sets `targetBlock = block.number + 20` (~9s on BSC).
- `voidRaffle(id)` when `canVoid(id) == true` (committed raffle whose reveal window expired): permanently cancels the raffle (no re-roll ever) and returns prize + bounty to the creator. Raffles with entrants cannot be voided while uncommitted.

## 7. Verify raffle fairness
```
GET https://yellowslot.pages.dev/api/proof/<raffleId>
```
Returns `status` (`pending`, `partial`, `verified`, or `mismatch`), pinned `blockNumber`, `targetBlock`, the 3 committed `blocks` (`number` + `hash`), `entrantCount`, ordered `entrantKeys` (no display names), stored and recomputed `seed`, `winnerIndex`, and `winnerKey`. Raffles with > 2000 entrants return `413` with `chainId`, `contract`, `targetBlock`, `deployBlock`, and log-recomputation instructions.

## Safety rules (mandatory)
- **Never** ask the user for seed phrases, private keys, API secrets, or pairing codes.
- **Never** skip the preview or send a transaction without explicit user confirmation.
- **Never** submit unlimited ERC-20 approvals; approve the exact required amount only.
- **Never** promise profits or payouts. Entering costs a small gas fee and winning isn't guaranteed.
- If `baw` returns error `351803` (risk control), stop and do not retry.
