Skip to main content
. 2021 May 31;21(11):3822. doi: 10.3390/s21113822
Algorithm 5 Transfer a NFT
  • 1:

    functionTransferNFT(id string)

  • 2:

         tokenReadToken(id)                            ▹ Calling Algorithm 2

  • 3:

         invokerclientGetClientIdentity().GetID()

  • 4:

         if invokerclient != token.Owner then

  • 5:

               return “The client invokerclient is not authorized to transfer token owned by token.Owner

  • 6:

         end if

  • 7:

         if token.Bid== then

  • 8:

               return “No bid yet”

  • 9:

         end if

  • 10:

       CreateNFT(token.TokenType,TRUE,token.Bid,token.availableassets)

                             ▹ Calling Algorithm 3, to create new token with buyer’s id

  • 11:

       DelState(id)                               ▹ Delete the token with seller’s id

  • 12:

    end function