Skip to main contentA-REX Core

系统设计 · AREX-START

Getting started

Node.js 20 or 22 LTS and npm. Clone and install from the lockfile:

文档 ID
AREX-START
版本
2.0
日期
2026-09-21
仅提供英文版
本文档以英文发布。白皮书章节和示意图已翻译;规范性标准、系统设计指南和决策记录保持英文,以确保只有一个权威文本。
FieldValue
Document IDAREX-START
Version2.0
Date2026-09-21

1. Environment

Node.js 20 or 22 LTS and npm. Clone and install from the lockfile:

git clone --recurse-submodules https://github.com/Arex-Corp/arex-contracts.git && cd arex-contracts
npm ci

2. Compile and test

npm run compile
npm test                   # reference implementation, hooks, extensions, invariants
npm run interface-ids      # ERC-165 ids of the standard interfaces

3. Local deployment

npm run node                                                        # terminal 1
npx hardhat run scripts/deploy-standard.js --network localhost      # token + attestations + 2 hooks
npx hardhat run scripts/deploy-full-standard.js --network localhost # all hooks (ordered) + extensions

Both scripts print a JSON manifest with addresses and the registered hook order. Ignition alternative: npx hardhat ignition deploy ignition/modules/ARexToken.js --network localhost.

4. First batch: the walkthrough script

npx hardhat run scripts/smoke-standard.js                      # in-process network, nothing else needed
npx hardhat run scripts/smoke-standard.js --network localhost  # against the node started in step 3

It deploys the stack and runs one lot through creation, transfer, sanction, split, processing, attestation, freeze, forced transfer, retirement and burn, printing the rejection code before each blocked step. Change the numbers and re-run; it is the fastest way to understand the pipeline.

For manual poking, open a console against the node: npx hardhat console --network localhost, then const t = await ethers.getContractAt("ARexToken", "<address printed by the deploy script>").

See the Implementation Guide chapter of the whitepaper (whitepaper/ui/content/11-implementation-guide.md) for createBatch, transfers with transferCheck, transform, attestations and enforcement, with runnable snippets.

5. Read before extending