Skip to main content

ERC721 Deployment

This chapter introduces how to publish your NFTs product or fungible tokens on the DO mainnet. Before reading this chapter, please familiarize yourself with information about the Solidity language and the ERC721 contract standard.

Below we will introduce how to use the Remix tool to compile contract source code:

  1. Get your own ERC721 contract source code.

  2. Contract tool used: Remix

  3. Open Remix to import the contract code。

    the instructions indicated in the image: image-20230802143629861 The most important things are Contract bytecode and ABI. Contract bytecode is used to deploy contracts.

    The following demonstration shows the steps of deploying and executing contracts in Remix, which will give a good understanding of how to deploy and execute contracts in DO.

    image-20230802143750865

    How to execute the contract after deployment?

    image-20230802144303708

    The most important thing to execute a contract in DO is to get the input bytecode, which indicates which interface you need to execute in the contract and what parameters to pass.

DO Deployment Contract​

  1. When the node program starts, a folder named contract will be generated in the same level directory of the program. Enter the contract folder and create a contract.txt file to store the compiled bytecode of the contract. image-20230802144904815

  2. After compiling the contract in Remix, paste the generated contract bytecode into this file to deploy the contract in DO. image-20230802145338188

  3. After saving and exiting, restart the DO program in the menu bar and execute 8.Deploy contract image-20230802144705707

  4. The default displayed address is the wallet address provided on this node, which is also the wallet address of the deployer.

    image-20230802145534076

  5. Fill in the blank according to the requirements; 0 can be filled in by default.

    image-20230802153533519

     If the initial input is a contract bytecode with no parameters,
    Please enter: parameter bytecode.
    Otherwise
    Please enter: 0

DO Contract Execution​

  1. To execute a contract, it is necessary to first familiarize yourself with the internal parameters and methods of the contract. The following figure takes the mint function as an example to call the contract to complete NFT mint.

    image-20230802155930189

  2. Start the DO program and execute the 9.Call contract. Fill in the corresponding information according to the prompts and complete the steps of executing the contract.

    image-20230802152809992

tips:

There are two kinds of don's addresses

  1. The main network account address is used for ordinary transactions.
  2. The contract account address is used for the transaction in the contract.
  3. Ordinary transactions use the main network account address by default, and the address parameters filled in during contract transactions need to use the corresponding contract account address.