Doors for new platforms
The interface a door answers, the rules it keeps, and how the tokenizer admits it at the mint.
A door is a small contract that holds a fee right and pushes its income into a revenue token on every sync. Hookr ships doors for Hookr pools (a pool's Rules ledger, and launches locked behind a door of the token's own), Uniswap v4 and v3 positions, pools.trade fee NFTs, shares of other revenue tokens, Pons and Long. A new platform plugs in with a door of its own, and nothing about the token or the tokenizer changes.
The interface
A door for an outside platform implements IHookrRevenueSource, and the token pulls it as a door of kind SOURCE:
| Call | What it answers |
|---|---|
revenueToken() | The token every pull pays, fixed at construction, so the door can exist before the token at its predicted address. |
assets() | Every currency a pull may deliver, up to eight. The token lists those it can when the call that adds the door asks it to; the rest reach holders through the drop box. |
bound() | Whether the door holds its fee right and is ready to pay. |
ends() | How and when the stream ends: forever, at a block, at a time, revocable, or ended. |
pullGas() | The gas stipend the token calls pull() with, 100,000 to 12,000,000. |
pull() | Collects what the fee right has earned and pushes it into the token. |
pendingIncome() | What a pull would deliver now, by currency, before Hookr's leg. Optional: the tokenizer never calls it, and the app reads it under a gas cap. |
sourceKind() / label() | A constant id for the kind of door and a name the app shows. |
Rules a door keeps
pull()takes calls from the revenue token alone (OnlyRevenueToken), and never reverts on an empty collection.- It pays only a token that holds it as a door (
isDoor), so the fee right never feeds a token that takes no leg for it: the Pons and Long doors revert their first pull withNotADoorwhen the token does not list them. - A currency the token lists goes straight to the token, where the sync measures Hookr's leg. Anything the token does not list goes into the token's drop box: transfer to the box, then the box's
dropStray, after payinglegOf(door)of it tolegCollector(). A pull never calls the token's owndropStray. - A door that reverts, runs out of gas or answers with garbage fails only itself: the sync goes on and records
DoorPulled(i, false).
How the tokenizer admits a door
A door is added at the mint, in tokenize, or later with addStreams by the token's stream manager. Either way the tokenizer reads the door's views with at most 200,000 gas each and refuses it when it has no code, is already one of the token's doors, names another revenue token, declares more than eight assets or the revenue token itself among them, or declares a pullGas() out of bounds. It also needs bound() true, an ends() that is not ended, no pending revocation, and a dated end at least seven days ahead. Hookr's leg is fixed on the door as it is added.
The order is: predict the token's address with predictToken(creator, terms), deploy the door pointed at it, hand the fee right to the door, then call tokenize with the door among its streams. For a token that already exists, deploy the door pointed at the token and call addStreams. If the setup stops before the add, a door can hand the fee right back to the wallet that made it (a Long door only for a share of more than half of the launch's fee shares); once a token holds the door, there is no way back.
A door of this kind is off the Hookr hook, so it carries Hookr's leg of 5%, taken from what it delivers at each sync.
Verified and unverified
The app marks a door verified when the tokenizer's own Pons or Long door factory made it and the token holds it. Every other door shows as unverified, and what it calls itself is its own claim. Holders read doorAt(i) and the door's code before they rely on it.