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) externalRecords that the group’s key is running, now.
Who may call: The group’s current execution key.
When: At least every 7 days.
Parameters
| Name | Type | Description |
|---|---|---|
group | uint64 | The 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
| Name | Type | Description |
|---|---|---|
category | uint8 | The entry’s category: 1 to 5, as the constants name them. |
line | bytes32 | The line a version belongs to; zero for a successor. |
data | bytes | The 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) externalRetires 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
| Name | Type | Description |
|---|---|---|
id | bytes32 | The 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) externalProposes 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
| Name | Type | Description |
|---|---|---|
next | address | The proposed admin. |
What it checks
- The caller is the admin (
NotAllowed).
proposeFeeAddress
function proposeFeeAddress(address next) externalProposes the next fee address, which takes effect once it accepts.
Who may call: The admin key.
When: At any time.
Parameters
| Name | Type | Description |
|---|---|---|
next | address | The proposed fee address. |
What it checks
- The caller is the admin (
NotAllowed).
setReferralCode
function setReferralCode(bytes32 code) externalSets 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
| Name | Type | Description |
|---|---|---|
code | bytes32 | The 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
) externalSets 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
| Name | Type | Description |
|---|---|---|
group | uint64 | The execution group. |
key | address | The 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() externalTakes 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() externalTakes 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
| Name | Type | Description |
|---|---|---|
| — | bytes32 | Unnamed in the code: not used. |
executionKey
mapping(uint64 => address) public executionKey;The execution key of a group; zero while the group has none.
Parameters
| Name | Type | Description |
|---|---|---|
| — | uint64 | Unnamed in the code: not used. |
lastCheckIn
mapping(uint64 => uint256) public lastCheckIn;The last check-in of a group.
Parameters
| Name | Type | Description |
|---|---|---|
| — | uint64 | Unnamed 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
| Name | Type | Description |
|---|---|---|
| — | uint64 | Unnamed 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
| Name | Type | Description |
|---|---|---|
id | bytes32 | The entry’s id. |
isOpen
function isOpen(bytes32 id) external view returns (bool)Whether an entry is listed and not retired.
Parameters
| Name | Type | Description |
|---|---|---|
id | bytes32 | The 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
| Name | Type | Description |
|---|---|---|
group | uint64 | The 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;| Name | Description |
|---|---|
KIND | An entry’s category: a kind of member. |
VERSION | An entry’s category: a release of a kind, listed on a line. Accepting one makes it that line’s newest. |
PROFILE | An entry’s category: an asset profile. |
SUCCESSOR | An 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_AFTER | How 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
| Name | Type | Description |
|---|---|---|
id | bytes32 · indexed | The entry’s id. |
category | uint8 · indexed | Its category. |
line | bytes32 · indexed | Its line. |
data | bytes | Its data. |
RetiredEntry event
event RetiredEntry(bytes32 indexed id, bytes32 indexed line);An entry was retired.
Emitted by: retire
Fields
| Name | Type | Description |
|---|---|---|
id | bytes32 · indexed | The entry’s id. |
line | bytes32 · indexed | Its line. |
AdminProposed event
event AdminProposed(address indexed current, address indexed next);A new admin was proposed.
Emitted by: proposeAdmin
Fields
| Name | Type | Description |
|---|---|---|
current | address · indexed | The current admin. |
next | address · indexed | The 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
| Name | Type | Description |
|---|---|---|
previous | address · indexed | The previous admin. |
next | address · indexed | The new admin. |
FeeAddressProposed event
event FeeAddressProposed(address indexed current, address indexed next);A new fee address was proposed.
Emitted by: proposeFeeAddress
Fields
| Name | Type | Description |
|---|---|---|
current | address · indexed | The current fee address. |
next | address · indexed | The proposed one. |
FeeAddressSet event
event FeeAddressSet(address indexed previous, address indexed next);The fee address changed.
Emitted by: acceptFeeAddress
Fields
| Name | Type | Description |
|---|---|---|
previous | address · indexed | The previous fee address. |
next | address · indexed | The new one. |
ReferralCodeSet event
event ReferralCodeSet(bytes32 previous, bytes32 next);The referral code was set.
Emitted by: setReferralCode
Fields
| Name | Type | Description |
|---|---|---|
previous | bytes32 | The code before. |
next | bytes32 | The 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
| Name | Type | Description |
|---|---|---|
group | uint64 · indexed | The execution group. |
previous | address · indexed | The previous key. |
next | address · indexed | The new key. |
CheckedIn event
event CheckedIn(uint64 indexed group, uint256 checkedInAt);A group checked in.
Emitted by: checkIn
Fields
| Name | Type | Description |
|---|---|---|
group | uint64 · indexed | The execution group. |
checkedInAt | uint256 | When 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.
| Error | When | Raised 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;
}