Skip to content

Commit

Permalink
preventing single token exit from amm (#1111)
Browse files Browse the repository at this point in the history
* preventing single token exit from amm

* Update x/amm/types/message_exit_pool.go

Co-authored-by: Amit Yadav <[email protected]>

---------

Co-authored-by: Amit Yadav <[email protected]>
  • Loading branch information
avkr003 and amityadav0 authored Jan 26, 2025
1 parent 0a4e15e commit 85992a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x/amm/types/message_exit_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package types
import (
errorsmod "cosmossdk.io/errors"
sdkmath "cosmossdk.io/math"
"errors"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
Expand Down Expand Up @@ -30,6 +31,10 @@ func (msg *MsgExitPool) ValidateBasic() error {
}
}

if msg.TokenOutDenom != "" {
return errors.New("exit in single token not allowed")
}

if msg.ShareAmountIn.IsNil() {
return ErrInvalidShareAmountOut
}
Expand Down

0 comments on commit 85992a6

Please sign in to comment.