diff --git a/x/auction/keeper/debt.go b/x/auction/keeper/debt.go index 94e0d960c..b98a0b4da 100644 --- a/x/auction/keeper/debt.go +++ b/x/auction/keeper/debt.go @@ -196,7 +196,11 @@ func (k Keeper) closeDebtAuction( if err != nil { return err } - err = k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, sdk.AccAddress(bidding.Bidder), sdk.NewCoins(debtAuction.ExpectedUserToken)) + bidder, err := sdk.AccAddressFromBech32(bidding.Bidder) + if err != nil { + panic(err) + } + err = k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, bidder, sdk.NewCoins(debtAuction.ExpectedUserToken)) if err != nil { return err } diff --git a/x/auction/keeper/dutch.go b/x/auction/keeper/dutch.go index d6b95db6b..0039649ae 100644 --- a/x/auction/keeper/dutch.go +++ b/x/auction/keeper/dutch.go @@ -295,10 +295,14 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, appID, auctionMappingID, a // if inflow token current amount >= InflowTokenTargetAmount if auction.InflowTokenCurrentAmount.IsGTE(auction.InflowTokenTargetAmount) { // send left overcollateral to vault owner as target cmst reached and also + vaultHolder, err := sdk.AccAddressFromBech32(lockedVault.Owner) + if err != nil { + panic(err) + } total := auction.OutflowTokenCurrentAmount if total.Amount.GT(sdk.ZeroInt()) { - err := k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, sdk.AccAddress(lockedVault.Owner), sdk.NewCoins(total)) + err := k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, vaultHolder, sdk.NewCoins(total)) if err != nil { return err } diff --git a/x/auction/keeper/dutch_lend.go b/x/auction/keeper/dutch_lend.go index d7aab6363..1fd7bf67b 100644 --- a/x/auction/keeper/dutch_lend.go +++ b/x/auction/keeper/dutch_lend.go @@ -266,8 +266,12 @@ func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingI // if inflow token current amount >= InflowTokenTargetAmount if auction.InflowTokenCurrentAmount.IsGTE(auction.InflowTokenTargetAmount) { total := auction.OutflowTokenCurrentAmount + vaultHolder, err := sdk.AccAddressFromBech32(lockedVault.Owner) + if err != nil { + panic(err) + } if total.Amount.GT(sdk.ZeroInt()) { - err = k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, sdk.AccAddress(lockedVault.Owner), sdk.NewCoins(total)) + err = k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, vaultHolder, sdk.NewCoins(total)) if err != nil { return err }