> HISTORICAL DRAFT — This file predates the agent-only mint and fully on-chain art requirements. The NFT contract is not deployed, and owner controls remain undecided. Refer to the website status, not this file, for current launch status.

# Smart contracts

`contracts/src/AgentEggs.sol` is a non-upgradeable ERC-721 with Ownable2Step, reentrancy protection, and the Chainlink VRF v2.5 direct-funding wrapper. IDs start at 1. Every hatch changes the URI of the same token.

## Invariants and lifecycle
- 5,000 max supply; first 3,000 free, then fixed 0.0015 BNB, exact payment; 10 cumulative mints per wallet, batch max 10.
- Mint must be explicitly opened after configuration is locked. `mint` records block timestamp, then safe-mints the token. Mint quote may change as other users mint.
- After 24 hours, an owner or approved operator may call `requestHatch` for 1–10 sealed eggs, paying the current VRF wrapper fee. Excess is refunded. Requests mark eggs pending atomically; no retry or owner override exists.
- Only the immutable wrapper can supply randomness. The callback persists rarity and variant; odds are 70% Common, 20% Uncommon, 8% Rare, 2% Legendary. Independent draws do not guarantee final counts. Transfers are allowed in all states, and the current owner retains a pending egg and its result.
- `tokenURI` returns the sealed URI until fulfillment, then `revealed/<tier>/<variant>.json` under the immutable metadata root. Events make requests/results traceable.

## Privileges and dependencies
Before lock, owner can set cap and treasury; lock is irreversible. After lock owner can pause/resume new minting and transfer ownership. Treasury alone can withdraw contract balance. No owner mint, forced reveal, upgrade, metadata update or transfer freeze. Wrapper address, timer, price and metadata are fixed at deployment; Chainlink's external service remains a dependency. If VRF fulfillment fails or never arrives, there is **no recovery or retry mechanism** and eggs may remain pending indefinitely. Review this tradeoff before launch.
