Contract Storage

Registry

Global state

KeyTypeDescription
admin_addraddressRegistry admin
fee_addraddressFee admin, copied into new benches
default_fee_bpsuint64Platform fee for new benches, in basis points
setup_feeuint64Setup fee for new benches, in microALGO
abel_app_iduint64Asset labeling app used for eligibility checks; 0 disables the checks
allowlist_labelsstring[] (ABI-encoded)See Asset Eligibility
banlist_labelsstring[] (ABI-encoded)See Asset Eligibility
id_counteruint64Last assigned bench ID

Boxes: the bench directory

One box per bench. The box name is the ABI-encoded RegistryKey struct (44 bytes) and the box value the ABI-encoded RegistryValue:

RegistryKey {
  id:                      uint32   // bench ID
  original_time_start:     uint32   // configured start time, 0 = none
  original_time_end:       uint32   // configured end time, 0 = none
  selling_asset_id:        uint64   // 0 = ALGO
  selling_amount:          uint64
  purchase_asset_id:       uint64   // 0 = ALGO
  purchase_price_per_100m: uint64
}

RegistryValue {
  bench_app_id: uint64
  meta:         string   // up to 1014 bytes, see Metadata
}

Since the key contains the sale parameters, listing the registry's boxes (algod GET /v2/applications/{registry_app_id}/boxes) is enough to enumerate all benches with their basic parameters, without reading each bench.

Bench

Global state

KeyTypeDescription
iduint64Bench ID
owner_addraddressOwner (beneficiary)
fee_addraddressFee admin
fee_bpsuint64Platform fee, in basis points
fees_accrueduint64Platform fees accrued and not yet withdrawn, in purchase asset base units
selling_assetuint64Asset for sale, 0 = ALGO
selling_amountuint64Total amount for sale
remaining_amountuint64Amount left for sale
purchase_assetuint64Purchase asset, 0 = ALGO
purchase_price_per_100muint64Price, see Pricing
purchase_limituint64Maximum spend per account in purchase asset base units, 0 = unlimited
time_startuint64Configured start time, or time of the first sale if none was configured
original_time_startuint64Configured start time, 0 = none
time_enduint64Configured end time, or actual end time once sold out or ended manually
original_time_enduint64Configured end time, 0 = none
cancellableuint64Whether the owner may end the bench before its end time. Always 1 for benches created by the current registry, see ABI notes
versionuint64Bench contract version, 2

Boxes: purchase tracking

Only used when purchase_limit > 0. One box per buyer account: the box name is the buyer's 32-byte public key, and the value the buyer's cumulative spend as a uint64, in purchase asset base units. Minimum balance requirement 0.0185 ALGO per box, funded by the buyer on first purchase.