Skip to Content

Registry

What each function of the registry does, who may call it, when, and what it checks.

Registry. One registry per chain, created through the deterministic deployer with the admin as its only argument, so it has the same bytes and address on every chain. It is immutable and holds only DLTX’s shared operational data: the entries, the execution keys and their check-ins, the admin and DLTX’s fee address. It interprets no entry’s data and holds nothing about any user. The admin lists an entry in one call, open from then on, and may retire it later. Listing a version makes it its line’s newest; retiring the newest leaves the line with none until a newer version is listed. Order between versions is the reader’s to check.

The other contracts, and every caller on one table, are on the overview.

DLTX’s execution key

The execution key of the strategy’s group, read from its chain’s registry; the owner may revoke it on each contract of the strategy. It acts within the contract’s limits and can pay only the strategy’s own contracts, or the owner’s wallet from the hub.

checkIn

function checkIn(uint64 group) external

Records that the group’s key is running, now.

Who may call: The group’s current execution key.

When: At least every 7 days.

Parameters

NameTypeDescription
groupuint64The execution group.

What it checks

  • The group has a key and the caller is it (NotAllowed).

DLTX’s admin key, on the registry

DLTX’s offline key, the admin of the registry. It may list entries (kinds, versions, asset profiles, a successor registry, builders), each open at once, retire a listed entry, set each group’s execution key, propose a new fee address and a new admin, each of which takes effect only when that address accepts; it never touches an owner’s money and never moves a strategy contract to another version.

list

function list(
    uint8 category,
    bytes32 line,
    bytes calldata data
) external returns (bytes32 id)

Lists an entry, open at once. Its id is the hash of its category, line and data. A version becomes its line’s newest. Returns the entry’s id.

Who may call: The admin key.

When: At any time.

Parameters

NameTypeDescription
categoryuint8The entry’s category: 1 to 5, as the constants name them.
linebytes32The line a version belongs to; zero for a successor.
databytesThe entry’s data, which the registry does not interpret.

What it checks

  • The caller is the admin (NotAllowed).
  • No entry of that id was ever listed (Exists), retired ones included.

retire

function retire(bytes32 id) external

Retires a listed entry for good. If it was its line’s newest, the line has no newest until a newer version is accepted.

Who may call: The admin key.

When: At any time after it is listed.

Parameters

NameTypeDescription
idbytes32The entry’s id.

What it checks

  • The caller is the admin (NotAllowed).
  • The entry exists (Unknown), is listed (NotListed) and not yet retired (Retired).

proposeAdmin

function proposeAdmin(address next) external

Proposes the next admin, which takes over once it accepts. Proposing zero cancels a proposal.

Who may call: The admin key.

When: At any time.

Parameters

NameTypeDescription
nextaddressThe proposed admin.

What it checks

  • The caller is the admin (NotAllowed).

proposeFeeAddress

function proposeFeeAddress(address next) external

Proposes the next fee address, which takes effect once it accepts.

Who may call: The admin key.

When: At any time.

Parameters

NameTypeDescription
nextaddressThe proposed fee address.

What it checks

  • The caller is the admin (NotAllowed).

setReferralCode

function setReferralCode(bytes32 code) external

Sets the referral code at once. Zero turns the referral off for attempts made from then on.

Who may call: The admin key.

When: At any time.

Parameters

NameTypeDescription
codebytes32The new code.

What it checks

  • The caller is the admin (NotAllowed).
  • The code is zero, or 1 to 20 bytes of ASCII capitals and digits, left-aligned, with nothing but zeros after it (BadReferralCode).

setExecutionKey

function setExecutionKey(
    uint64 group,
    address key
) external

Sets a group’s execution key; zero clears it. A group’s first key starts its 7-day check-in clock; a cleared key cannot check in, so its group stops once that clock runs out.

Who may call: The admin key.

When: At any time.

Parameters

NameTypeDescription
groupuint64The execution group.
keyaddressThe new key; zero for none.

What it checks

  • The caller is the admin (NotAllowed).

Anyone

Any address. These functions take no recipient and act only as the code allows: they move nothing anywhere the owner did not choose.

acceptAdmin

function acceptAdmin() external

Takes over as admin.

Who may call: The proposed admin.

When: After being proposed.

What it checks

  • The caller is the proposed admin (NotAllowed).

acceptFeeAddress

function acceptFeeAddress() external

Takes over as the fee address.

Who may call: The proposed fee address.

When: After being proposed.

What it checks

  • The caller is the proposed fee address (NotAllowed).

Read-only

Views and constants: they change nothing, and anyone may read them.

admin

address public admin;

The admin key: this registry’s only authority over entries.

pendingAdmin

address public pendingAdmin;

The admin proposed by the current one, which becomes admin when it accepts; zero for none.

feeAddress

address public feeAddress;

Where DLTX’s fees are paid; zero for none.

pendingFeeAddress

address public pendingFeeAddress;

The fee address proposed by the admin, which becomes the fee address when it accepts; zero for none.

referralCode

bytes32 public referralCode;

The Hyperliquid referral code a leg's keyless referral sets: its ASCII bytes left-aligned and zero-padded; zero for none.

newest

mapping(bytes32 => bytes32) public newest;

A line’s newest accepted version, as an entry id; zero for a line with none.

Parameters

NameTypeDescription
—bytes32Unnamed in the code: not used.

executionKey

mapping(uint64 => address) public executionKey;

