# Noctivell — a capsule holder's transaction reference

## Establish the two endpoints

Chain 56 (BNB Smart Chain). NFT and paid opening share `0x8918082302CB4Cc675F47771535A00c0b1ed41C2`; Dust lives at `0x0319920b25aE6EA38D99A775B5Ebb2783B9650F2`. `REWARD()` equals the reward address and `reward.VAULT()` points back. Registry discovery is `AGENT_REGISTRY()`. Final sources name the contracts Noctivell / NoctivellToken, NFT Noctivell / NTVL, token Noctivell Dust / NTVLD. Opening reference `2026-11-21 09:59:36 (UTC+8)` is informational deployment time, not a delayed launch getter.

Source facts: no administrator, pause, upgrade or withdrawal path; `owner()` returns zero; `FEE_TARGET()` is immutable. Fees forward and unused payments return atomically. Normal calls retain no BNB. Reward `TOKEN_CEILING()` is fixed, `VAULT()` is its sole minter; NFT `MAX_SUPPLY()` is uint256 maximum. Confirm source at https://bscscan.com/address/0x8918082302CB4Cc675F47771535A00c0b1ed41C2#code and https://bscscan.com/address/0x0319920b25aE6EA38D99A775B5Ebb2783B9650F2#code before signing.

## Seal a day

Read `stampOpen()`, `WINDOW_END()`, `canStamp(holder)` (ok, reason, nextAt: 0 eligible, 1 closed, 2 no identity, 3 quota used), and `stampKeyOf(holder)`. One NFT per caller-owned Agent ID per UTC day while open. All free entries below have value 0 and gas limit 300000.

| Signature | Selector |
|---|---|
| `mint()` | `0x1249c58b` |
| `freeMint()` | `0x5b70ea9f` |
| `claim()` | `0x4e71d92d` |
| `mint(uint256)` | `0xa0712d68` |
| `publicMint()` | `0x26092b83` |
| `freeMint(uint256)` | `0x7c928fe9` |
| `mintFree()` | `0x8ab53447` |
| `claimFree()` | `0xf366afc9` |
| `agentMint()` | `0x1be3587a` |
| `mint(address)` | `0x6a627842` |
| `mint(address,uint256)` | `0x40c10f19` |
| `mint(uint256,address)` | `0x94bf804d` |
| `checkIn()` | `0x183ff085` |
| `mintFree(uint256)` | `0xa4146733` |

Every free alias consumes the same caller-owned Agent ID quota. A positive quantity still gives one NFT; zero quantity reverts, except `mintFree(uint256)` ignores its argument including zero. `mint(address)` and `mint(address,uint256)` deliver to that recipient. `mint(uint256,address)` ignores its second argument. Prefer value 0; attached BNB is returned atomically. Network gas is separate.


## Let midnight pass, then register the reveal

`slipOf(id)` gives (day, opened, amount). Read `today()`, `sealAt(id)` and `nextSealAt()`: maturity is the next UTC midnight, not a full 24 hours. A closed mint window does not expire old cards. Ownership, not the original stamper, controls opening.

Anyone may send `settleDay(uint256)` with that finished day and value 0, gas limit 300000. First call records current block +3; read `revealState(uint256)` for (state, revealBlock). At 0 register; at 1 wait strictly beyond revealBlock; at 2 save the seed with settleDay or open the card; 3 is stored; 4 is permanently Dust. `seedOf(day)` shows stored seeds. Stamping and completed opening nudge the two recent finished days. **No touch() entry exists**; use settleDay for explicit progress.

BLOCKHASH covers 256 blocks; the EIP-2935 archive extends readability to 8191 blocks (about one hour on BSC). If not saved in time, the whole day fixes to lowest tier Dust: `tierOf(id)=0`, `amountOfTier(0)`. No re-roll, no caller choice. Saved seeds remain fixed. The validator producing the reveal block can influence its hash; a caller cannot choose the result. Recheck an unsaved quote before execution in case it expires.

## Open a capsule, or an ordered batch

Paid target `0x8918082302CB4Cc675F47771535A00c0b1ed41C2`:

| Signature | Selector |
|---|---|
| `claim(uint256)` | `0x379607f5` |
| `claimMany(uint256[])` | `0x925489a8` |
| `claim(uint256[])` | `0x6ba4c138` |
| `claimReward(uint256[])` | `0xc94c7ff4` |

Let F = `claimFee()` wei. Quote `claimCost(n)` / `claimsFor(value)` / `MAX_BATCH()` at the same block as the other reads.

照付款金額成交。批次能開幾張就依付款處理前幾張，零頭及未使用費用同筆退回；連一份費用都不足則回退。單張最多開一張，多付款同筆退回；未登記期的單張只登記並全額退款。

For a batch, examined count n = min(floor(value/F), ids.length, live batch limit). Only the first n IDs are examined. For owned, mature, unopened, seed-ready cards with sufficient rewards:

| IDs | Sent | Opened | Refunded |
|---|---|---|---|
| five | 3F + 1 wei | 3 | 1 wei |
| five | 6F | 5 | F |
| five | 3F - 1 wei | 2 | F - 1 wei |
| two | 5F | 2 | 3F |
| one | F + 1 wei | 1 | 1 wei |
| one | 2F | 1 | F |
| one, seed ready | F - 1 wei | revert | value never charged |

A single call is explicitly limited to its one ID even with extra payment. A batch skips unregistered/waiting seeds and full rewards exceeding the remaining token supply; skipped cards cost zero. Unregistered periods are registered. Never replace a skipped ID with an unpaid trailing ID. Refund = value - F * actuallyOpened. Invalid ownership, an already opened ID, or an immature card in the examined prefix reverts the whole call; duplicates that would open twice also revert. Single pool-short calls revert. Base rewards are never clipped. Bare BNB transfers and unknown selectors revert; payee/refund failure reverts atomically.


