Skip to main content

What needs to before deploying a contract

The DO network has in-built EVM virtual machine that supports object-oriented high-level programming language - Solidity, for writing and deploying smart contracts. Contract standards such as ERC-20, ERC-721, and ERC-3525 can be published on the DO network.

Need to be familiar with​

  1. It`s necessary to be proficient in the Solidity language to use smart contract-related functions. The links to Solidity are as follows:
  1. The smart contract needs to be compiled into EVM bytecode for deployment and execution. The links related to the compilation of Solidity smart contract are as follows:
  1. Write Token, NFT, SFT and other contracts:
  1. Due to the architecture model, the contract of DO differs from the Solidity standard in the following features:
  • The basic transfer unit of DO currency in the contract is 1e-8 DO
  • The contract does not support block variables
  • The DO smart contract address does not belong to the account address, so the transaction in DO currency cannot be carried out.

familiar with compiler tools​

Take the official ERC20 code given by Ethereum as an example to understand the Remix IDE.

Writing contract Code​

  • Copy the code into the Remix IDE and create relevant documents.
    • The IEAC20.sol/REC20.sol/BNB.sol file is the original code of token file. image

Compile contract code​

  • Click the image menu in the right sidebar to enter the compiler page.
    • COMPILER is the compiled version,Automatically identify based on the file header
    • The Compiler BNB.sol button is used to edit the source code. If there are any problems with the code, it will not compile successfully
    • Compile the completed binary code, click the Bytecode button at the bottom of the operation bar to copy it image

Deployment contract code​

  • Click image menu to enter the deployment page.

    • The page Deploy button is inoperable and requires expand the DEPLOY form and the corresponding parameters to be filled in

      image

      NAME is the name of the token, SYMBOL is the token currency symbol.

    • Replace it with your own designed name and currency symbol to issue your own token.

    • Click transact button,Contract on the chain, the following shows the contract address in the Deployed/Unpinned Contracts.

      image

    • Expanding Deployed/Unpinned Contracts item shows all the callable interfaces for that contract.

      image

      Enter the corresponding parameter value to test whether the contract can be called

Need to prepare​

Deploying a contract can be done in two ways: one is to deploy the contract through the command line in the DO node validator, and the other is to deploy it with one click through the page provided by the DO browser.

Command-line deployment contract​

  1. A tradable and running node validator.
  2. An account with a certain amount of DO coins, used to pay for gas costs incurred during deployment.
  3. Smart contract source code and corresponding compilation tools.

Deploy contract on DO browser​

  1. a complete smart contract source code and corresponding compilation tools.
  2. Ark Wallet app,And the account has been generated and sufficient balance is ensured on the account to pay the deployment fee.