The execution key of a group; zero while the group has none.

Parameters

NameTypeDescription
—uint64Unnamed in the code: not used.

lastCheckIn

mapping(uint64 => uint256) public lastCheckIn;

The last check-in of a group.

Parameters

NameTypeDescription
—uint64Unnamed in the code: not used.

firstKeyAt

mapping(uint64 => uint256) public firstKeyAt;

When a group first got a key: its 7 days without a check-in are counted from it at the earliest.

Parameters

NameTypeDescription
—uint64Unnamed in the code: not used.

entry

function entry(bytes32 id) external view returns (Entry memory)

An entry as stored; all zeros for an unknown id.

Parameters

NameTypeDescription
idbytes32The entry’s id.

isOpen

function isOpen(bytes32 id) external view returns (bool)

Whether an entry is listed and not retired.

Parameters

NameTypeDescription
idbytes32The entry’s id.

stopped

function stopped(uint64 group) external view returns (bool)

Whether anyone may stop the group’s strategies: true while the group has never had a key, and once more than 7 days have passed since its last check-in (or its first key, if it never checked in). Clearing a key opens nothing at once.

Parameters

NameTypeDescription
groupuint64The execution group.

Constants

Values compiled in, or set once when the contract is deployed (immutable).

uint8 public constant KIND = 1;
uint8 public constant VERSION = 2;
uint8 public constant PROFILE = 3;
uint8 public constant SUCCESSOR = 4;
uint256 public constant STOP_AFTER = 7 days;
NameDescription
KINDAn entry’s category: a kind of member.
VERSIONAn entry’s category: a release of a kind, listed on a line. Accepting one makes it that line’s newest.
PROFILEAn entry’s category: an asset profile.
SUCCESSORAn entry’s category: a successor registry. It is listed on line zero with the new registry’s address, ABI-encoded, as its data; a member migrates only to an open one.
STOP_AFTERHow long a group may go without checking in (7 days) before stopped is true.

Events

Listed event

event Listed(
    bytes32 indexed id,
    uint8 indexed category,
    bytes32 indexed line,
    bytes data
);

An entry was listed, open from now.

Emitted by: list

Fields

NameTypeDescription
idbytes32 · indexedThe entry’s id.
categoryuint8 · indexedIts category.
linebytes32 · indexedIts line.
databytesIts data.

RetiredEntry event

event RetiredEntry(bytes32 indexed id, bytes32 indexed line);

An entry was retired.

Emitted by: retire

Fields

NameTypeDescription
idbytes32 · indexedThe entry’s id.
linebytes32 · indexedIts line.

AdminProposed event

event AdminProposed(address indexed current, address indexed next);

A new admin was proposed.

Emitted by: proposeAdmin

Fields

NameTypeDescription
currentaddress · indexedThe current admin.
nextaddress · indexedThe proposed admin.

AdminSet event

event AdminSet(address indexed previous, address indexed next);

The admin changed (or was set at construction).

Emitted by: the deployment (constructor), acceptAdmin

Fields

NameTypeDescription
previousaddress · indexedThe previous admin.
nextaddress · indexedThe new admin.

FeeAddressProposed event

event FeeAddressProposed(address indexed current, address indexed next);

A new fee address was proposed.

Emitted by: proposeFeeAddress

Fields

NameTypeDescription
currentaddress · indexedThe current fee address.
nextaddress · indexedThe proposed one.

FeeAddressSet event

event FeeAddressSet(address indexed previous, address indexed next);

The fee address changed.

Emitted by: acceptFeeAddress

Fields

NameTypeDescription
previousaddress · indexedThe previous fee address.
nextaddress · indexedThe new one.

ReferralCodeSet event

event ReferralCodeSet(bytes32 previous, bytes32 next);

The referral code was set.

Emitted by: setReferralCode

Fields

NameTypeDescription
previousbytes32The code before.
nextbytes32The code now; zero for none.

ExecutionKeySet event

event ExecutionKeySet(
    uint64 indexed group,
    address indexed previous,
    address indexed next
);

A group’s execution key was set.

Emitted by: setExecutionKey

Fields

NameTypeDescription
groupuint64 · indexedThe execution group.
previousaddress · indexedThe previous key.
nextaddress · indexedThe new key.

CheckedIn event

event CheckedIn(uint64 indexed group, uint256 checkedInAt);

A group checked in.

Emitted by: checkIn

Fields

NameTypeDescription
groupuint64 · indexedThe execution group.
checkedInAtuint256When it checked in.

Errors

A call that fails reverts with one of these, so a block explorer or a simulation shows which rule refused it.

ErrorWhenRaised by
NotAllowed()The caller may not do this.list, retire, proposeAdmin, acceptAdmin, proposeFeeAddress, acceptFeeAddress, setReferralCode, setExecutionKey, checkIn
Exists()An entry of that id was already listed.list
Unknown()No such entry is listed.retire
Retired()The entry is already retired.retire
BadReferralCode()The code is not 1 to 20 bytes of ASCII capitals and digits, left-aligned and zero-padded.setReferralCode

Types

Entry struct

One registry entry: its category (1 kind, 2 version, 3 profile, 4 successor, 5 builder), its line, its data (opaque to the registry), when it was listed (0 for none) and when it was retired (0 while not).

struct Entry {
    uint8 category;
    bytes32 line;
    bytes data;
    uint64 listedAt;
    uint64 retiredAt;
}

On this page