发行ETH代币

首先参考该文章 https://ethfans.org/topics/118, 且根据实际操作分享一下
当然首先要同步完区块,然后准备一点ETH(我是准备了0.02个,创建代币手续费+测试转账)。
文章中的:

这个部分所提供的代码已经不再试用,经过调整最后的代码为:

/*
This creates a public tradeable fungible token in the Ethereum Blockchain.
https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIsUnmodified this will create a cryptoasset with a fixed market cap
wholly owned by the contract creator. You can create any function
to change this contract, like allowing specific rules for the issuance,
destruction and freezing of any assets. This contract is intended for
educational purposes, you are fully responsible for compliance with
present or future regulations of finance, communications and the
universal rights of digital beings.Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.For more information, please refer to <http://unlicense.org>*/
pragma solidity ^0.4.21;
contract MyToken {/* Public variables of the token */string public name;string public symbol;uint8 public decimals;/* This creates an array with all balances */mapping (address => uint256) public balanceOf;/* This generates a public event on the blockchain that will notify clients */event Transfer(address indexed from, address indexed to, uint256 value);/* Initializes contract with initial supply tokens to the creator of the contract */function MyToken(uint256 _supply, string _name, string _symbol, uint8 _decimals) public{/* if supply not given then generate 1 million of the smallest unit of the token */if (_supply == 0) _supply = 1000000;/* Unless you add other functions these variables will never change */balanceOf[msg.sender] = _supply;name = _name;symbol = _symbol;/* If you want a divisible token then add the amount of decimals the base unit has  */decimals = _decimals;}/* Send coins */function transfer(address _to, uint256 _value) public{/* if the sender doenst have enough balance then stop */if (balanceOf[msg.sender] < _value) require(balanceOf[msg.sender] < _value);if (balanceOf[_to] + _value < balanceOf[_to]) require(balanceOf[msg.sender] < _value);/* Add and subtract new balances */balanceOf[msg.sender] -= _value;balanceOf[_to] += _value;/* Notifiy anyone listening that this transfer took place */emit Transfer(msg.sender, _to, _value);}
}

然后这个位置:

不知道是不是币名相同的原因(没有测试),反正最好是一个没有出现过的代币名称否则会失败,已经有确认的但是查不到这个币,也没法转账,并且手续费建议控制在0.01左右个,不要太少了。

这个输入的密码是你创建第一个地址(Main地址)的时候输入的密码

下面的这个操作没有进行,自动就会生成出来,版本是0-10-0的Ethereum

然后就是一个弥天大坑,就是说在输入精度的那个地方,如果你输入的是8,那么你要发的一个币就应该是1后面8个0,这样才是一个币,我就比较惨了以为填多少就是多少币结果就发0.1个币…,其实不是的根据你的精度要在实际发币的后面加上这个精度的数量,然后测试了发送之类的没有问题。


然后我用了在上一篇博客中写的方法去扫代币 https://blog.csdn.net/Day_Day_No_Bug/article/details/90698141
也没有任何问题,成功的扫到了自己发行的代币

但是不要忘记了改扫块的合约地址,在上面博客中有提到如何改,本篇结束。

