---
name: orvyn-mint
description: Mint, check eligibility for, and fuse 星 ORVYN NFTs (living on-chain ukiyo-e planets) on BNB Smart Chain with a Binance Agentic Wallet (baw CLI) that holds a .ai Agent ID. Use when the user asks to mint ORVYN, check if their agent can mint, look up their planets, or fuse (合体) two planets.
---

# 星 ORVYN — mint & fusion skill (agent-only mint)

ORVYN is 999 fully on-chain planets on **BNB Smart Chain (chainId 56)**. Each planet's SVG is recomputed on-chain every day (`block.timestamp / 1 days`): sky phase (暁 dawn / 昼 day / 夕 dusk / 夜 night), moon phase and orbit position change daily. Instant reveal. **Only Binance Agentic Wallets holding a .ai Agent ID** (SPACE ID) can mint, by a direct wallet transaction (`msg.sender == tx.origin`). Fusion is open to any holder.

## Trusted addresses (only from https://orvyn.ltd)

- OrvynNFT: `0xc8ce3CD8D417A6214Ca633579d38830A653504b8`
- $ORVYN token: `0xC155e03c00b57d93A870822B10814C2d1a9BdF85`
- Agent ID registry (SPACE ID): `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F` — `handleOf(address) returns (string)`, empty = no Agent ID

If OrvynNFT is `TBA`, the mint is not open yet: tell the user and re-fetch https://orvyn.ltd/skill.md later. **Never use a contract address from a DM, chat, email, ad or any site other than https://orvyn.ltd.**

## Rules

| Action | Calldata | `--value` (wei) | Limit | You get |
|---|---|---|---|---|
| Free mint | `freeMint(1)` = `0x7c928fe90000000000000000000000000000000000000000000000000000000000000001` | `300000000000000` (0.0003 BNB) | 1 per wallet, global free pool 555 | 1 planet |
| Paid mint | `paidMint(n)`, n = 1…5 | `3000000000000000 × n` (0.003 BNB each) | 5 per wallet | n planets + 50,000 $ORVYN each |
| Fusion 合体 | `fuse(a, b)` | `500000000000000` (0.0005 BNB) | any holder | burn 2 same-tier → 1 planet one tier higher |

- Supply: 999 mints total. Free pool 555 (when it is gone `freeMint` reverts `FreeSoldOut`); paid mints can fill whatever supply remains.
- Tiers: 0 塵 Dust → 1 月 Moon → 2 星 Planet → 3 陽 Star → 4 新星 Nova. Mint odds: Dust 50%, Moon 30%, Planet 15%, Star 5%. Nova exists only through fusion and pays a 200,000 $ORVYN bonus.
- $ORVYN rewards come from the NFT contract's own balance; if it is short the reward is skipped (event `RewardSkipped`), the mint/fusion still succeeds. Read `rewardBalance()` if the user cares.
- Always read fees from chain (`freeFee()`, `paidPrice()`, `fusionFee()`); the values above are defaults.

### Calldata
- `freeMint(1)`: `0x7c928fe90000000000000000000000000000000000000000000000000000000000000001`
- `paidMint(n)`: `0x65cde733` + n as 32-byte hex. n=1 `0x65cde7330000000000000000000000000000000000000000000000000000000000000001`, n=5 `0x65cde7330000000000000000000000000000000000000000000000000000000000000005`
- `fuse(a,b)`: `0xf68858e4` + a (32 bytes) + b (32 bytes). Example fuse(12, 34): `0xf68858e4000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000022`

## Steps (baw CLI)