Rewards are Noctivell Dust, not BNB. `tierOf` returns 255 while pending, then 0..3. Read `tierForRoll`, `amountOfTier`, `tierName`; quote `unsealAmount`, `claimable`, `poolBalance`. Opened amounts are historical. No batch combination bonus exists.

## Exact transaction examples

Read minted IDs from receipt events; the following IDs are examples, not existing NFTs. Replace IDs and all placeholders, ABI-encode with the published ABI, then simulate the exact from/to/data/value. Single opening calldata for ID 1 is `0x379607f50000000000000000000000000000000000000000000000000000000000000001`. Batch [1,2,3,4,5] calldata is:

```text
0x925489a80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000005
```

Free transaction template:
```json
{"from":"<Agent ID holder>","to":"0x8918082302CB4Cc675F47771535A00c0b1ed41C2","data":"0x1249c58b","value":"0x0","gas":"0x493e0"}
```

For a ready single ID send value F, or F+1 to verify a 1 wei refund; for the example batch send 3F+1 to inspect three IDs and refund 1 wei. Compute F in integer wei from the getter, never floating point. With an UNREGISTERED mature period, sending the single call with F succeeds, records a future reveal height, opens zero cards and returns ALL F. Gas is still paid. Check the new reveal height, wait strictly past it and repeat preview before paying to open. While already registered but waiting, single calls revert SeedPending; batches instead skip without fee.


## Final preflight

Use single gas limit 250000; batch 100000+60000*n, including skipped examined IDs. At a common block, verify bytecode, owner(), links, current holder, maturity, unused state, reveal status, fee and reward room. Perform eth_call with exact sender/target/data/value, then eth_estimateGas; stop if estimate exceeds the published gas limit. Show target, calldata, value, estimated reward and refund. After user approval recheck chain/account/targets/quote; send once, inspect status and events. Unknown receipts are not permission to resend. No token approval, typed data or message signature is part of this workflow.

## Compiled read interface

| Contract | Getter | Selector |
|---|---|---|
| Noctivell | `AGENT_REGISTRY()` | `0x5af586ca` |
| Noctivell | `FEE_TARGET()` | `0x8d9de870` |
| Noctivell | `MAX_BATCH()` | `0x950bff9f` |
| Noctivell | `MAX_SUPPLY()` | `0x32cb6b0c` |
| Noctivell | `REWARD()` | `0xcab34c08` |
| Noctivell | `TIER_PENDING()` | `0x6e962f93` |
| Noctivell | `WINDOW_END()` | `0x1f23c68a` |
| Noctivell | `amountOfTier(uint8)` | `0xbecb4024` |
| Noctivell | `balanceOf(address)` | `0x70a08231` |
| Noctivell | `canStamp(address)` | `0xb3f399fc` |
| Noctivell | `claimCost(uint256)` | `0x0a48a526` |
| Noctivell | `claimFee()` | `0x99d32fc4` |
| Noctivell | `claimable(uint256)` | `0xd1d58b25` |
| Noctivell | `claimsFor(uint256)` | `0x30a9ce55` |
| Noctivell | `getApproved(uint256)` | `0x081812fc` |
| Noctivell | `isApprovedForAll(address,address)` | `0xe985e9c5` |
| Noctivell | `name()` | `0x06fdde03` |
| Noctivell | `nextSealAt()` | `0xeefbc9d5` |
| Noctivell | `owner()` | `0x8da5cb5b` |
| Noctivell | `ownerOf(uint256)` | `0x6352211e` |
| Noctivell | `poolBalance()` | `0x96365d44` |
| Noctivell | `revealState(uint256)` | `0x8008e8bc` |
| Noctivell | `sealAt(uint256)` | `0x2bfc9949` |
| Noctivell | `seedOf(uint256)` | `0x82829f74` |
| Noctivell | `slipOf(uint256)` | `0x59f8ec1e` |
| Noctivell | `stampKeyOf(address)` | `0x359b29de` |
| Noctivell | `stampOpen()` | `0xf58676be` |
| Noctivell | `supportsInterface(bytes4)` | `0x01ffc9a7` |
| Noctivell | `symbol()` | `0x95d89b41` |
| Noctivell | `tierForRoll(uint256)` | `0xf206099b` |
| Noctivell | `tierName(uint8)` | `0xc1959a6b` |
| Noctivell | `tierOf(uint256)` | `0x53f96df2` |
| Noctivell | `today()` | `0xb74e452b` |
| Noctivell | `tokenURI(uint256)` | `0xc87b56dd` |
| Noctivell | `totalSupply()` | `0x18160ddd` |
| Noctivell | `unsealAmount(uint256)` | `0x6a83669a` |
| NoctivellToken | `TOKEN_CEILING()` | `0xf2392d86` |
| NoctivellToken | `VAULT()` | `0x411557d1` |
| NoctivellToken | `allowance(address,address)` | `0xdd62ed3e` |
| NoctivellToken | `balanceOf(address)` | `0x70a08231` |
| NoctivellToken | `decimals()` | `0x313ce567` |
| NoctivellToken | `name()` | `0x06fdde03` |
| NoctivellToken | `owner()` | `0x8da5cb5b` |
| NoctivellToken | `symbol()` | `0x95d89b41` |
| NoctivellToken | `totalSupply()` | `0x18160ddd` |

Explicit seed action: `settleDay(uint256)` at `0x8918082302CB4Cc675F47771535A00c0b1ed41C2`, selector `0x8093067c`, value 0, gas limit 300000.
