Skip to main contentA-REX Foundation

Diseño del sistema · AREX-TEST

Testing

Use Node.js 20 or 22 LTS with npm; the committed package lock.json is the source of truth for dependency versions. Newer Node majors may print Hardhat support warnings.

ID del documento
AREX-TEST
Versión
2.0
Fecha
2026-09-21
Disponible solo en inglés
Esta página está en inglés. Los capítulos del whitepaper y los diagramas están traducidos. El texto normativo del estándar se mantiene en el repositorio; para leerlo, solicita acceso anticipado. Las guías de diseño del sistema y los registros de decisiones están solo en inglés.
FieldValue
Document IDAREX-TEST
Version2.0
Date2026-09-21
RelatedAREX-SDD-001 §12 (traceability matrix), AREX-AUD-001 §7 (coverage matrix)

Test layers

LayerLocationCovers
Standard / referencetest/standard/ARexToken.test.jsbatches, lineage, ERC-7943 enforcement, hook pipeline, conformance, upgrade authorization
Standard / hookstest/standard/DomainHooks.test.jsperishability, seasonal, delivery, traceability, sanctions TTL
Standard / extensionstest/standard/Extensions.test.jsprice oracle, carbon wrapper, parametric insurance
Documentation / guidetest/standard/ImplementationGuide.test.jsevery code block of the Implementation Guide and the example hooks in contracts/examples/, executed in order
Standard / invariantstest/standard/Invariants.test.jsseeded random operation sequences; supply conservation, terminal status, canTransfer ⇔ outcome, lock

Commands

Use Node.js 20 or 22 LTS with npm; the committed package-lock.json is the source of truth for dependency versions. Newer Node majors may print Hardhat support warnings.

Determinism rules

  • Tests that advance chain time restore a snapshot in after() so they do not leak into other files (takeSnapshot / restore).
  • No test depends on wall-clock time: CommodityPriceOracle numbers its rounds instead of bucketing block.timestamp, and the seasonal tests set the block time explicitly.
  • The invariant test is seeded (AREX_INVARIANT_SEED); a failure is reproducible with the same seed and step count.

What tests establish

Repeatable evidence of implemented behaviour in the Hardhat environment. They do not establish absence of vulnerabilities, regulatory compliance, correctness of off-chain data, economic safety, production gas viability across chains, or storage compatibility of future upgrades beyond the OpenZeppelin plugin validation.

Before production

  • Third-party audit (package: AUDIT-READINESS.md).
  • Fork tests on every target chain.
  • Worst-case batch gas benchmarks with the production hook set.
  • Upgrade rehearsal against a mainnet fork with the plugin's validateUpgrade.