Add final output guard to simple multi swaps#18
Open
sato820 wants to merge 1 commit into
Open
Conversation
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
Addresses Sonic Mast audit finding R02 from https://gist.github.com/sonic-mast/c3a352aa6b9b46dd42e36f163d9d9b2d and the AIBTC fix-PR bounty mqewgyvr5063fd520a70.
swap-simple-multialready enforcesmin-receivedper leg, but callers could not enforce a route-level output constraint for the final leg. This adds amin-final-outputargument, tracks the last leg output in the fold accumulator, and returns it asfinal-output.Changes
min-final-outputtoswap-simple-multi.ERR_MINIMUM_RECEIVED.final-outputnext to per-legresults.Verification
git diff --checkpasses.tsc --noEmitno longer reports anyswapSimpleMulti/router typing errors introduced by this change.unable to mutate url; Clarinet requires LF line endings and, on a normalized temp copy of upstreamfeat/add-latest-contractswithout this patch, fails with the same existing trait error:invalid signature for method 'get-pool-for-add' regarding trait's specification <dlmm-pool-trait>.