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
  • Loading branch information
harish551 committed Nov 20, 2023
1 parent c1592b7 commit 4b4880e
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 == false {

Check failure on line 147 in x/ics721nft/keeper.go

View workflow job for this annotation

GitHub Actions / lint

S1002: should omit comparison to bool constant, can be simplified to `!nftMetadata.Transferable` (gosimple)
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 4b4880e

Please sign in to comment.