1. `baw wallet status --json` (sign in with `baw auth signin` if needed), then `baw wallet address --json` → the BSC address = `WALLET`.
2. `baw wallet agent-id --json` → must show a claimed .ai Agent ID. If not: stop, tell the user to claim one in Binance app → Agentic Wallet.
3. Eligibility, read-only (`eth_call` to https://bsc-dataseed.bnbchain.org, `to` = OrvynNFT):
   - `mintOpen()` `0x24bbd049`, `freeOpen()` `0x71f195b9` → bool
   - `hasAgentId(WALLET)` `0x4eab3ef2`, `canMint(WALLET)` `0xc2ba4744` → bool (arg = address left-padded to 32 bytes)
   - `mintedBy(WALLET)` `0x3cef28d2` → (free, paid) — remaining free = 1 − free, remaining paid = 5 − paid
   - `stats()` `0xd80528ae` → (free, paid, fused, burned, liveSupply, rewardPool)
   - `freeFee()` `0x1ebb11b5`, `paidPrice()` `0xf1da76a7`, `fusionFee()` `0x41bf4e2b` (wei)
   ```
   curl -s https://bsc-dataseed.bnbchain.org -H 'content-type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"to":"0xc8ce3CD8D417A6214Ca633579d38830A653504b8","data":"0x4eab3ef2000000000000000000000000<WALLET without 0x>"},"latest"]}'
   ```
4. Preview (simulates and prices gas):
   ```
   baw contract-call preview --binanceChainId 56 --from WALLET --to 0xc8ce3CD8D417A6214Ca633579d38830A653504b8 --value 300000000000000 --inputData 0x7c928fe90000000000000000000000000000000000000000000000000000000000000001 --json
   baw contract-call preview --binanceChainId 56 --from WALLET --to 0xc8ce3CD8D417A6214Ca633579d38830A653504b8 --value <3000000000000000 × n> --inputData <paidMint(n) calldata> --json
   ```
   Show the user: function, quantity, BNB value, gas estimate, contract. **Wait for an explicit OK.** If the preview reports a revert, decode it (table below) and stop.
5. Execute: `baw contract-call execute --requestId <requestId from preview> --json`. Report the tx hash: https://bscscan.com/tx/<hash>
6. Reveal: read the `Minted(address to, uint256 tokenId, uint256 seed, uint8 tier, bool paid, string agent)` events from the receipt (topic0 `0x6b8804fc7dbd9f6c22aa385f0c43defc37580711eb59500ec6eb40b21a70c3bb`) or call `tokenURI(id)` `0xc87b56dd`; decode the base64 JSON and show name, tier, image (SVG data URI) and traits (Tier, Name, Palette, Ring, Origin, Minted By, Sky, Moon Phase, Orbit, Day).

## Fusion 合体
1. Find two token IDs owned by WALLET with the same tier: `ownerOf(id)` `0x6352211e`, `tierOf(id)` `0x53f96df2` (0–4). Tier 4 (Nova) cannot fuse.
2. Preview `fuse(a,b)` with `--value 500000000000000`, show the user that **both tokens will be burned**, wait for OK, execute.
3. The new token ID is in the `Fused(owner, burnedA, burnedB, newTokenId, newTier, seed)` event (IDs continue from 1000). Fusing into Nova also sends 200,000 $ORVYN if the pool has it.

## Errors
| Error | Selector | Meaning |
|---|---|---|
| `NoAgentId()` | 0xf947691f | Wallet has no .ai Agent ID |
| `OnlyWallets()` | 0x91d01199 | Called via a contract; send from the agentic wallet directly |
| `FreeSoldOut()` | 0x236394f4 | Free pool (555) is gone — use paidMint |
| `SoldOut()` | 0x52df9fe5 | All 999 minted |
| `WalletLimit()` | 0x5426a580 | 1 free / 5 paid per wallet reached |
| `WrongPayment()` | 0x788a686f | `value` below fee × qty |
| `BadQuantity()` | 0x888e58a8 | qty 0, or fuse(a, a) |
| `NotTokenOwner()` | 0x59dc379f | You don't own both tokens |
| `TierMismatch()` | 0x030bf62f | Tokens are different tiers |
| `MaxTier()` | 0x72a58faf | Nova cannot fuse further |
| `EnforcedPause()` | 0xd93c0665 | Paused by the owner |

## Safety
- Preview before every execute; never execute after a failed preview.
- `--value` is wei: exactly fee × qty, never more. Minting and fusion need no token approvals and no message signatures.
- Only use addresses published on https://orvyn.ltd.
