基于区块链的毕业设计Token Ethereum – 令牌以太坊
本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Token Ethereum – 令牌以太坊 是一篇很好的国外资料
Token Ethereum
Creación de un token ERC 20 en truffle
Requerimientos
- Truffle
- Metamask
- Node.js
Pasos de ejecución
- Conectar metamask a la red de pruebas de goerli.
- En contracts/Token.sol edite el nombre y simbolo por el que se desea para su token.
pragma solidity 0.5.2; import '@openzeppelin/contracts/token/ERC20/ERC20Mintable.sol'; contract Token is ERC20Mintable{ string public name = "Pipe"; //aca string public symbol = "PIPE"; //aca uint8 public decimals = 2; }
- Guarde su mnemonico de Metamask en .secret
- Compile el contrato inteligente desde la terminal con truffle compile.
- Implementar en la red Goerli desde al terminal con truffle migrate –network goerli.
Interacción con truffle desde la consola
- Conexion a la red goerli desde consola truffle console –network goerli
- Revisión de cuentas
const accounts = await web3.eth.getAccounts() Para mirar las cuentas accounts accounts[0] accounts[1]
- Ver número del bloque
(await web3.eth.getBlockNumber()).toString()
- Emisión de tokens desde la consola
const token = await Token.deployed() (await token.totalSupply()).toString() accounts[0] (await token.balanceOf(accounts[0])).toString() #1000.00 tokens: token.mint(accounts[0], 100000) #agregar tokens a otra cuenta token.mint("0x7ae691C61db6B167b8C83c9801B2Aa0D19698200", 100000)
Verificar el Smart Contract Para que sea visible
npm install -D truffle-plugin-verify https://github.com/rkalis/truffle-plugin-verify Add the plugin to your truffle-config.js file module.exports = { /* ... rest of truffle-config */ plugins: [ 'truffle-plugin-verify' ] }
We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. Learn more.
We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products.
You can always update your selection by clicking Cookie Preferences at the bottom of the page. For more information, see our Privacy Statement.
Essential cookies
We use essential cookies to perform essential website functions, e.g. they’re used to log you in. Learn more
Always active
Analytics cookies
We use analytics cookies to understand how you use our websites so we can make them better, e.g. they’re used to gather information about the pages you visit and how many clicks you need to accomplish a task. Learn more
Token Ethereum
Creación de un token ERC 20 en truffle
Requerimientos
- 节点.js
- Concertar metamask a la red pruebas de goerli公司。
- En合同/令牌.soledite el nombre y simbolo por el que se desea para su代币。
Pasos de ejecución
- Guarde su mnemonico de Metamask en.secret
- 编译与终端控制相关的代码。
pragma solidity 0.5.2; import '@openzeppelin/contracts/token/ERC20/ERC20Mintable.sol'; contract Token is ERC20Mintable{ string public name = "Pipe"; //aca string public symbol = "PIPE"; //aca uint8 public decimals = 2; }
- 实施red Goerli desde al terminal con truffle迁移——网络Goerli。
- Conexion a la red goerli desde consola松露控制台——goerli
- Revisión de cuentas
Interacción con truffle desde la consola
- Ver número del bloque
- emision de la consola代币
const accounts = await web3.eth.getAccounts() Para mirar las cuentas accounts accounts[0] accounts[1]
- Ver número del bloque
(await web3.eth.getBlockNumber()).toString()
- Emisión de tokens desde la consola
const token = await Token.deployed() (await token.totalSupply()).toString() accounts[0] (await token.balanceOf(accounts[0])).toString() #1000.00 tokens: token.mint(accounts[0], 100000) #agregar tokens a otra cuenta token.mint("0x7ae691C61db6B167b8C83c9801B2Aa0D19698200", 100000)
Verificar el Smart Contract Para que sea visible
npm install -D truffle-plugin-verify https://github.com/rkalis/truffle-plugin-verify Add the plugin to your truffle-config.js file module.exports = { /* ... rest of truffle-config */ plugins: [ 'truffle-plugin-verify' ] }
我们使用可选的第三方分析Cookie了解您如何使用GitHub.com网站所以我们可以制造更好的产品。了解更多。
我们使用可选的第三方分析cookies来了解您如何使用GitHub.com网站所以我们可以制造更好的产品。
您可以通过单击页面底部的Cookie来更新您的首选项。有关更多信息,请参阅我们的隐私声明。
Essential cookies
我们使用基本Cookie来执行基本的网站功能,例如,它们用于让您登录。了解更多
Always active
Analytics cookies
我们使用analytics Cookie来了解您如何使用我们的网站,以便我们能够使其变得更好,例如,它们用于收集有关您访问的页面以及完成一项任务需要多少次单击的信息。了解更多信息元掩码
部分转自网络,侵权联系删除区块链源码网
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计Token Ethereum – 令牌以太坊