From 4b4880e68240ca18955a394d3a0da6975de5be8f Mon Sep 17 00:00:00 2001 From: Harish Marri Date: Mon, 20 Nov 2023 20:52:08 +0530 Subject: [PATCH] fix: do not allow non-transferable nfts to transfer with nft-transfer module --- x/ics721nft/keeper.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x/ics721nft/keeper.go b/x/ics721nft/keeper.go index cc92569a..c61cd6c2 100644 --- a/x/ics721nft/keeper.go +++ b/x/ics721nft/keeper.go @@ -140,6 +140,14 @@ func (k Keeper) GetNFT(ctx sdk.Context, classID, tokenID string) (nfttransfer.NF if !has { return nil, false } + nftMetadata, err := onfttypes.UnmarshalNFTMetadata(k.cdc, _nft.Data.GetValue()) + if err != nil { + return nil, false + } + if nftMetadata.Transferable == false { + k.Logger(ctx).Error("non-transferable nft") + return nil, false + } metadata, err := k.nb.BuildMetadata(_nft) if err != nil { k.Logger(ctx).Error("encode nft data failed")