श्वेतपत्र · 16
परिशिष्ट
प्रामाणिक स्रोत: contracts/standard/ .sol (CC0) और standard/AREX CORE.md। इंटरफ़ेस आईडी npm run interface ids द्वारा पुनः उत्पन्न होती हैं।
परिशिष्ट A: इंटरफ़ेस संदर्भ
प्रामाणिक स्रोत: contracts/standard/*.sol (CC0) और standard/AREX-CORE.md। इंटरफ़ेस आईडी npm run interface-ids द्वारा पुनः उत्पन्न होती हैं।
A.1 अनुरूपता सारांश
| इंटरफ़ेस | ERC-165 आईडी | टोकन | हुक |
|---|---|---|---|
IERC1155 | 0xd9b67a26 | अनिवार्य | — |
IERC7943MultiToken | 0x41c4fbad | अनिवार्य | — |
IARexBatch | 0xe22639e0 | अनिवार्य | — |
IARexHookManager | 0x964f4861 | अनिवार्य (getHooks) | — |
IARexAttest | 0xad603a6c | अनुशंसित (टोकन या सहायक) | — |
IARexHook | 0x332afcbb | — | अनिवार्य |
A.2 IARexBatch
struct BatchInit { bytes32 commodity; bytes32 unit; uint64 producedAt; uint64 expiresAt; bytes32 originRef; bytes32 metadataHash; string uri; }
struct Batch { address issuer; uint64 createdAt; uint8 status; bytes32 commodity; bytes32 unit; uint64 producedAt; uint64 expiresAt; bytes32 originRef; bytes32 metadataHash; string uri; }
event BatchCreated(uint256 indexed id, address indexed issuer, bytes32 indexed commodity, bytes32 unit, uint256 quantity, address to);
event BatchStatusChanged(uint256 indexed id, uint8 previousStatus, uint8 newStatus, bytes32 reason);
event BatchMetadataUpdated(uint256 indexed id, bytes32 metadataHash, string uri);
event BatchTransformed(address indexed operator, uint256[] inputIds, uint256[] inputAmounts, uint256[] outputIds, uint256[] outputAmounts, bytes32 processRef);
error ARexBatchNotFound(uint256 id);
error ARexBatchRetired(uint256 id);
error ARexInvalidBatch(bytes32 reason);
error ARexInvalidStatusTransition(uint256 id, uint8 from, uint8 to);
error ARexLengthMismatch();
function createBatch(BatchInit calldata init, uint256 quantity, address to, bytes calldata data) external returns (uint256 id);
function batchOf(uint256 id) external view returns (Batch memory);
function batchExists(uint256 id) external view returns (bool);
function totalSupply(uint256 id) external view returns (uint256);
function setBatchStatus(uint256 id, uint8 status, bytes32 reason) external;
function setBatchMetadata(uint256 id, bytes32 metadataHash, string calldata uri) external;
function transform(address from, address to, uint256[] calldata inputIds, uint256[] calldata inputAmounts, BatchInit[] calldata outputs, uint256[] calldata outputAmounts, bytes32 processRef) external returns (uint256[] memory outputIds);
function parentsOf(uint256 id) external view returns (uint256[] memory);
A.3 IERC7943MultiToken (ERC-7943, शब्दशः)
event ForcedTransfer(address indexed from, address indexed to, uint256 indexed tokenId, uint256 amount);
event Frozen(address indexed account, uint256 indexed tokenId, uint256 amount);
error ERC7943CannotSend(address account);
error ERC7943CannotReceive(address account);
error ERC7943CannotTransfer(address from, address to, uint256 tokenId, uint256 amount);
error ERC7943InsufficientUnfrozenBalance(address account, uint256 tokenId, uint256 amount, uint256 unfrozen);
function forcedTransfer(address from, address to, uint256 tokenId, uint256 amount) external returns (bool result);
function setFrozenTokens(address account, uint256 tokenId, uint256 amount) external returns (bool result);
function canSend(address account) external view returns (bool allowed);
function canReceive(address account) external view returns (bool allowed);
function getFrozenTokens(address account, uint256 tokenId) external view returns (uint256 amount);
function canTransfer(address from, address to, uint256 tokenId, uint256 amount) external view returns (bool allowed);
A.4 IARexHook और IARexHookManager
interface IARexHook is IERC165 {
error ARexHookRejected(address hook, bytes32 code);
function hookFlags() external view returns (uint8);
function check(uint8 op, address operator, address from, address to, uint256 id, uint256 amount, bytes calldata data) external view returns (bytes32 code);
function onExecuted(uint8 op, address operator, address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
function canSend(address account) external view returns (bool);
function canReceive(address account) external view returns (bool);
}
interface IARexHookManager {
event HookRegistered(address indexed hook, uint8 flags, uint256 position);
event HookRemoved(address indexed hook);
error ARexHookAlreadyRegistered(address hook);
error ARexHookNotRegistered(address hook);
error ARexInvalidHook(address hook);
function getHooks() external view returns (address[] memory);
function hookFlagsOf(address hook) external view returns (uint8);
function registerHook(address hook) external;
function removeHook(address hook) external;
}
A.5 IARexAttest
struct Attestation { address issuer; bytes32 ref; uint64 issuedAt; uint64 expiresAt; bool revoked; }
event Attested(uint256 indexed id, bytes32 indexed topic, address indexed issuer, bytes32 ref, uint64 expiresAt);
event AttestationRevoked(uint256 indexed id, bytes32 indexed topic, address indexed issuer, bytes32 reason);
event TrustedIssuerUpdated(bytes32 indexed topic, address indexed issuer, bool trusted);
error ARexUntrustedIssuer(bytes32 topic, address issuer);
error ARexAttestationNotFound(uint256 id, bytes32 topic);
function attest(uint256 id, bytes32 topic, bytes32 ref, uint64 expiresAt) external;
function revokeAttestation(uint256 id, bytes32 topic, bytes32 reason) external;
function getAttestation(uint256 id, bytes32 topic) external view returns (Attestation memory);
function isAttested(uint256 id, bytes32 topic) external view returns (bool);
function isTrustedIssuer(bytes32 topic, address issuer) external view returns (bool);
A.6 स्थिरांक (ARexCodes)
| समूह | मान |
|---|---|
| ऑपरेशन | OP_MINT = 1, OP_TRANSFER = 2, OP_BURN = 3, OP_FORCED_TRANSFER = 4, OP_TRANSFORM = 5 |
| हुक फ़्लैग | HOOK_CHECK = 1, HOOK_EXECUTED = 2, HOOK_ELIGIBILITY = 4 |
| स्टेटस | STATUS_ACTIVE = 0, STATUS_RETIRED = 255 |
कोड (keccak256("AREX:…")) | PAUSED, FROZEN, SENDER_INELIGIBLE, RECEIVER_INELIGIBLE, SANCTIONED, BATCH_NOT_FOUND, BATCH_RETIRED, BATCH_INACTIVE, BATCH_EXPIRED, BATCH_NOT_PRODUCED, LIMIT_EXCEEDED, DOCUMENT_MISSING, SEASON_CLOSED, IN_TRANSIT, ATTESTATION_MISSING |
| हेल्पर | commodity(scheme, code), unit(code), topic(name), code(namespace, name) |
A.7 संदर्भ कार्यान्वयन की भूमिकाएँ
ARexToken पर ISSUER_ROLE, TRANSFORMER_ROLE, STATUS_ROLE, ENFORCER_ROLE, HOOK_ADMIN_ROLE, PAUSER_ROLE, UPGRADER_ROLE, DEFAULT_ADMIN_ROLE (प्रत्येक keccak256("AREX_<NAME>")); ARexAttestations पर ATTEST_ADMIN_ROLE। अतिरिक्त व्यू: isExpired(id), transferCheck(from, to, id, amount); अतिरिक्त फ़ंक्शन: burn(from, id, amount); ERC-7201 स्लॉट 0x8ed599b6be05dec05297c009a1279a71df771ad996fe924d0b5a47326ff60900।
A.8 संदर्भ हुक और एक्सटेंशन
| कॉन्ट्रैक्ट | प्रकार | मुख्य फ़ंक्शन |
|---|---|---|
PerishabilityHook | हुक | setCommodityDecay, setBatchDecay, valueBps, secondsRemaining, isExpired |
SeasonalHook | हुक | addWindow, clearWindows, windowsOf, isOpen |
DeliveryHook | हुक | schedule, pickUp, markInTransit, recordReading, confirmDelivered, cancel, dispute, resolve, getDelivery, lockedUnits |
TraceabilityHook | हुक | recordEvent, eventCount, getEvents; कंस्ट्रक्टर फ़्लैग persist |
CommodityPriceOracle | एक्सटेंशन | submit, finalizeRound, latestAnswer, getRound, currentRound, isStale, setParameters |
CarbonImmobilizationWrapper | एक्सटेंशन | recordImmobilization, linkToBatch, retire, release, attestBacking, backingOf, linksOf |
ParametricInsurance | एक्सटेंशन | fund, issue, claim, expire, getPolicy, freeCapacity |
A.9 मेटाडेटा स्कीमा
standard/schema/batch-metadata.schema.json (JSON Schema 2020-12)। आवश्यक: schemaVersion, commodity{scheme, code}, unit, quantity। उल्लेखनीय वैकल्पिक समूह: traceabilityLotCode, gs1{gtin, lgtin, sscc, glnProducer, digitalLink}, production, origin{country, originRef, eudr{ddsReference}, geohashPrecision, geohash}, quality{gradeScheme, grade, measurements[]}, status.table, attestations[], documents[]{type, hash, uri, registry, registryId}, epcis{bizStep, disposition, readPoint, bizLocation}, restricted{uri, hash, accessPolicy}, attributes[]। उदाहरण standard/examples/batch-metadata.example.json में।
परिशिष्ट B: शब्दावली
| शब्द | अर्थ |
|---|---|
| बैच | एक ERC-1155 टोकन आईडी जिसके साथ Batch रिकॉर्ड है: एक इकाई में एक कमोडिटी का लॉट, जिसका उद्गम और उत्पादन समय साझा है। |
| री-बैच | ऐसा transform जिसके आउटपुट की कमोडिटी और इकाई इनपुट जैसी ही हो और जिसकी मात्राएँ संरक्षित हों (विभाजन, मर्ज)। संदर्भ कार्यान्वयन में धारकों के लिए खुला। |
| प्रसंस्करण | ऐसा transform जो कमोडिटी, इकाई या मात्रा बदलता है। संदर्भ कार्यान्वयन में TRANSFORMER_ROLE आवश्यक। |
| वंशावली | BatchTransformed इवेंट और parentsOf से बनने वाला ग्राफ़। |
| हुक | IARexHook लागू करने वाला कॉन्ट्रैक्ट, जो किसी टोकन पर पंजीकृत है और प्रत्येक ऑपरेशन पर क्रम से मूल्यांकित होता है। |
| अस्वीकृति कोड | हुक के check द्वारा लौटाया गया bytes32; 0 का अर्थ अनुमत; परंपरा keccak256("NAMESPACE:NAME")। |
| पात्रता | भेजने या प्राप्त करने की खाता-स्तरीय अनुमति, जिसका उत्तर HOOK_ELIGIBILITY फ़्लैग वाले हुक देते हैं; ERC-7943 canSend/canReceive के रूप में उपलब्ध। |
| फ़्रीज़ किया गया बैलेंस | वे इकाइयाँ जो किसी खाते के पास हैं पर वह हिला नहीं सकता (setFrozenTokens); बैलेंस से अधिक हो सकती हैं। |
| बलपूर्वक ट्रांसफ़र | धारक की सहमति के बिना ENFORCER_ROLE द्वारा इकाइयों का अंतरण (ERC-7943)। |
| एटेस्टेशन | उस विषय के विश्वसनीय जारीकर्ता द्वारा दर्ज (batch, topic) → (issuer, reference, validity)। |
| विषय | एटेस्टेशन के विषय को पहचानने वाला bytes32; खुला; ERC-735 दावा विषयों और EAS स्कीमा आईडी से मैप होता है। |
| उद्गम संदर्भ | originRef: उद्गम साक्ष्य का हैश या संदर्भ; कभी निर्देशांक नहीं। |
| मेटाडेटा कमिटमेंट | metadataHash, uri पर स्थित कैनोनिकल ऑफ़-चेन दस्तावेज़ का keccak256। |
| स्टेटस | uint8 जीवनचक्र मान; 0 सक्रिय, 255 रिटायर (अंतिम); 1..254 जारीकर्ता-परिभाषित। |
| CTE / KDE | क्रिटिकल ट्रैकिंग इवेंट / प्रमुख डेटा तत्व (FSMA 204)। |
| DDS | ड्यू-डिलिजेंस कथन (EUDR)। |
| EPCIS | GS1 Electronic Product Code Information Services, ट्रेसेबिलिटी के लिए इवेंट शब्दावली (संस्करण 2.0)। |
| CPR / CPR-e | Cédula de Produto Rural, ब्राज़ील का फ़सल प्राप्य; अधिकृत संस्थाओं के पास पंजीकृत इलेक्ट्रॉनिक रूप। |
| EWR | U.S. Warehouse Act के अंतर्गत इलेक्ट्रॉनिक वेयरहाउस रसीद। |
| MLETR | UNCITRAL Model Law on Electronic Transferable Records। |
| ERC-7943 (uRWA) | Universal Real World Asset इंटरफ़ेस: फ़्रीज़, बलपूर्वक ट्रांसफ़र, पात्रता; मई 2026 में Final। |
| ERC-3643 (T-REX) | ERC-20 पर प्रतिभूतियों के लिए अनुमति-आधारित टोकन मानक; दिसंबर 2023 में Final। |
| ERC-7201 | अपग्रेड-योग्य कॉन्ट्रैक्ट के लिए नेमस्पेस्ड स्टोरेज लेआउट। |
परिशिष्ट C: ग्रंथसूची
मानक और विनिर्देश
- Radomski, W. et al. "EIP-1155: Multi Token Standard." Ethereum Improvement Proposals, 2018.
- Vogelsteller, F., Buterin, V. "EIP-20: Token Standard." 2015.
- "ERC-165: Standard Interface Detection." 2018.
- "ERC-3643: T-REX — Token for Regulated EXchanges." Final, 15 दिसंबर 2023. https://eips.ethereum.org/EIPS/eip-3643
- "ERC-7943: uRWA — Universal Real World Asset Interface." Final, 27 मई 2026. https://eips.ethereum.org/EIPS/eip-7943
- "ERC-7201: Namespaced Storage Layout." 2023.
- "ERC-735: Claim Holder." 2017 (ड्राफ़्ट)।
- Ethereum Attestation Service प्रलेखन।
- GS1. "EPCIS and CBV Standard 2.0." 2022. GS1 US. "EPCIS Recommendations for FSMA 204 Critical Tracking Events." 2024.
- UN/CEFACT. "Recommendation No. 20: Codes for Units of Measure Used in International Trade."
- IETF RFC 8785. "JSON Canonicalization Scheme (JCS)." 2020.
- OpenZeppelin Contracts 5.x प्रलेखन; OpenZeppelin और T-REX Network साझेदारी की घोषणा, जुलाई 2026।
विनियमन और विधि
- FDA. "Requirements for Additional Traceability Records for Certain Foods." अंतिम नियम, Federal Register 87(219), 2022; "Compliance Date Extension," Federal Register, 7 अगस्त 2025।
- Regulation (EU) 2023/1115 (वनों की कटाई); Regulation (EU) 2025/2650 (संशोधन); Council of the EU प्रेस विज्ञप्ति, 18 दिसंबर 2025।
- Regulation (EU) 2023/1114 (MiCA); ESMA Guidelines on the qualification of crypto-assets as financial instruments, दिसंबर 2024।
- European Data Protection Board. "Guidelines 02/2025 on processing of personal data through blockchain technologies," संस्करण 2.0, 7 जुलाई 2026।
- SEC. Release No. 33-11412, 17 मार्च 2026. SEC v. W.J. Howey Co., 328 U.S. 293 (1946).
- GENIUS Act, Public Law 119-27 (2025); कार्यान्वयन विनियम, Federal Register, 18 अगस्त 2026।
- Uniform Commercial Code, 2022 Amendments, Article 12 (Controllable Electronic Records).
- U.S. Warehouse Act; 7 CFR Part 869 (Electronic Warehouse Receipts).
- UNCITRAL. "Model Law on Electronic Transferable Records." 2017. यूनाइटेड किंगडम, Electronic Trade Documents Act 2023.
- Comisión Nacional de Valores (अर्जेंटीना). Resolución General 1150/2026. Ley 9.643 (वारंट)।
- ब्राज़ील. Lei 8.929/1994, Lei 13.986/2020 (CPR); Lei 11.076/2004 (CDA/WA); CVM Resolução 88 और Consulta Pública SDM 05/2025।
- Verra. "Verra Addresses Crypto Instruments and Tokens." 2022; VCS Program Guide.
- Directive (EU) 2024/825 (हरित परिवर्तन के लिए उपभोक्ताओं को सशक्त बनाना)।
अनुसंधान और उद्योग
- Zhang, P., Schmidt, D. C. "Blockchain Applications in Food Supply Chain Management: A Systematic Review." Journal of Food Engineering, 279, 2020.
- Caro, M. P. et al. "Blockchain-based Traceability in Agri-Food Supply Chain Management." IEEE, 2018.
- FAO. "The State of Food and Agriculture." 2023.
- World Bank. "Future of Food: Harnessing Digital Technologies to Improve Food System Outcomes." 2022.
- ERC3643 Association. "History of ERC-3643"; ISO TC 307 मानकीकरण पहल की घोषणा।
- Chainlink. "Automated Compliance Engine (ACE): Technical Overview." 2025–2026.
परिशिष्ट D: टेम्पलेट
D.1 न्यूनतम हुक
स्रोत: contracts/examples/MyHook.sol (../reference/hooks/ARexHookBase.sol और ../standard/IARexBatch.sol इम्पोर्ट करता है)।
contract MyHook is ARexHookBase {
function hookFlags() public pure override returns (uint8) {
return ARexCodes.HOOK_CHECK;
}
function check(uint8 op, address, address, address, uint256 id, uint256, bytes calldata)
external
view
override
returns (bytes32)
{
if (op != ARexCodes.OP_TRANSFER) return ARexCodes.OK;
IARexBatch.Batch memory b = IARexBatch(msg.sender).batchOf(id);
b; // decide from b.commodity, b.producedAt, b.expiresAt, b.status ...
return ARexCodes.OK;
}
}
D.2 डिप्लॉयमेंट (अपग्रेड प्लगइन)
const token = await upgrades.deployProxy(await ethers.getContractFactory("ARexToken"), [admin, baseURI], { kind: "uups" });
const attestations = await (await ethers.getContractFactory("ARexAttestations")).deploy(admin, await token.getAddress());
await token.registerHook(await (await ethers.getContractFactory("EligibilityHook")).deploy(admin));
await token.registerHook(await (await ethers.getContractFactory("ExpiryHook")).deploy(true));
D.3 मेटाडेटा कंकाल
{ "schemaVersion": "1.0.0", "commodity": { "scheme": "HS", "code": "100199" }, "unit": "KGM", "quantity": 250000,
"traceabilityLotCode": "…", "production": { "producedAt": "…" }, "origin": { "country": "AR", "originRef": "…" },
"status": { "table": { "1": "IN_STORAGE" } }, "documents": [ { "type": "warehouse_receipt", "hash": "…", "registryId": "…" } ],
"restricted": { "uri": "…", "hash": "…", "accessPolicy": "…" } }
परिशिष्ट E: अक्सर पूछे जाने वाले प्रश्न (FAQ)
क्या A-REX एक ERC है? अभी नहीं। विनिर्देश ERC प्रारूप में लिखा गया है और प्रोडक्शन डिप्लॉयमेंट, स्वतंत्र कार्यान्वयनों और ऑडिट के बाद सबमिट किया जाएगा। कोई संख्या असाइन नहीं की गई है; कोड में नाम ERC उपसर्ग का उपयोग नहीं करते।
क्या मुझे ARexToken का उपयोग करना अनिवार्य है? नहीं। इंटरफ़ेस को जैसे चाहें लागू करें; संदर्भ एक तरीका है।
क्या मुझे संदर्भ हुक का उपयोग करना अनिवार्य है? नहीं। वे प्रदर्शन हैं। उन्हें कॉपी करें, बदलें, या अपने स्वयं के लिखें।
क्या कोई हुक बलपूर्वक ट्रांसफ़र को ब्लॉक कर सकता है? वह OP_FORCED_TRANSFER के लिए कोड लौटा सकता है, और टोकन रिवर्ट करेगा। संदर्भ हुक ऐसा नहीं करते; प्रवर्तन को शासित करने वाला हुक (उदा. आदेश संदर्भ अनिवार्य करना) कर सकता है।
निर्देशांक कहाँ जाते हैं? मेटाडेटा से संदर्भित निर्बंधित ऑफ़-चेन स्टोरेज में, कभी ऑन-चेन नहीं।
भावी फ़सल को कैसे निरूपित करें? producedAt = 0; ट्रांसफ़र को ExpiryHook(allowPreHarvestTransfers) से गेट करें।
क्या transform में मात्रा संरक्षित रहती है? मानक द्वारा नहीं; संदर्भ कार्यान्वयन किसी भी धारक को तब री-बैच करने देता है जब मात्रा संरक्षित हो, और अन्यथा TRANSFORMER_ROLE की आवश्यकता रखता है।
क्या टोकन प्रतिभूति है? मानक यह तय नहीं करता। पेशकश तय करती है। विधि-सलाहकार से पूछें; उत्तर जो भी हो, प्रवर्तन सतह मौजूद है।