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. Navigate to Tutorial Testnet that was set up from step 2
    • From the Immutable Hub, you can navigate the path bar to Tutorial Testnet i.e. Default Organisation / Immutable Runner Tutorial / Tutorial Testnet
  2. You should be in the Contracts tab, if not select Contracts from the left sidebar. Then click on the Deploy contract button.
    • From the Presets deploy ERC-721
    • 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 Contract URI from step 6 and paste it into the Contract 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. Depending on the environment you have i.e. OS and Browser. You may need to open MetaMask to approve requests/connections manually. It is recommended that MetaMask is pinned so you are aware of their notifications.
    • Leave Enable the Minting API checkbox unchecked, as you will not use it in this tutorial.
  3. Click Deploy ERC721.
  4. 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 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.
💡MANDATORY COMPLIANCE

To make sure that creators receive their hard earned loyalties, Immutable requires that all collections of ERC-721/1155s deployed on Immutable zkEVM implement the Operator Allowlist. Not implementing will have these effects for your collection (i.e. ERC-721/1155s):

  1. You may forfeit any token grants you may have received.
  2. Passport users will receive a warnings that your collection is likely to be counterfeit.
  3. Your collection will not appear on any of the 3rd party marketplaces in our ecosystem.

For more information on the Operator Allowlist, please see this guide.