Prevent native protocol fee payout DoS - #32
Merged
Merged
Conversation
dangerousfood
marked this pull request as ready for review
August 14, 2026 17:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
forceSafeTransferETHwhen the fee token is native ETHfill,fillWithIntegratorFee,fillRoute, andfillRouteWithIntegratorFeeRoot cause
Native protocol fees used
safeTransferETH, so an owner-configured recipient with a reverting or non-payable receiver reverted the complete matched fill. The same global recipient is shared by all fills, allowing one configuration mistake to halt ETH-output execution until the owner corrected it.The fix uses Solady’s bounded-call force-transfer path only for protocol fees. If the recipient rejects the bounded call, an ephemeral contract force-delivers the exact ETH amount. Integrator recipients remain regular safe transfers because they are caller-selected and only affect the opt-in call that supplied them.
Validation
forge test --match-path test/DeepstateV1NativeETH.t.sol -vv: 19 passedmake test: 388 passedmake coverage-check: adjusted 100% lines, statements, branches, and functionsmake snapshot-runtime: 80 isolated gas tests passed; all 44 changed baselines decreased by 5-28 gas, with no increasesmake formal-smt: 1,253 complete-domain SMT obligations passedmake formal-halmos: 26 symbolic tests passedmake slither: 0 findingsforge fmt --check,forge lint,make build-size: passed; runtime size 22,589 bytes (1,987-byte margin)