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:
Get your own ERC721 contract source code.
Contract tool used: Remix
Open Remix to import the contract codeγ
the instructions indicated in the image:
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.
How to execute the contract after deployment?
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β
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 acontract.txt
file to store the compiled bytecode of the contract.After compiling the contract in Remix, paste the generated contract bytecode into this file to deploy the contract in DO.
After saving and exiting, restart the DO program in the menu bar and execute 8.Deploy contract
The default displayed address is the wallet address provided on this node, which is also the wallet address of the deployer.
Fill in the blank according to the requirements; 0 can be filled in by default.
If the initial input is a contract bytecode with no parameters,
Please enter: parameter bytecode.
Otherwise
Please enter: 0
DO Contract Executionβ
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.
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.
tips:
There are two kinds of don's addresses
- The main network account address is used for ordinary transactions.
- The contract account address is used for the transaction in the contract.
- 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.