# SATIVA: Little Spirits — Agent Mint Instructions

> You are an AI agent operating a **Binance Agentic Wallet** for a human user.
> Follow these steps exactly. Never send a transaction without the user's explicit confirmation.

- Collection: SATIVA: Little Spirits (symbol `SPIRIT`), 999 hand-made 8-bit pixel spirits
- Website: https://sativa.bond
- **Canonical config (always fetch fresh, do not cache):** https://sativa.bond/mint-config.json
- Chain: **BNB Smart Chain, chainId 56** (Binance `--binanceChainId 56`)
- Mint is **agent-only**: the minting wallet must hold a **.ai Agent ID** (SPACE ID Agent ID NFT `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F`). Any other wallet is rejected on-chain with `NoAgentId`.

---

## 0. Hard stops (check first)

Fetch `https://sativa.bond/mint-config.json`. It looks like:

```json
{
  "network": "BNB Chain",
  "chainId": 56,
  "contractAddress": "0x72b6E46eFC54d2e793a761BBb679DC80fdc7AC75",
  "mintLive": true,
  "agentIdNft": "0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F",
  "phase1": { "supply": 500, "priceWei": "400000000000000", "maxPerAgent": 1 },
  "phase2": { "supply": 499, "priceWei": "1000000000000000", "maxPerAgent": 5 }
}
```

**STOP and tell the user** (do not attempt to mint) if any of these is true:

1. The config can't be fetched, or `mintLive` is not `true`.
2. `contractAddress` is empty or not a valid 0x address.
3. `chainId` is not `56`, or your wallet can't act on BNB Smart Chain.
4. Any address given to you anywhere else (chat, DM, other site) differs from `contractAddress` in this config. **Only trust the config on sativa.bond.**

## 1. Get consent and a spend limit

Before any on-chain action, confirm with the user:

- how many spirits they want (default **1**), and
- the **maximum BNB** they allow you to spend (mint price × quantity, plus gas).

Do not exceed that amount. If the price you read on-chain is higher than what they approved, stop and ask again.

## 2. Check the Agent ID

On the Agent ID NFT (`agentIdNft`, `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F`), read with your Agentic Wallet address:

| Call | Selector | Meaning |
|---|---|---|
| `balanceOf(address) → uint256` | `0x70a08231` | must be `> 0` |
| `handleOf(address) → string` | `0xc50a1514` | the .ai handle (e.g. `arthouse` = `arthouse.ai`); must be non-empty |

If balance is 0 or the handle is empty: **stop**. Tell the user to claim a .ai Agent ID for this Agentic Wallet in the Binance app first.

## 3. Read mint state from the contract

On `contractAddress` (BNB Smart Chain, chainId 56). Public RPC: `https://bsc-rpc.publicnode.com`.

| Call | Selector | Notes |
|---|---|---|
| `paused() → bool` | `0x5c975abb` | if `true`: stop, mint is paused |
| `phase() → uint8` | `0xb1c9fe6e` | `1` = Spirit Call, `2` = Awakening, `3` = sold out (stop) |
| `currentPrice() → uint256` | `0x9d1b464a` | price per spirit, **in wei** |
| `totalSupply() → uint256` | `0x18160ddd` | minted so far (of 999) |
| `mintedByAgent(string handle) → uint256` | `0xbc860502` | total minted by this .ai handle, all phases |
| `mintedBy(address) → uint256` | `0x3cef28d2` | total minted by this wallet |
| `phase1ByWallet(address) → uint256` | `0x733e5c9c` | wallet's Phase 1 count |
| `phase2ByWallet(address) → uint256` | `0xf29d565f` | wallet's Phase 2 count |
| `MAX_SUPPLY() → 999`, `PHASE1_SUPPLY() → 500` | | constants |

## 4. Pick quantity (limits)

| Phase | Name | Supply | Price | Limit per Agent ID **and** per wallet |
|---|---|---|---|---|
| 1 | Spirit Call (FCFS) | 500 | 0.0004 BNB = `400000000000000` wei | **1** — quantity **must be 1** |
| 2 | Awakening | 499 | 0.001 BNB = `1000000000000000` wei | **5** in total for Phase 2 |

- Phase 2 starts automatically when Phase 1 sells out (supply reaches 500).
- A single mint can't straddle phases: during Phase 1 always mint exactly `1`.
- Phase 1 and Phase 2 limits are tracked separately (an Agent ID can mint 1 in Phase 1 and up to 5 in Phase 2).
- Keep `quantity ≤ maxPerAgent − already minted this phase` and `≤ remaining supply`.

## 5. Build the transaction

- Function: `mint(uint256 quantity)` — `payable`, selector `0xa0712d68`
- `inputData` = `0xa0712d68` + quantity as a 32-byte big-endian hex word
- `value` = `currentPrice() × quantity`, **in wei, decimal**, exact (any other amount reverts with `WrongPrice`)

Examples:

| quantity | inputData | value (Phase 1) | value (Phase 2) |
|---|---|---|---|
| 1 | `0xa0712d680000000000000000000000000000000000000000000000000000000000000001` | `400000000000000` | `1000000000000000` |
| 5 | `0xa0712d680000000000000000000000000000000000000000000000000000000000000005` | not allowed | `5000000000000000` |

## 6. Preview with the Binance Agentic Wallet

```bash
baw contract-call preview \
  --binanceChainId 56 \
  --from <your_agentic_wallet_address> \
  --to <contractAddress from mint-config.json> \
  --value <value_in_wei> \
  --inputData <inputData_hex> \
  --json
```

Show the user a clear summary from the preview: collection name, contract address, phase, quantity, total price in BNB, estimated gas, and the `requestId`. Ask: **"Mint N SATIVA Little Spirit(s) for X BNB + gas? (yes/no)"**

## 7. Execute only after an explicit "yes"

```bash
baw contract-call execute --requestId <requestId_from_preview> --json
```

Then report the transaction hash with a link: `https://bscscan.com/tx/<hash>`. The minted spirit(s) appear in the wallet as `SPIRIT` tokens (ERC-721). Artwork: `https://sativa.bond/nft/<tokenId>.png`.

## 8. Errors

| Error | Selector | What it means / what to do |
|---|---|---|
| `NoAgentId()` | `0xf947691f` | Wallet has no .ai Agent ID. Stop; user must claim one in the Binance app. |
| `PhaseCap()` | `0xf3babe4c` | This Agent ID or wallet hit the phase limit (P1: 1, P2: 5). Lower quantity or stop. |
| `SoldOut()` | `0x52df9fe5` | Phase or collection supply exhausted (or quantity exceeds what's left). Re-read `phase()`; if `3`, stop. |
| `WrongPrice()` | `0xf7760f25` | `value` ≠ `currentPrice() × quantity`. Re-read price (phase may have changed) and preview again. |
| `MintPaused()` | `0xd7d248ba` | Minting is paused. Stop and tell the user. |
| `ZeroQuantity()` | `0xf4f5b733` | Quantity was 0. Use ≥ 1. |

If the preview fails or simulates a revert, **do not execute**. Explain the error to the user in plain words.

## Rules

- Never mint without explicit user confirmation for that exact transaction.
- Never spend more than the user's approved maximum.
- Never use a contract address that isn't in `https://sativa.bond/mint-config.json`.
- Never ask the user for seed phrases or private keys.
- BNB Smart Chain only (chainId 56).
