# EnigmaAgent — Agent Mint Prompt

Copy-paste prompt for an AI agent with a BSC wallet tool. The mint is FREE
(gas only), one per wallet, gated by Agent ID, and guarded by a proof-of-work
puzzle that the contract verifies on-chain.

---

You are going to mint one EnigmaAgent NFT (free mint, BSC) for my wallet.
Follow these steps exactly and verify each one on-chain before moving on.

**Contracts**
- NFT: `0x213A879D11a85b54483CEA2cdEC5D9026958Add3`
- Agent ID registry: `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F`
- Chain: BNB Smart Chain, chainId 56

**Step 1 — Preconditions (read-only calls)**
1. Registry `balanceOf(myAddress)` (selector `0x70a08231`) must be > 0.
   If it is 0, STOP and tell me — this mint is Agent ID-gated.
2. NFT `hasMinted(myAddress)` (selector `0x38e21cce`) must be false.
   If it is true, STOP — one mint per wallet, mine is used.
3. NFT `publicMinted()` (selector `0xa4f4f8af`) must be < 3338.
   If it equals 3338, STOP — sold out.

**Step 2 — Read the current difficulty**
Call NFT `difficultyBits()` (selector `0x249379ad`). It returns 24, 27, 30 or
33 depending on how much of the supply is already minted. The difficulty can
rise between mining and submission only at phase boundaries; if your mint
reverts with "puzzle not solved", re-read `difficultyBits()` and mine again.

**Step 3 — Mine a nonce**
Find a uint256 `nonce` such that:

```
keccak256(abi.encodePacked(myAddress, nonce))
```

has at least `difficultyBits()` leading zero bits. The address is the raw
20-byte address (not hex text), the nonce is a 32-byte big-endian uint256 —
exactly Solidity's `abi.encodePacked(address, uint256)`. The proof is bound
to my address: a nonce solved for another wallet will revert.

Expected work is 2^bits hashes (≈16.7M at 24 bits). Any Keccak-256 miner
works; a reference implementation is at
https://enigmaagent-site.pages.dev/miner.js (Node.js / ethers:
`node miner.js <myAddress>` — it reads the live difficulty itself).

**Step 4 — Mint**
Preview, then execute a contract call:
- to: `0x213A879D11a85b54483CEA2cdEC5D9026958Add3`
- function: `mint(uint256)` — selector `0xa0712d68`, argument = your nonce
- value: 0 (the mint is free; if a preview shows any value > 0, STOP)
- I must approve the transaction preview before you execute it.

**Step 5 — Verify**
From the transaction receipt, read the `PuzzleMinted(minter, tokenId, nonce)`
event — that tokenId is my tablet. Confirm `ownerOf(tokenId)` is my address
and `hasMinted(myAddress)` is now true, then report the tokenId to me.

Notes: token IDs follow mint order and skip a fixed set of pre-minted
numbers, so your tokenId is whatever the event says — do not guess it.
Metadata and art for every token: https://enigmaagent.pages.dev/<tokenId>.json
