Dynamic NFT Metadata on Polybase
HC
![](https://framerusercontent.com/images/GZU5C1yaW3KCwExwOtbQxxs.jpg?scale-down-to=4096)
Shaki
•
Mar 24, 2023
With dynamic NFT metadata stored on Polybase, you can build new kinds of utility or gaming NFTs that need faster and cheaper NFT metadata updates. Here’s a step-by-step walkthrough of how you can store your NFT metadata using Polybase.
Create an ERC-721 token
Open a terminal and make a directory for building your ERC-721 token.
![directory-terminal](https://framerusercontent.com/images/sWtDo6x7Y71gy4oLziozJZv6aw.png)
Navigate into the nftMetadata directory, install the following dependencies
![install-dependencies](https://framerusercontent.com/images/xmfr0R3iro3fqsb0mocLee8NvR0.png)
Under the contracts folder, create a new file "myToken.sol" and add the following code to it.
![myToken.sol](https://framerusercontent.com/images/PAqXArOw7OjL7yHknqoOsMRRlo.png)
Update the truffle-config.js file with the following code.
![edit-truffle.js](https://framerusercontent.com/images/eZByXahqXU7NkCOHEYYhFNgSsJw.png)
You should store your Mnemonic phrase & Infura API key in the .env file that you need to create in this repository!
Your .env file would look like this.
![Your-dotenv-file](https://framerusercontent.com/images/6OYSycMvTxNY0zFuQrbzEDCnMI.png)
Compile and deploy your contracts
![compile-smart-contract](https://framerusercontent.com/images/QH5PbIYPlmItcRB6fnEZoZpg.png)
Once you have compiled the smart contract we need to migrate it over to the Goerli network! Add a new file 1_deploy_contract.js under the migrations folder and update it with the following script.
![migration-script](https://framerusercontent.com/images/UkTBeBejzb9nlTFQjZYFYlaHPI.png)
Now save this code, navigate to the terminal, and type in the following command.
![migrate-network](https://framerusercontent.com/images/YsCvcpdUv594sRgZdlCfa33C3c.png)
This would deploy your NFT in the Goerli test network. Make sure you recharge your Goerli testnet wallet before migrating it.
Creating a collection in Polybase
Now login to Polybase Explorer & add create a new app. You would be taken to the default boilerplate. Remove that code and paste the code given below. You can find this code in our docs.
![polybase-collection-schema](https://framerusercontent.com/images/SP2PJjfHDaaAlhKLJPk9SjtIPA.png)
Save the collection. Once you have done this head over to your terminal.
Install Polybase SDK
![install-polybase-sdk](https://framerusercontent.com/images/FbscKV7JoVj9GgRpD19PMexXtGs.png)
Add a mintnft.js file to your directory.
![define-values-of-metadata](https://framerusercontent.com/images/tCwNymzyc2SQeAa89ziawDt3U.png)
Navigate to the terminal and run this command.
![mint-nft.js](https://framerusercontent.com/images/06yiMQYI0Hs3dWyyHW3QxJuDSU.png)
Kudos! You have created your first record in the Polybase database. Here's a video where Shaki walks you through how to store your NFT metadata on Polybase.