Skip to main content

Quickstart Bridging

Prerequisites

Make sure you have installed and configured the holograph CLI before continuing.

Deploying a Collection

A Holographable Collection contract must be deployed to the blockchains of your choosing. We create a Collection Config object that is saved to your system that can be used as a reference. To get started, run the holograph create:contract command and follow the prompts. You will be asked:

  1. Enter the password of the wallet you configured
  2. Select the type of deployment to use - Select Create deployment configuration
  3. Select the primary network of the contract (does not prepend chainId to tokenIds) - Select the network on which to deploy
  4. Enter a bytes32 hash or number to use for salt hash - This is a salt value. You can use any value. We recommend 1 to start
  5. Select the bytecode type to deploy - Select CxipERC721
  6. Enter the collection name to use - Enter the Collection Name
  7. Enter the collection symbol to use - Enter the Collection Symbol
  8. Enter the percentage of royalty to collect in basepoints. (1 = 0.01%, 10000 = 100%) - Select a numerical value. You can set to 0 if desired
  9. Select the network on which the contract will be executed -
  10. Would you like to export/save the deployment config file? - Enter Y
  11. Enter the path and file where to save (ie ./deploymentConfig.json) - Enter file name, e.g., ./deploymentConfig.json
  12. Next steps submit the transaction, would you like to proceed? - Enter Y

From there, the CLI will submit a transaction and output the address of the collection (e.g., 0x8c1ed0a67176e83951bfe60a3c3b0663f96a8954). This address is required for minting NFTs.

img.png

Minting an NFT

With your collection deployed, you will now be able to mint an NFT. You will need to have the collection address, network, the IPFS hash to the metadata file.

  1. Select the network on which to mint the nft - Enter the network of the collection. Select Fuji if you are following the previous example
  2. Select the uri of the token, minus the prepend (ie "ipfs://") - Select IPFS (this can also be an HTTPS URL)
  3. Enter the uri of the token, minus the prepend (ie "ipfs://") - Enter the IPFS hash of the metadata file, e.g., QmfQhPGMAbHL31qcqAEYpSP5gXwXWQa3HZjkNVzZ2mRsRs/metadata.json
  4. Would you like to mint the following NFT? - Final check if you want to mint the NFT. Enter Y. Notice that we output a sample output for validation. The token ID will be created on-chain.

The CLI will submit a transaction and output the status of the minted NFT.

img_1.png

Deploying Collections to Additional Blockchains

To bridge an NFT between blockchains, the collection must exist on both the source and destination chains. To deploy again, run holograph create:contract, but this time select the Use existing deployment configuration option from the CLI guide.

  1. Select the type of deployment to use - Select Use existing deployment configuration from the list
  2. Use existig deployment configuration - Enter the file you created above. For example ./deploymentConfig.json
  3. Select the network on which the contract will be executed - Select a secondary network to deploy the collection. For example Mumbai
  4. Next steps submit the transaction, would you like to proceed? - Enter Y

The CLI will submit a transaction and display the results.

img_2.png

Bridging an NFT

With your collection deployed on two blockchains and an NFT minted, you will be able to call holograph bridge:nft to send it to another blockchain.

  1. Select the source network from which to beam - Select fuji. This is the blockchain on which the NFT currently exists
  2. Select the destination network which to beam to - Select mumbai. This is the blockchain to where the NFT will bridge
  3. Enter the address of the collection smart contract - Enter the collection address
  4. Enter the token ID of the NFT to beam - Enter 1 if you are following this quickstart
  5. Next steps submit the transaction, would you like to proceed? - Enter Y to submit the transaction

The CLI will submit a transaction to Fuji. After a few minutes the NFT will become available on Mumbai.

img_3.png

That's It

You have now deployed your holographable collection to multiple networks and bridged the NFT between them!