// SPDX-License-Identifier: MIT pragma solidity 0.8.36; string constant TEXT = "aibtc@R1\n\n01 [PARAMETERS] Fixed parameters.\nThe canonical line is aibtc@R1:0x<40 lowercase hex address>:T:C. It is one ASCII line without whitespace, a newline or leading zeroes in integers. Field order is fixed; unknown, missing or duplicate fields are invalid. The address identifies the selected immutable reference contract.\nT is 0 or a multiple of 10 from 10 through 500, shared by BUY and SELL. 10000 bps is 100%; T10=0.1%, T100=1%. C0 sends the entire asset rule fee to buyback-and-lock; C10000 assigns it to the creator. T0 has only C0. Entire means the rule fee, not the platform fee. Asset parameters cannot change after creation.\nisValidRule(T,C) returns whether this combination is valid: T<=500 and T%10=0; C is 0 or 10000; T=0 requires C=0. Invalid combinations return false. This interface neither reads nor registers assets.\n\n02 [PURE_MATH] Fees and graduation.\nAmounts are integer satoshis. ceilBps(a,b) accepts nonnegative amount a and basis points 0<=b<=10000, returning ceil(a*b/10000). With q=a div 10000 and r=a mod 10000, compute q*b+(r*b div 10000)+(r*b mod 10000 != 0 ? 1 : 0), without floating point or an overflowing intermediate a*b. Out-of-range b reverts.\neffectiveTax = graduated at trade start ? T : 0.\ntotalFee = ceilBps(base,50+effectiveTax).\nplatformFee = ceilBps(base,50).\nruleFee = totalFee-platformFee.\nRound the total fee up once, determine the platform fee first, and allocate the difference to the rule fee; never sum two separately rounded charges. Before graduation only the 0.5% platform fee applies. The graduation-triggering trade still uses the pre-graduation rule; the next ordinary trade activates the rule fee.\n\n03 [PURE_MATH] quoteUserBuy(requestedTotal,executedTotal,T,postAtTradeStart).\nInputs are requested total, executed total, rule tax and whether graduation preceded trade start. Require requestedTotal>=1000, 0=1000 sats and valid T. Use base=G and section 02 to return platformFee, ruleFee, totalFee and net=G-totalFee. Invalid inputs revert; net>=1000 is not required. This function neither computes AMM prices nor executes a sale.\n\n05 [PURE_MATH] Example vectors.\nAfter graduation at T10, base / platformFee / ruleFee / totalFee / AMM principal or SELL net are:\n1000 / 5 / 1 / 6 / 994\n1001 / 6 / 1 / 7 / 994\n1200 / 6 / 2 / 8 / 1192\n1201 / 7 / 1 / 8 / 1193\nAt base=1000, T0 gives 5 / 0 / 5 / 995.\nAt base=1000, T500 gives 5 / 0 / 5 / 995 before graduation and 5 / 50 / 55 / 945 after graduation.\nAcross these rounding boundaries, increasing base does not reduce user output; the rule fee can decrease by one satoshi.\n\n06 [PURE_MATH] routeRuleFee(ruleFee,C).\nInputs are a nonnegative rule fee and destination C. C10000 returns creatorAmount=ruleFee and buybackAmount=0; C0 returns creatorAmount=0 and buybackAmount=ruleFee; other C values revert. It only computes destination amounts, transferring no funds and allocating no accounts. A zero rule fee returns two zeroes.\n\n07 [BUYBACK] planBuyback(V,N) and lock meaning.\nInputs are executor-supplied available buyback balance V and current event sequence N. Outputs are shouldExecute, spend, nextSequence, platformFee and ruleFee.\nV<1000 returns (false,0,0,0,0); V>=1000 returns (true,V,N+1,0,0). Revert for N+1 overflow only when that result is required. A balance of 50000 specifies one full 50000-sat buyback, not split purchases, exempt from platform fee, rule fee and the ordinary-user minimum. Purchased quantity follows the asset's normal AMM BUY mathematics and is not calculated here.\nBuyback-and-lock means acquired AIBRC is permanently inbound only, with no sale, transfer out, withdrawal or administrator release. Total supply is unchanged; this is not burning.\nThe function only returns a plan. It neither verifies balances, allocates event slots, schedules or executes trades, nor locks assets. Its result proves no executed buyback and grants no caller a tax exemption.\n\n08 [RESERVED_DIRECTORY] Reserved directory.\nAll fifteen entries are RESERVED_DOCUMENTATION_ONLY: X402 (x402 payments); AGENT (AI Agent); LLM (language-model integration); DAO (governance); STOCK (stocks/RWA); EXTERNAL_RECEIPT (external receipts); EXTERNAL_WALLET_CLAIM (external wallet claims); CERTIFIED_EXTERNAL_CONTRACT (certified external contracts); DIVIDEND (dividends); AUTO_LP (automatic liquidity); AIRDROP (airdrops); MISSION (mission vault); ORBIT (satellite tokens); BRIDGE (bridges); ORACLE (oracles).\nThese names state only possible future topics, not implemented business functions, valid R1 parameters, automatically enabled capabilities or compatibility promises. STOCK is not a securities issuance, trading, custody or licensing promise.\n\n09 [VERSION] Version and scope.\nOnly new assets explicitly created with this version and contract address use these rules; legacy assets and LP rights are unchanged. The address and public content identify an immutable version; neither the version nor asset parameters can later be substituted. Future extensions require a new version, new address and new assets with explicit new parameters. Existing assets never acquire undeclared capabilities through a software upgrade.\n\n10 [BOUNDARY] Implementation and trust boundary.\nAIBTCInscription is an immutable rule and pure-calculation reference with no business state. It does not custody BTC or AIBRC, read external-chain state, execute trades or claims, or automatically enforce executor compliance.\nAn executor applies the same mathematics to fixed parameters without requiring per-trade EVM calls; actual parameters, execution and custody remain the executor's responsibility. Anyone may independently recalculate results. A pure return value proves no completed trade, payment or asset lock. How parameters are recorded, transactions submitted, funds held or execution evidenced is outside this contract. This version implements neither actual asset burning nor the business capabilities in the reserved directory.\n\n11 [READ_API] Read-only information interfaces.\nVERSION returns 1; PLATFORM_FEE_BPS returns 50; MIN_USER_GROSS_SATS and BUYBACK_TRIGGER_SATS each return 1000. inscriptionText() returns this complete text; INSCRIPTION_TEXT_SHA256 returns the SHA-256 of its UTF-8 bytes.\nreservedCapabilityCount() returns 15. For 0<=index<15, reservedCapabilityAt(index) returns id, title and RESERVED_DOCUMENTATION_ONLY in section 08 order; out-of-range indices revert.\nNumeric interfaces use uint256; unrepresentable results revert rather than wrap. There is no write interface for changing rules or parameters, and no executable business interface for the reserved directory.\n"; bytes32 constant TEXT_SHA256 = hex"3c0b91af6cbfce5ea8eb8c6d1174c117ff34233695f480f5e6c9b3db7ddaa73b";