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, Uniswap v4 and v3 positions, pools.trade fee NFTs, 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. Each must be one of the token's assets. |
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 3,000,000. |
pull() | Collects what the fee right has earned and pushes it into the token. |
sourceKind() / label() | A constant id for the kind of door and a name the app shows. |
Rules a door keeps
pull()never reverts on an empty collection, and does nothing while the token has no code yet.- It should pay only a token that sealed it as a door, as the Pons door does, so the fee right never feeds a token that took no leg for it.
- Anything the token does not list goes into the token's drop box: approve the box, then
drop. A pull never calls the token'sdropStray. - 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
The door is fixed at the mint like every other door. In one tokenizeStreams call the tokenizer checks that the door has code and is not repeated, that revenueToken() names the token being minted, that bound() is true, that every currency of assets() is one of the token's assets, and that pullGas() is in bounds. A door whose ends() says a revocation is already pending is refused until it lapses or is cancelled.
The order is: predict the token's address with predictStreamToken(creator, terms), deploy the door pointed at it, hand the fee right to the door, then call tokenizeStreams. If the setup stops before the mint, a door can hand the fee right back to the wallet that made it; once a token holds the door, there is no way back.
A token with any door of this kind counts as off the Hookr hook, so it carries Hookr's leg of 5%.
Verified and unverified
The app marks a door verified when Hookr's 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.