NFT Series

Transfer Ownership of an NFT

A guide on how to transfer the ownership of an NFT from one wallet address to another wallet

Chikku George
Coinmonks
Published in
3 min readMar 16, 2022

--

In the context of this article, we are trying to safely transfer the NFTs from one address to another on server side using the Ethers.js library and safeTransferFrom(from, to, tokenId) method of ERC-721 smart contract. All the transactions as part of this are carried out on Polygon Mumbai Testnet.

Pre — Requisites

1.Deploy your ERC-721 smart contract on any blockchain network

2. Mint an NFT based on the deployed smart contract

Now let’s see how we can transfer the NFT from one wallet address to another!

Step 1: Get some fake MATIC

As blockchain transactions are bound to gas fees, we need to collect some fake MATIC to transfer the NFT.

Get some fake MATIC from here: https://faucet.polygon.technology/.

Other MATIC faucets available:

  1. https://faucet.pearzap.com/
  2. https://matic.supply/
  3. https://www.coinclarified.com/tools/faucets/polygon
  4. https://faucet.firebird.finance/

Step 2: Create .env file

Step 3: Create nft-trasnfer.js file

Copy the following content to the file.

tokenId specifies the NFT token to transfer which you will get once you mint an NFT.

safeTransferFrom is an overloaded function. In ethers.js, the syntax to call an overloaded function is different from a non-overloaded function. You can refer to it at here.

You will get a response like below:

You can verify the transaction on mumbai polygonscan.

Transaction on Polygon Mumbai

Great! You have successfully transferred your NFT!

--

--

Chikku George
Coinmonks

Software Engineer | ReactJs | NodeJs | Blockchain Enthusiast