基于ETH创建自己的代币相关推荐

  1. java 创建以太坊代币_以太坊 (五)编写智能合约-建立简易加密代币

    本篇文章,我们将写一个简易的加密代币的智能合约来给大家诠释加密代币的原理 启动 ganache-cli 打开终端,启动ganache-cli,相关环境在区块链学习日记(四)这篇文章里面已经有具体说明. ...

  2. 使用BCH提供的Cryptonize创建自己的加密代币

    在过去的几个月里,比特币以现金为动力的代币资产的想法一直处于许多讨论的前沿.到目前为止,在过去的几周里,我们已经看到了一系列代表性的代币创建平台,比如Bitmain的虫洞和Bitprim Keoken ...

  3. 在以太坊开发自己的ERC-20代币及如何ICO

    今天我将向你展示如何在以太坊区块链上开发你自己的加密货币并将其出售!我将向你展示如何使用以太坊智能合约逐步创建自己的ERC-20代币和众筹销售,如何测试智能合约,如何将智能合约部署到以太坊区块链,以及 ...

  4. 使用OpenZeppelin在RSK上进行ERC20代币开发

    在本文中,我们将讨论通过RSK网络部署和交互Smart-Contracts智能合约.我们的合约将是一个基于OpenZeppelin库的ERC20代币,我们将把它直接部署到Mainnet中. 创建合约 ...

  5. 用OpenZeppelin在RSK上进行以太坊ERC20代币开发

    在本文中,我们将讨论通过RSK网络部署和交互Smart-Contracts智能合约.我们的合约将是一个基于OpenZeppelin库的ERC20代币,我们将把它直接部署到Mainnet中. 创建合约 ...

  6. 酷宇宙大学:代币经济学(第四课)如何评估代币的效用?

    之前"酷宇宙"介绍了"代币经济学"一系列的教程,包括: 代币经济学(第一课)加密货币的基础知识 代币经济学(第二课)加密熊市的必备投资策略 代币经济学(第三课) ...

  7. 什么是非同质化代币(NFT)\ NFT有哪些应用?

    文章目录 什么是非同质化代币(NFT) 1.什么是同质化代币? 2. 什么是非同质化币? 3. NFT有哪些应用? 4. NFT(非同质化代币)的标准 参考 什么是非同质化代币(NFT) NFT是一个 ...

  8. 以太坊构建DApps系列教程(二):构建TNS代币

    在本系列关于使用以太坊构建DApps教程的第1部分中,我们引导大家做了两个版本的本地区块链进行开发:一个Ganache版本和一个完整的私有PoA版本. 在这一部分中,我们将深入研究并构建我们的TNS代 ...

  9. 以太坊代币空投合约的实现

    2019独角兽企业重金招聘Python工程师标准>>> 本文将介绍如何在以太坊智能合约中实现代币的空投.区块链以太坊世界中所谓空投(airdrop),就是免费给你的区块链地址(公钥) ...

最新文章

  1. tree类型题目需要用到的头文件tree.h
  2. 1-2 通过SQL管理数据库文件
  3. boost::type_erasure::equality_comparable相关的测试程序
  4. centos升级内核
  5. Web Hacking 101 中文版 十七、服务端请求伪造
  6. java后端工程师平时开发或多或少会用到Intellij idea,那么它有哪些快捷键呢
  7. 按键 使用WinHttp实现POST方式用户模拟登录网站
  8. java 中断代码_你的java代码可中断吗?(2)
  9. Huffman编码解码
  10. 微机原理与接口耿恒山答案_KYN28-12柜二次系统元器件介绍及接线应用原理(接上篇)...
  11. 若不能细水长流地书写内心的温柔,那轰轰烈烈的一幕一幕不过是日后回忆自己爱无能的证据罢了。...
  12. C#调用存储过程带输出参数或返回值分类(转)
  13. js在字符串中间插入横线
  14. Linux文件系统管理——创建与检测
  15. 科普文章:公众电磁辐射与防护的研究
  16. 国王游戏——高精度好题
  17. gui界面文本输入存入mysql中_把“文本框输入的内容”全部变成“********”,然后存入数据库,如何做到?...
  18. Halcon焊点检测例子解析
  19. 骚年,这简历一看就是包装过了
  20. 前端页面使用的icon图标

热门文章

  1. 第 1 章 程序设计基本方法
  2. Buying Hay 购买干草 完全背包
  3. 【附源码】计算机毕业设计SSM宁夏旅游信息管理系统
  4. 同步FIFO和异步FIFO的Verilog实现
  5. 命令_查看占用端口 netstat -ano|findstr 8080
  6. 小米手机线下营销方案设计(毕业作品+任务书+设计方案+成果报告书)
  7. 使用PyCharm安装mayavi
  8. Python设计模式之模版模式(16)
  9. 自媒体文章一文多发的几种方式
  10. Python数字图像处理---1.1图像的像素格式与图像读写