Skip to content

Commit

Permalink
fix: do not allow non-transferable nfts to transfer with nft-transfer…
Browse files Browse the repository at this point in the history
… module (#114)

* fix: do not allow non-transferable nfts to transfer with nft-transfer module

* fix lint
  • Loading branch information
harish551 authored Nov 20, 2023
1 parent c1592b7 commit 4923623
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x/ics721nft/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
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")
Expand Down

0 comments on commit 4923623

Please sign in to comment.