Skip to main contentA-REX Foundation

سجلات القرارات · ADR-002

ADR-002: ERC-1155 as the base token standard

A-REX Core extends ERC-1155: one contract holds many lots, each lot is an id with a quantity, and every conformant token is a complete ERC-1155 token.

Accepted
معرّف المستند
ADR-002
التاريخ
2026-09-21
متوفر بالإنجليزية فقط
هذه الصفحة بالإنجليزية. فصول الورقة البيضاء والمخططات مترجمة. يبقى المعيار المعياري في المستودع؛ استخدم طلب وصول مبكر لذلك النص. وتبقى أدلة تصميم النظام وسجلات القرارات بالإنجليزية.
FieldValue
IDADR-002
Subject areaToken model
StatusAccepted
Date2026-09-21
OwnersA-REX Contributors
Related requirementsFR-02, NFR-06 (SDD §3)
Supersedes / superseded by—

Context

An agricultural lot is fungible inside itself (every kilogram of lot 1 is equal) and distinct from every other lot (lot 1 is not lot 2). An issuer such as an elevator or a cooperative creates thousands of lots a season and splits and merges them routinely. Wallets, explorers, custodians and marketplaces already support the common token standards; a new base would start with no tooling.

Issue

Which base token standard should represent agricultural batches: ERC-20 per lot, ERC-721 per lot, or ERC-1155 ids with quantities?

Assumptions

  • Lots are fungible within themselves and distinct from each other.
  • Issuers create thousands of lots; splitting and merging are routine operations, not exceptions.
  • Existing wallet and indexer support is a precondition for adoption.

Constraints

  • Must be an existing, final ERC with broad tooling.
  • Must express a quantity of a specific lot.

Alternatives considered

AlternativeForAgainstOutcome
ERC-20, one contract per lotUniversal wallet supportOne deployment per lot; lineage would have to cross contracts; no batch operationsRejected
ERC-721, one NFT per lotUnique identity per lotNo quantities; fractions need wrappers; partial delivery is not expressibleRejected
ERC-1155, one id per lot with quantitiesMany lots in one contract, quantities, batch transfers, broad supporttotalSupply is overloaded in ERC1155Supply, which some clients handle poorlyAccepted

Decision

A-REX Core is an extension of ERC-1155. A lot is a token id; its units are the id's balance; a conformant token MUST implement ERC-1155 and ERC-165 and MUST track totalSupply(id).

Argument

ERC-1155 is the only final standard that natively expresses "many distinct lots, each with a quantity" in one contract, which is exactly the shape of agricultural inventory. It also gives lineage a natural home: splitting and merging are burns and mints of ids in the same contract.

Consequences

Positive

  • Wallets, explorers and marketplaces that know ERC-1155 work unchanged.
  • One deployment serves every lot of an issuer; batch transfers amortize gas.

Negative

  • Clients must call totalSupply(uint256) by signature in ethers v6 because of the overload.
  • ERC-1155 receiver callbacks run after state changes, as in every ERC-1155 token.

Obligations it creates

  • The reference inherits OpenZeppelin ERC1155Supply so that supply per lot is exact after partial burns.

Implementation and evidence

WhatWhere
Implementationcontracts/reference/core/ARexToken.sol (ERC1155Upgradeable, ERC1155SupplyUpgradeable)
ERC-1155 interface id reportedtest/standard/ARexToken.test.js: reports the standard interface ids…
Supply per lottest/standard/Invariants.test.js: Σ balances(id) == totalSupply(id)
  • ADR-001: Standardize interfaces only; modules stay outside the standard
  • ADR-003: Adopt ERC-7943 (multi-token variant) verbatim for enforcement
  • ADR-007: Lineage through an atomic transform operation