メインコンテンツまでスキップ

Seed and Hook Permissions

Live

Creators choose the seed module at launch and can approve or revoke birth hooks after launch.

Integrations let an object birth use more than a plain wallet claim. A creator can use a seed module for custom randomness and can approve hooks for game, route, quest, frame, or any other action.

Seed module​

The seed module is part of the collection's rule. It receives the ledger, owner, object id, owner index, source balance, interval, and caller-provided context.

function seedForBirth(
address ledger,
address owner,
uint256 objectId,
uint256 ownerIndex,
uint256 sourceBalance,
uint256 interval,
bytes calldata context
) external returns (uint256 seed, bytes32 birthPath);

Creators can use the default Mirage seed module or provide a custom module when the collection is created. The public app should show the seed module address because it affects object generation.

Birth hooks​

A birth hook is a contract approved by the collection creator.

ledger.setBirthHook(hook, true);
ledger.setBirthHook(hook, false);

An approved hook can call:

ledger.claimFor(owner, amount, context);

The hook does not bypass soToken rules. The ledger still checks the owner's supported capacity before birthing objects.

Expected creator flow​

The app should treat hooks as deliberate collection settings.

Live settings route:

/market/<ledgerAddress>/settings

Good UI patterns:

  • A post-launch "Hooks" or "Birth Sources" page.
  • Hook cards with Authorize and Revoke actions.
  • Clear labels for recipient behavior, source-token requirements, and review status.
  • A warning before approving custom hook contracts.

Current template categories are GameFi action, campaign/frame, route/swap, and custom developer hook. These are templates for reviewing and labeling hook behavior; a creator still authorizes a specific deployed hook address.

Avoid silent checkbox transactions. Hook permission changes affect who can create births for holders.

Revoking a hook​

Revoking a hook stops future claimFor calls from that hook. It does not alter existing birth records or previously created objects.