Skip to content

Adding a Migration for the ERC721 Token

To deploy the contract we need a migrations file!

In the migrations folder create a new file "2_erc721.js" and insert the following content:

const Token = artifacts.require("MinimalERC721");

module.exports = function (deployer) {
  deployer.deploy(Token);
};

Then open the truffle developer network and sample migrate the token!

truffle develop

then simply

migrate

Now you can interact with your token on a developer network!

let token = await MinimalERC721.deployed();

Then you could auto-complete by pressing the tab-key and see which functions are available:

You see that we have all the transfer and balance functionality - but there is nothing where we can actually mint a token.

We have a token, but so far you can't mint and you can't collect any royalties on any platform.

After this long prologue, let's go and add the first platform: OpenSea!


Last update: March 28, 2022