Skip to main contentA-REX Foundation

تصميم النظام · AREX-STRUCT

Project structure

Nothing in contracts/standard/ imports anything else in the repository; hooks and extensions depend on the interfaces, never on ARexToken.

معرّف المستند
AREX-STRUCT
الإصدار
2.1
التاريخ
2026-09-22
متوفر بالإنجليزية فقط
هذه الصفحة بالإنجليزية. فصول الورقة البيضاء والمخططات مترجمة. يبقى المعيار المعياري في المستودع؛ استخدم طلب وصول مبكر لذلك النص. وتبقى أدلة تصميم النظام وسجلات القرارات بالإنجليزية.
FieldValue
Document IDAREX-STRUCT
Version2.1
Date2026-09-22

Where everything lives, what depends on what, and which files are normative.

Dependencies between folders

flowchart LR
    SPEC["standard/<br/>specification · schema"] --- IFACE["contracts/standard/<br/>interfaces · CC0"]
    CORE["contracts/reference/core/<br/>ARexToken · ARexAttestations"] -->|implements| IFACE
    HOOKS["contracts/reference/hooks/<br/>7 hooks + mocks"] -->|implements IARexHook| IFACE
    EXT["contracts/reference/extensions/<br/>3 companions"] -->|uses IARexAttest| IFACE
    EX["contracts/examples/<br/>documentation hooks"] --> HOOKS
    TESTS["test/standard/"] --> CORE
    TESTS --> HOOKS
    TESTS --> EXT
    TESTS --> EX
    DOCS["docs/ · whitepaper/"] -.->|checked by scripts/check-docs.js| TESTS

Nothing in contracts/standard/ imports anything else in the repository; hooks and extensions depend on the interfaces, never on ARexToken.

The standard (normative, CC0)

PathContents
standard/AREX-CORE.mdthe specification in ERC format
standard/README.mdinterface ids, layers, versioning, change process
standard/schema/batch-metadata.schema.jsonJSON Schema of the off-chain metadata document
standard/examples/batch-metadata.example.jsonan example document that validates against the schema
contracts/standard/IARexBatch.sollayer 1: batch identity, status, metadata commitment, lineage
contracts/standard/IARexHook.sollayer 2: the hook interface
contracts/standard/IARexHookManager.sollayer 2: pipeline management on the token
contracts/standard/IARexAttest.sollayer 3: attestations
contracts/standard/IERC7943MultiToken.sollayer 0: ERC-7943, copied verbatim
contracts/standard/ARexCodes.soloperations, flags, statuses, recommended codes, helpers
contracts/standard/ARexInterfaceIds.solERC-165 ids as constants

Reference implementation and demonstrations (MIT, not normative)

PathContents
contracts/reference/core/ARexToken.solUUPS token implementing layers 0–2
contracts/reference/core/ARexAttestations.sollayer 3 companion registry
contracts/reference/hooks/ARexHookBase.solabstract base for hooks
contracts/reference/hooks/EligibilityHook.solallow and block lists, sanctions with source and TTL
contracts/reference/hooks/ExpiryHook.solexpiry and pre-harvest gating
contracts/reference/hooks/AttestationHook.sola required attestation per commodity
contracts/reference/hooks/PerishabilityHook.soldecay models and value views
contracts/reference/hooks/SeasonalHook.solwindows per commodity and operation
contracts/reference/hooks/DeliveryHook.soldelivery lifecycle, unit lock, settlement
contracts/reference/hooks/TraceabilityHook.solEPCIS-shaped event log
contracts/reference/hooks/mocks/RecordingHook, ReentrantHook, InterfaceIdProbe (tests only)
contracts/reference/extensions/CommodityPriceOracle, CarbonImmobilizationWrapper, ParametricInsurance, mocks/TestERC20
contracts/reference/proxy/ERC1967ProxyImport.solcompiles OpenZeppelin's proxy for the Ignition module
contracts/examples/SeasonHook, MaxLotPerBuyerHook, MyHook: the hooks printed in the documentation

Tests, scripts and deployment

PathContents
test/standard/ARexToken.test.jsbatches, lineage, enforcement, pipeline, attestations, conformance, upgrade
test/standard/DomainHooks.test.jsperishability, seasonal, delivery, traceability, sanctions
test/standard/Extensions.test.jsoracle, carbon wrapper, insurance
test/standard/Invariants.test.jsseeded randomized invariants
test/standard/ImplementationGuide.test.jsthe Implementation Guide chapter, executed
test/standard/helpers.jsfixtures and constants for tests
scripts/deploy-standard.js, deploy-full-standard.jsminimal and full reference stacks
scripts/smoke-standard.jsnarrated walkthrough of one lot
scripts/gas-report-standard.jsgas with 0, 1 and 2 hooks, and per hook
scripts/getInterfaceIds.jsERC-165 ids from the compiled interfaces
scripts/check-docs.jskeeps the documentation identical to executed code
ignition/modules/ARexToken.jsHardhat Ignition deployment of the minimal stack
.github/workflows/ci.ymlcompile, interface ids, docs check, tests, documented commands, site build
hardhat.config.jssolc 0.8.22, viaIR, paris; optimizer.runs = 1 for ARexToken
package.json, package-lock.jsonOpenZeppelin pinned to 5.3.0

Documentation

PathContents
docs/README.mddocumentation map with ids, audiences and status
docs/SYSTEM-DESIGN.mdAREX-SDD-001, the System Design Document
docs/adr/sixteen architectural decision records and their index
docs/AUDIT-READINESS.mdaudit scope, trust model, invariants, coverage
docs/ARCHITECTURE.mdone-page summary of the SDD
docs/HOOK-DEVELOPMENT.mdhow to write, test and register a hook
docs/GETTING-STARTED.md, DEVELOPMENT.md, TESTING.md, CONFIGURATION.mdengineering guides
docs/history/the reviews that motivated A-REX Core
whitepaper/ui/content/sixteen whitepaper chapters and the diagram sheets
whitepaper/ui/the IBM Carbon documentation site
whitepaper/ui/public/llm-full.txtthe whitepaper as one plain-text file

Naming

  • A-REX Core is the standard (layers 0–3).
  • ARexToken is the reference implementation. Third parties are encouraged to name their own implementations differently.
  • The prefix ERC is not used in contract or interface names: no ERC number has been assigned and the EIP editors reject self-assigned names.