系统设计 · AREX-DEV
Development
See PROJECT STRUCTURE.md. In one line: standard/ and contracts/standard/ are the standard; contracts/reference/ is the reference implementation (token, attestations) with the demonstration hooks and extensions.
- 文档 ID
- AREX-DEV
- 版本
- 2.0
- 日期
- 2026-09-21
| Field | Value |
|---|---|
| Document ID | AREX-DEV |
| Version | 2.0 |
| Date | 2026-09-21 |
| Related | AREX-SDD-001, AREX-HOOK, AREX-TEST, CONTRIBUTING.md |
Repository layout
See PROJECT-STRUCTURE.md. In one line: standard/ and contracts/standard/ are the standard; contracts/reference/ is the reference implementation (token, attestations) with the demonstration hooks and extensions.
Change workflow
- Decide which tier the change touches. A change to
contracts/standard/orstandard/AREX-CORE.mdis a change to the standard: open a discussion, write the migration note, and get two independent implementers to confirm (seestandard/README.md). - Add a failing regression test in
test/standard/. - Make the smallest compatible change.
- Run the focused test, then
npm test, thennpm run interface-idsif an interface changed (ids must match the specification) andscripts/gas-report-standard.jsif the pipeline changed. - Update the SDD (component catalogue, RTM), the relevant ADR (or add one), and the whitepaper chapter that describes the behaviour. Regenerate
whitepaper/ui/public/llm-full.txtin the arex-site repository.
Upgradeable-contract rules (reference token)
- ERC-7201 namespaced storage: append fields to
TokenStorage; never reorder or remove. - No constructors with proxy state;
_disableInitializers()in the implementation constructor. - Inheritance changes are storage-layout changes.
- Pin OpenZeppelin (lockfile) and run the upgrades plugin validation before any upgrade.
- Production upgrades go through a multisig and a timelock (
SYSTEM-DESIGN.md§8.4). - Keep
ARexTokenunder 24,576 bytes; the per-fileoptimizer.runs = 1override is the last lever, hooks and companions are the first.
Hook rules
- Implement
IARexHook(useARexHookBase); declare capabilities inhookFlags()and keep them constant. checkis a view that returns a code; it never reverts for policy. ReturnOKforOP_FORCED_TRANSFERunless the rule governs enforcement.onExecutednever calls balance-changing functions of the token.- Read the batch from
IARexBatch(msg.sender); do not store the token address. - Keep
checkbounded: no iteration over history; configuration arrays capped.
Documentation rule
Every claim in the whitepaper and docs is one of: implemented and linked to code; verified by a named test or reproducible command; proposed and marked as future work; or an external fact with a primary source and date. Tests are not an audit; data-model fields are not regulatory compliance; the standard does not classify the token.