ERC-4907 is an extension of ERC-721. It proposes an additional role (user
) which can be granted to addresses, and a time where the role is automatically revoked (expires
). The user
role represents permission to "use" the NFT, but not the ability to transfer it or set users.
This is the beginner guide to creating and deploying a simple ERC-4907 smart contract on BNB Chain Test Network using ChainIDE, MetaMask, and Solidity.
If you have any questions, feel free to join ChainIDE Discord!
Following are the steps to deploy an ERC-4907 smart contract:
-
Install MetaMask
-
Write down an ERC-4907 smart contract
-
Compile, deploy and Verify
-
List on test.double.one
When we deploy a smart contract on the blockchain or make a transaction to the deployed smart contract, we need to pay the gas fee, and for that, we need to have a Web3 wallet, which is MetaMask. So, first of all, we'll install MetaMask.
Please click here to install MetaMask, and after installing, you need to switch Georli Test Network in MetaMask. Click here to get some dummy coins for the Georli Test Network( or google "Georli faucet").
You need to write down all the required functions that you want to implement in your ERC-4907 smart contract. A general ERC-4907 smart contract has the following functions.
-
setUser()
: set the user and expires of the NFT -
userOf()
: returns the user address of the NFT -
userExpires()
: returns the user expires of the NFT
ChainIDE team has prepared the complete ERC-4907 showcase including all the required functions, you may use that built-in template and add/delete functions according to your requirements.
These steps are the same as the ERC-721 template .
Auto-Deployment is a powerful tool on Double Protocol that enables NFT Projects or anyone to instantly deploy ‘NFT collections’ on Double Protocol to enable Rental Service for such NFTs.
Click here for details.