Skip to content

Fee hook contracts: review notes #145

Description

@luiz-lvj

Grouping a set of observations about the fee hook contracts in one place, for tracking and to reduce duplicate reports. Items are summarized briefly and are not all confirmed. No severity is assigned here.

BaseDynamicAfterFee

  • Exact-output handling_afterSwap treats the unspecified amount as the output, but for exact-output swaps it is the input, so the target check and fee can be applied in the wrong direction.
  • Per-swap context in shared storage — The per-swap target is kept in shared contract storage rather than transient/per-swap storage, so a nested swap on the same hook can overwrite it; the apply flag is also not reset alongside the target.

BaseHookFee

  • Fee side on exact-output swaps — The fee is taken from the unspecified amount, which is the input on exact-output swaps, whereas the documentation describes an output-based fee.

Sources: src/fee/.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions