TRON: Deploy TRC-20 token – 部署TRC-20令牌区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,TRON: Deploy TRC-20 token – 部署TRC-20令牌区块链毕设代写 是一篇很好的国外资料

TRON: Deploy TRC-20 token

Contents

  • Environment description
  • Requirements
  • Install a tron-box
  • Initialize a tron-box project
  • Install openzeppelin-solidity
  • Add TRC20 contract code
    • Contract code
    • Initial migration code
    • Contract migration code
  • Compile smart contracts
  • Prepare network parameters for deployment
  • Deploy smart contracts
  • Quick start in Docker
  • References

Environment description

  • Deployed java-tron v4.0.1

Requirements

  • NodeJS 15.6.0

Install a tron-box

npm install -g tronbox

Initialize a tron-box project

tronbox init

Install openzeppelin-solidity

npm install openzeppelin-solidity@2.2.0 

Add TRC20 contract code

Contract code

pragma solidity 0.5.4;  import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";  contract TestCoin is ERC20 {     string public name = "Test";     string public symbol = "TST";     uint8 public decimals = 6;     uint public INITIAL_SUPPLY = 10000000000000000;      constructor() public { 	_mint(msg.sender, INITIAL_SUPPLY);     } }

Initial migration code

var Migrations = artifacts.require("./Migrations.sol");  module.exports = function(deployer) {   deployer.deploy(Migrations); };

Contract migration code

var TestCoin = artifacts.require("./TestCoin.sol");  module.exports = function(deployer) {   deployer.deploy(TestCoin); };

Compile smart contracts

tronbox compile

Prepare network parameters for deployment

Write the network parameters in the .env file.

export PRIVATE_KEY="..." export NETWORK_ID="1" export HOST_PORT=8090

Deploy smart contracts

We use the --reset parameter to completely update the contract.

source .env && tronbox migrate --reset

Quick start in Docker

docker build -t tron-deploy-trc20 .
docker run tron-deploy-trc20 -it bash

References

  1. https://github.com/tron-us/tronbox
  2. https://developers.tron.network/docs/tron-box-user-guide
  3. https://docs.openzeppelin.com/contracts/3.x/erc20

Added initial migration code.


TRON:部署TRC-20令牌

内容

  • 环境描述
  • 要求
  • 安装tron box
  • 初始化tron box项目
  • 安装openzeppelin solidity
  • 添加TRC20合同代码合同代码初始迁移代码合同迁移代码
  • 编译智能合同
  • 为部署准备网络参数部署智能合约https://github.com/tron-us/tronbox
  • https://developers.tron.network/docs/tron-box-user-guide
  • https://docs.openzeppelin.com/contracts/3.x/erc20你知道吗
  • References

环境描述

  • Deployed java-tron v4.0.1

要求

  • NodeJS 15.6.0

安装TRON-box

npm install -g tronbox

初始化TRON-box项目

tronbox init

安装openzeppelin solidity

npm install openzeppelin-solidity@2.2.0 

添加TRC20合同代码

合同代码

pragma solidity 0.5.4;  import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";  contract TestCoin is ERC20 {     string public name = "Test";     string public symbol = "TST";     uint8 public decimals = 6;     uint public INITIAL_SUPPLY = 10000000000000000;      constructor() public { 	_mint(msg.sender, INITIAL_SUPPLY);     } }

合约迁移代码

var Migrations = artifacts.require("./Migrations.sol");  module.exports = function(deployer) {   deployer.deploy(Migrations); };

编译智能合约

var TestCoin = artifacts.require("./TestCoin.sol");  module.exports = function(deployer) {   deployer.deploy(TestCoin); };

为部署准备网络参数

tronbox compile

部署智能合约

在.env文件中写入网络参数。

export PRIVATE_KEY="..." export NETWORK_ID="1" export HOST_PORT=8090

Docker中的快速入门

我们使用–reset参数来完全更新契约。

source .env && tronbox migrate --reset

参考

docker build -t tron-deploy-trc20 .
docker run tron-deploy-trc20 -it bash

References

  1. https://github.com/tron-us/tronbox
  2. https://developers.tron.network/docs/tron-box-user-guide
  3. https://docs.openzeppelin.com/contracts/3.x/erc20

Added initial migration code.

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/20164.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » TRON: Deploy TRC-20 token – 部署TRC-20令牌区块链毕设代写

提供最优质的资源集合

立即查看 了解详情