Skip to content

BaseCustomAccounting: the share supply is stale while the callback pays the caller #164

Description

@gonzaotc

removeLiquidity burns the shares after _modifyLiquidity returns, so the supply outlives the reserves that back it.

BaseCustomCurve.unlockCallback burns the ERC-6909 claims, then pays the caller, which hands execution to the recipient of a native transfer or to the token contract otherwise. The claims are already post-withdrawal at that point and totalSupply is not, so any contract pricing the hook's shares reads reserves against a supply that no longer corresponds to them. The larger the withdrawal, the further the reported price falls below the true one.

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