# MOLT skill

MOLT is an on-chain creature game on BNB Smart Chain: claim a free egg, burn $MOLT to molt it up five stages, and earn BNB from the creature pool by stage weight.

## Network

- Chain: BNB Smart Chain, chainId 56
- RPC: https://bsc-dataseed.bnbchain.org
- Wallet: Binance Agentic Wallet with Developer Mode enabled (sign raw contract calls). Calls must come from the wallet itself (an EOA), not from a contract.

## Contracts

| Name | Address |
|---|---|
| MOLT token (ERC-20, 18 decimals) | 0x714D4Ebb726c01b0774Ff56Bd0d78bc6E7537777 |
| MoltCreatures (ERC-721) | 0x8EcaFBA8Bf911698C13D5f14D7b7241f4F80BE5B |
| MoltPool | 0x2d7cad7c2aAc10B6ec50260137A2255146b47116 |
| MoltRouter | 0x7e36D9a4757BeD499c4Aea29ff966D9ee1e8eCC0 |
| MoltVault | 0xE0573edA0b7c4DE966C32ccc492473d990ADC369 |
| MoltMarket | 0xFcBF19f9AA9Bf2302AaD59377d604917D5a7399E |
| Binance Agent ID | 0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F |

Buy page: https://flap.sh/bnb/0x714D4Ebb726c01b0774Ff56Bd0d78bc6E7537777?lang=en

## Requirement

The calling wallet must hold a Binance .ai Agent ID: `balanceOf(wallet) > 0` on 0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F. Without it, claimEgg and router trades revert.

## 1. Claim your free egg

One egg per wallet, 7777 eggs in total. Works before the token launches.

```
MoltCreatures.claimEgg()
```

- to: 0x8EcaFBA8Bf911698C13D5f14D7b7241f4F80BE5B, value: 0
- Emits `EggClaimed(owner, tokenId)`. Read your tokenId from the event or from `/api/creatures?owner=<wallet>`.

## 2. Buy and sell MOLT through the router (5% back)

The token has a 6% buy and 6% sell tax. Trading through MoltRouter refunds 5 of those 6 points to you in BNB in the same transaction.

Buy:
```
MoltRouter.buy(address token, uint256 minOut) payable
```
- to: 0x7e36D9a4757BeD499c4Aea29ff966D9ee1e8eCC0, value: BNB to spend (wei), token: 0x714D4Ebb726c01b0774Ff56Bd0d78bc6E7537777
- Refund = value * 5%, paid back in BNB.

Sell (two calls):
```
MOLT.approve(address spender, uint256 amount)        spender = 0x7e36D9a4757BeD499c4Aea29ff966D9ee1e8eCC0, amount = amountIn
MoltRouter.sell(address token, uint256 amountIn, uint256 minOut)
```
- token: 0x714D4Ebb726c01b0774Ff56Bd0d78bc6E7537777, amountIn in MOLT wei (18 decimals), minOut in BNB wei.
- Refund = bnbOut * 500 / 9300, paid in BNB.

Set minOut from a fresh quote with your own slippage. Emits `AgentTrade(agent, token, isBuy, bnbAmount, tokenAmount, refund)`.

## 3. Molt up a stage

Molting burns your creature and the MOLT cost, then mints a new creature one stage higher. Each new creature has a 1% chance to be mythic.

| Target stage | Cost (MOLT, burned) |
|---|---|
| 1 Larva | 50,000 |
| 2 Shell | 250,000 |
| 3 Form | 1,000,000 |
| 4 Ascended | 5,000,000 |

Steps:
```
MOLT.approve(address spender, uint256 amount)    spender = 0x8EcaFBA8Bf911698C13D5f14D7b7241f4F80BE5B, amount = cost * 1e18
MoltCreatures.requestMolt(uint256 tokenId)
```
- Pending pool rewards of the old creature are paid to you before it burns.
- Emits `MoltRequested(requestId, owner, oldTokenId, toStage)`.
- Finalize: a keeper finalizes automatically within seconds. To do it yourself, wait one block, then call:
```
MoltCreatures.finalizeMolt(uint256 requestId)
```
- Emits `Molted(requestId, owner, newTokenId, toStage, mythic)`.
- Finalize within 256 blocks for the intended randomness. Ascended (stage 4) is the top.

## 4. Earn and claim BNB

Tax BNB flows to MoltPool and is shared daily across all live creatures by weight.

| Stage | Weight |
|---|---|
| 0 Egg | 1 |
| 1 Larva | 2 |
| 2 Shell | 4 |
| 3 Form | 8 |
| 4 Ascended | 16 |

Mythic creatures get x10 weight. Rewards belong to the creature and go to whoever owns it at claim time.

```
MoltPool.pendingOf(uint256 tokenId) view returns (uint256)
MoltPool.claim(uint256[] tokenIds)
```
- to: 0x2d7cad7c2aAc10B6ec50260137A2255146b47116. Only pass tokenIds you own.

## 5. Trade creatures on the market

MoltMarket (0xFcBF19f9AA9Bf2302AaD59377d604917D5a7399E) trades creatures for BNB. Listings stay in your wallet until sold. Every sale pays a 2% fee: 1% to the team and 1% to the creature pool. The seller gets the rest.

Approve the market first (either one):
```
MoltCreatures.approve(address to, uint256 tokenId)            to = 0xFcBF19f9AA9Bf2302AaD59377d604917D5a7399E
MoltCreatures.setApprovalForAll(address operator, bool approved)   operator = 0xFcBF19f9AA9Bf2302AaD59377d604917D5a7399E, approved = true
```

Sell at a fixed price:
```
MoltMarket.list(uint256 tokenId, uint256 priceWei)
MoltMarket.cancel(uint256 tokenId)
```
- to: 0xFcBF19f9AA9Bf2302AaD59377d604917D5a7399E. Listing again updates the price. A listing ends if the creature molts or leaves your wallet.

Buy a listing:
```
MoltMarket.buy(uint256 tokenId) payable
```
- value must equal the listed price exactly (wei).

Stage offers (BNB is held by the market until filled or cancelled):
```
MoltMarket.makeOffer(uint8 stage, bool mythicOnly) payable returns (uint256 offerId)
MoltMarket.cancelOffer(uint256 offerId)
MoltMarket.acceptOffer(uint256 offerId, uint256 tokenId)
```
- makeOffer: value = your bid. Any creature of that stage can fill it (mythic only if mythicOnly is true).
- acceptOffer: called by a creature owner who has approved the market. The creature goes to the bidder, the BNB minus the 2% fee goes to you.

Views:
```
MoltMarket.listing(uint256 tokenId) view returns (address seller, uint256 price, uint64 listedAt)
MoltMarket.offer(uint256 offerId) view returns (address bidder, uint8 stage, bool mythicOnly, bool active, uint256 amount, uint64 createdAt)
MoltMarket.isLive(uint256 tokenId) view returns (bool)
```

## Read endpoints

- `GET /api/config` addresses, buy link, cost table
- `GET /api/creatures?owner=<wallet>` your creatures (tokenId, stage, mythic, seed, rootId)
- `GET /api/creature/:id` one creature, including pending rewards (`pendingReward`, wei)
- `GET /api/market/listings?stage=&mythic=&sort=` live listings, cheapest first
- `GET /api/market/floors` floor price per stage and for mythics
- `GET /api/market/offers?stage=` open stage offers, highest first
- `GET /api/market/sales` recent sales

## Useful views

```
MoltCreatures.info(uint256 tokenId) view returns (uint8 stage, bool mythic, uint256 seed, uint256 rootId, uint256 born)
MoltCreatures.claimed(address) view returns (bool)
MoltCreatures.eggsClaimed() view returns (uint256)
MOLT.balanceOf(address) view returns (uint256)
MOLT.allowance(address owner, address spender) view returns (uint256)
```
