wheezy-erc-20-token – 喘息-erc-20-token区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,wheezy-erc-20-token – 喘息-erc-20-token区块链毕设代写 是一篇很好的国外资料

wheezy-erc-20-token

Trying solidity to create an ERC-20 token.

Install truffle globally

npm install truffle -g

Init truffle project

Create a folder for your project, go inside this folder et execute the command bellow.

truffle init

Install openzeppelin

Inside your folder, excute the command bellow.

npm install @openzeppelin/contracts

Local Testing

Deployment

To test the token in local, you have to use the command line after :

truffle develop

And then execute this command in the prompt :

truffle(develop)> migrate

Testing

To test that everything is good use these command lines in order :

truffle(develop)> token = await WheezyToken.deployed()  => result :  undefined 
truffle(develop)> token.balanceOf("0xaDB0C6caD08a58A3A2A754Ced0d7AbEF8891Cc7c")  => result :  BN {   negative: 0,   words: [ 1000000, <1 empty item> ],   length: 1,   red: null } 

0xaDB0C6caD08a58A3A2A754Ced0d7AbEF8891Cc7c is the account address after the migrate command.

truffle(develop)> token.name()  => result :  'WheezyToken' 
truffle(develop)> token.symbol()  => result :  'WHZ' 

Public Etheureum Blockain Testing (Ropsten testnet)


wheezy-erc-20-token

正在尝试solidity创建一个ERC-20代币。

全局安装truffle

npm install truffle-g

初始化truffle项目

为您的项目创建一个文件夹,进入这个文件夹并执行下面的命令。

truffle init

安装openzeppelin

在文件夹中,执行下面的命令。

npm install@openzeppelin/contracts

本地测试

部署

要在本地测试令牌,必须在以下命令行之后使用命令行:

truffle develop

,然后在提示符下执行此命令:

truffle(develop)&gt;migrate

测试

要测试是否一切正常,请按顺序使用以下命令行:

truffle(develop)> token = await WheezyToken.deployed()  => result :  undefined 
truffle(develop)> token.balanceOf("0xaDB0C6caD08a58A3A2A754Ced0d7AbEF8891Cc7c")  => result :  BN {   negative: 0,   words: [ 1000000, <1 empty item> ],   length: 1,   red: null } 

0xadb0c6cad08a583aa754ced0d7abef8891cc7c是migrate命令后的帐户地址。

truffle(develop)> token.name()  => result :  'WheezyToken' 
truffle(develop)> token.symbol()  => result :  'WHZ' 

公共ethureum Blockain测试(Ropsten testnet)

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情