Skip to content

feat: add optional max swap tax amount hook input#19

Merged
crypto-banker merged 4 commits intomainfrom
feat/add-optional-max-swap-tax-amount
Mar 25, 2026
Merged

feat: add optional max swap tax amount hook input#19
crypto-banker merged 4 commits intomainfrom
feat/add-optional-max-swap-tax-amount

Conversation

@crypto-banker
Copy link
Copy Markdown
Contributor

@crypto-banker crypto-banker commented Mar 19, 2026

Takes advantage of the previously-unused hookData param input to the beforeSwap() hook, which is named optionalMaxSwapTax for clarity.

If non-empty optionalMaxSwapTax is supplied, then it is decoded as a uint and compared to the calculated swap tax amount; reversion with a SwapTaxExceedsSpecifiedMax error will occur if the swap tax amount exceeds the specified value.

If an empty optionalMaxSwapTax is supplied then there is no change from the prior behavior -- no attempt is made at decoding and the swap proceeds as normal.

Takes advantage of the previously-unused `hookData` param input to the `beforeSwap()` hook, which is named `optionalMaxSwapTax` for clarity.

*If* non-empty `optionalMaxSwapTax` is supplied, then it is decoded as a uint and compared to the calculated swap tax amount; reversion with a `SwapTaxExceedsSpecifiedMax` error will occur if the swap tax amount exceeds the specified value
Comment thread src/AngstromL2.sol
Copy link
Copy Markdown
Contributor

@xenide xenide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. Once we have the base case test case I think we can merge

Comment thread test/AngstromL2.t.sol
@crypto-banker crypto-banker merged commit bb724a6 into main Mar 25, 2026
4 checks passed
@crypto-banker crypto-banker deleted the feat/add-optional-max-swap-tax-amount branch March 25, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants