Skip to main content

7. Create and deploy NFT (ERC721) contracts

Now that the metadata is ready, you will create and deploy NFT (ERC721) contracts for the Immutable Runner fox and skins.

Set up an admin wallet

You will need an admin wallet to pay for gas to deploy smart contracts.

  1. Download the MetaMask browser wallet and follow the steps to store your seed phrase in a safe location.
  2. Go to the Immutable Hub.
  3. Click the zkEVM Faucet button in the bottom left corner of the page.
  4. Open your MetaMask browser wallet, and copy your wallet address (formatted as 0x1234...abcd) from under your account name.
  5. Paste your wallet address into the field on the Immutable Hub, and click Send $tIMX to receive 10 Test IMX.
Connected wallet faucet
  1. You now have Test IMX tImx to deploy smart contracts.

Deploy contracts using Immutable Hub

Using the Immutable Hub, you can easily create and deploy NFT contracts for the fox and skin tokens using the Immutable ERC721 preset contract.

  1. In the Collections tab, click on the Deploy contract button.
    • Create a Name for the fox NFT collection: Immutable Runner Fox
    • Create a Symbol for the collection: IMRF
    • Copy the base URL for the fox NFT from step 6 and paste it into the Base URI: https://immutable-runner-json-server.onrender.com/fox/
    • Grab the NFT collection metadata URL from step 6 and paste it into the Collection Metadata URI: https://rose-ministerial-termite-701.mypinata.cloud/ipfs/QmSjuGnQouy3tXTxYTNSMW9ft1GnTqFaXUTDrGk8L3LJzn
    • Enter the admin wallet address you created earlier as the Royalty recipient address.
    • For the purpose of this tutorial, set 5% as the Royalty fee.
    • For the minter address, let's use your admin wallet address. To do so, click on the Use connected button.
    • Leave Enable the Minting API checkbox unchecked, as you will not use it in this tutorial.
  2. Click Deploy Contract.
  3. If your admin wallet is not connected to the correct chain (i.e. IMX zkEVM Testnet for this tutorial), you will receive a prompt in Metamask asking you to switch. If prompted, click on the Switch Network button.
Metamask switch network
  1. To deploy your contract, which will require gas, you must sign a transaction with your wallet. Click Confirm to proceed.
Metamask sign to deploy
  1. You'll then be asked to sign a message with your wallet. This gasless step will link your collection to your project's environment. Click Sign to complete the linking process.
Metamask link collection
  1. Finally, you'll need to sign one more transaction with your wallet, which will cost gas. This step will assign your admin wallet the minter role, allowing it to mint tokens in the collection. Click Confirm to grant the minter role.
Metamask grant role
  1. You have successfully deployed your Immutable Runner Fox NFT contract.
    • To view your deployed contract, click the Block Explorer link.
Hub Immutable Runner Fox

Repeat the steps for the skin NFT collection.

  • Name: Immutable Runner Skin
  • Symbol: IMRS
  • Base URI: https://immutable-runner-json-server.onrender.com/skin/
  • Collection Metadata URI: https://rose-ministerial-termite-701.mypinata.cloud/ipfs/QmXAzthu432TaeUvwmPcva9C2eTzdXGRHEMVrUTRfRCrRw
  • Royalty recipient address: Your admin wallet address
  • Royalty fee: 5%
  • Minter Address: Your admin wallet address
  • Enable the Minting API: Leave unchecked
💡Manually deploy contracts
Instead of using Immutable Hub, you can launch your contracts via code by following the steps here.