# TENSILE - mint instructions for AI agents

You are an AI agent. This file tells you exactly how to mint a TENSILE work.
Contract: 0xd166027429eFc09E2E08b673Fe5661B0b7A31673
Chain: Ink, chainId 57073
RPC: https://rpc-gel.inkonchain.com

## What you are minting
TENSILE is a price-elastic work: each token's multiplier, tier and artwork are derived
from a live US stock price, recomputed on every read. It is not a static image.
## Step 1 - what you owe
Call priceFor(address) and read the first 32 bytes as uint256.
  data = 0xf12a7add + <your address, left-padded to 32 bytes>
  eth_call to the contract -> the result is the wei you must send.
Send exactly that amount, no more and no less. Do not guess the price.
The first window covered 1,000 works at no cost and is closed. The second window was
admitted by registration, and it is closed too. The run is 2,000 works, all at no cost.
Every mint needs a permit from a window the owner opens, so nothing can be issued outside it,
and the next window is announced on the site before it opens. priceFor
stays the source of truth, so read it at issue time instead of assuming.

## Step 2 - choose a reference
tickerId indexes the reference stock:
  0 = AAPL   1 = NVDA   2 = TSLA   3 = SPY   4 = QQQ   5 = META
To read the live figure for a reference, call getPrice on the oracle
  0xFaA1066e6D169F3261825Af1eaA51Ba83E1eABdb
  data = 0x31d98b3f + keccak256(ticker name), e.g. keccak256("AAPL")
  result word 0 = price with 8 decimals (34455000000 == $344.55)
## Step 3 - mint
Send a transaction to the contract:
  to    = 0xd166027429eFc09E2E08b673Fe5661B0b7A31673
  data  = 0x23cf0a22 + <tickerId, left-padded to 32 bytes>     # mint(uint16)
  value = the wei from Step 1
  gas   = 300000 (a mint costs ~210000)
If priceFor returns 0 you pay nothing. The no-cost window is closed, all 1,000 works
of it were issued, so each work now costs 0.001 ETH as read from priceFor.
Ink is cheap: gas price is about 0.001 gwei. If you set maxFeePerGas yourself,
keep it under 3000000 wei - a "normal" 2 gwei value makes the node require a huge
upfront balance and the transaction fails as if you had insufficient funds.

## Step 4 - verify, do not assume
  totalMinted()            0xa2309ff8              -> uint256 count
  symbolOf(uint256 id)     0x75cfbe6c + id         -> ticker string
  tierOf(uint256 id)       0x53f96df2 + id         -> tier string
  multiplierOf(uint256 id) 0x719ec1d7 + id         -> bps (10000 == 1.00x)
Tiers: APEX >= 3.00x | SURGE >= 1.50x | RISE > 1.05x | HOLD within 5% | DIP >= 0.50x | REKT < 0.50x
## Rules
- Supply is 2000, all issued at no cost. Every mint needs a permit, so the run cannot be extended without the owner opening a window.
- The first 1000 works were issued without cost, three to a single address. That
  window is closed, so every work now costs 0.001 ETH, read from priceFor.
- At most one work per address carries no cost, and that is capped in the contract.
  If a further no-cost window opens, it is admitted by registration: while it lasts
  the permit path is the only way in and the plain mint call is closed.
- Royalty is 5%. Payment stays in the contract and is withdrawn by the studio.
- Never send funds anywhere other than the contract address above.

## After minting
The token re-grades itself whenever the reference moves. Nothing needs to be called:
tierOf / multiplierOf / tokenURI are computed live from the oracle. If the stock rises
60% the work becomes SURGE on its own - you do not re-mint.

## Failure modes you should handle
- A read may return one state behind a write you just sent. Poll again; do not conclude
  the mint failed from a single stale read.
- If priceFor() returns an amount you cannot afford, stop and report it. Do not send less.

## Reference hashes (keccak256 of the ticker, for the oracle call)
AAPL 0x3a54a9a690616fbc26cfc409bf11f89d51f1d57a4ab2791fb86026cee74ed2f3
NVDA 0xe108948b9667048232851f26a1427d3a908b22da622562906ca50ea536c2ecfb
TSLA 0x0a8f1f385fed9c77a2e0daa363ccc865e971bdbe4458bb570cc0acb068d7c0f2
SPY 0xcea23e8f56b5ac447ac08d57e0808e35f468a65f29bb659b3d48934481e7c67a
QQQ 0x3192e549b876a689e8727f4a2e0d4fa13b8456aa0a01f6008ad18fd992e3b532
META 0x0057355892fab25ddc63a7482ec1696d6ada670339b1ae464da8f6b958ddbee8

## Holder income (royalty share)

Secondary-sale royalties are paid to the contract itself, which splits every
incoming payment: 50% goes to the project, 50% accrues to holders.

A holder's share is weighted by tier, so a stronger work earns more:

| tier | weight |
|------|--------|
| APEX | 13 |
| SURGE | 8 |
| RISE | 5 |
| HOLD | 3 |
| DIP | 2 |
| REKT | 1 |

### How a holder claims

1. `claimableOf(uint256 id)` - read what is owed.
   data = 0x513bed12 + <id, left-padded to 32 bytes> -> wei accrued and not yet drawn.
2. `claim(uint256[] ids)` - send from the address that owns the tokens;
   the contract pays the accrued amount to the caller.
   data = 0x6ba4c138 + <offset 0x20> + <count> + <each id, 32 bytes>

Weights are refreshed by the protocol keeper, so they track the live tier. Any
address may refresh them, it is permissionless:
   sync(uint256[] ids)            data = 0x4b7314e4 + <offset 0x20> + <count> + ids
   syncRange(uint256 from, uint256 count)  data = 0xff65d028 + <from> + <count>

