Zealynx AcademyZealynx Academy
Course checkpoint

DeFi Hooks: Configuration and Trust Boundaries

Question 1 of 5Score 0/5

How many hook contracts can a Uniswap v4 pool have configured?

Review and apply

Worked answers

Try the quiz above first, then open an answer to compare your reasoning. These notes are also available to read without completing an attempt.

  1. 1. How many hook contracts can a Uniswap v4 pool have configured?

    • A.One arbitrary hook per trader on every swap.
    • B.An unlimited list changed by any caller.
    • C.Exactly one hook for each liquidity provider.
    • D.One hook contract, which may implement multiple permitted callbacks.
    Answer and explanation

    D. One hook contract, which may implement multiple permitted callbacks.

    A pool has one configured hook contract; that contract can implement several callbacks. One hook can also serve multiple pools, which makes state separation important.

  2. 2. One hook serves several pools. What deserves explicit testing?

    • A.That state, authorization and accounting for one pool cannot corrupt another pool’s behavior.
    • B.Only that both pools share a logo.
    • C.Only that the hook has a short address.
    • D.That all pools always have the same price.
    Answer and explanation

    A. That state, authorization and accounting for one pool cannot corrupt another pool’s behavior.

    Shared hook state creates a boundary to reason about. Identify how pool identity enters storage and authorization and test cross-pool sequences, not just one isolated happy path.

  3. 3. A callback is permitted by a hook’s configuration. Does that prove its implementation is safe?

    • A.Yes; permission bits constitute an audit.
    • B.No; callback permissions and implementation correctness are separate checks.
    • C.Yes; the pool manager validates the business model.
    • D.No hook callback can ever perform external work.
    Answer and explanation

    B. No; callback permissions and implementation correctness are separate checks.

    Configuration determines which callbacks may be invoked. The callback logic, external dependencies, return behavior and economic assumptions still require review.

  4. 4. When is a pool’s hook configuration selected?

    • A.Every caller substitutes a hook in their wallet.
    • B.After every swap by the highest bidder.
    • C.At pool initialization, rather than chosen freely by each swap caller.
    • D.Only after the pool is permanently closed.
    Answer and explanation

    C. At pool initialization, rather than chosen freely by each swap caller.

    The configured hook is part of the pool’s setup. Review the initialized configuration and actual contract; do not infer behavior from an unrelated hook name or frontend label.

  5. 5. A hook trusts a price returned by an external system. What should a security test include?

    • A.Only a successful call with a convenient constant.
    • B.Only an assertion that the external address is nonzero.
    • C.Only the hook’s deployment transaction cost.
    • D.Adverse or unavailable responses and the effect on the pool’s intended accounting.
    Answer and explanation

    D. Adverse or unavailable responses and the effect on the pool’s intended accounting.

    A callable external address does not establish data validity or availability. Test the failure paths and bounded assumptions that the hook actually relies on, including safe behavior when the dependency is unavailable.

Read alongside: Uniswap v4: hooks