Skip to main content

Hooks

Hooks are custom smart contracts that execute additional onchain actions after advanced orders are processed. Creators can deploy hooks to extend functionality and integrate with their ecosystem.

Supported Hook Types:

  • Buy Order Hooks: Triggered after advanced buy orders.

    //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0
    pragma solidity 0.8.24;

    /**
    * @title ITokenMasterBuyHook
    * @author Limit Break, Inc.
    * @notice Interface that must be implemented by contracts acting as a buy hook
    * @notice for advanced buy orders.
    */
    interface ITokenMasterBuyHook {
    function tokenMasterBuyHook(
    address tokenMasterToken,
    address buyer,
    bytes32 creatorBuyIdentifier,
    uint256 amountPurchased,
    bytes calldata hookExtraData
    ) external;
    }
  • Sell Order Hooks: Triggered after advanced sell orders.

    //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0
    pragma solidity 0.8.24;

    /**
    * @title ITokenMasterSellHook
    * @author Limit Break, Inc.
    * @notice Interface that must be implemented by contracts acting as a sell hook
    * @notice for advanced sell orders.
    */
    interface ITokenMasterSellHook {
    function tokenMasterSellHook(
    address tokenMasterToken,
    address seller,
    bytes32 creatorSellIdentifier,
    uint256 amountSold,
    bytes calldata hookExtraData
    ) external;
    }
  • Spend Order Hooks: Triggered after spend orders.

    //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0
    pragma solidity 0.8.24;

    /**
    * @title ITokenMasterSpendHook
    * @author Limit Break, Inc.
    * @notice Interface that must be implemented by contracts acting as a spend hook
    * @notice for spend orders.
    */
    interface ITokenMasterSpendHook {
    function tokenMasterSpendHook(
    address tokenMasterToken,
    address spender,
    bytes32 creatorSpendIdentifier,
    uint256 multiplier,
    bytes calldata hookExtraData
    ) external;
    }

Key Parameters:

  • Transaction Context: Hooks receive details such as token being transacted, executor address, creator identifier, and quantity transacted. Quantity transacted is amount of token for buy and sells, multiples for spends.

Hook Design Notes:

  • Validation: Hook contracts must validate the caller as the TokenMaster Router and confirm the token involved is valid for the hook's logic.
  • Extra Data: Hooks can receive additional contextual data through the extraData parameter for custom use cases. Validation of this data is the responsibility of the hook logic.
Flow of an order with a hook

Limit Break

TwitterLimitBreak.comMedium

© 2026 Limit Break International, Inc. All rights reserved.

Privacy PolicyTerms of ServiceCookie PolicyDo Not Sell My Info