HRC20代币和如何创建你的代币

mxkfz 2021-04-16 19:54:20 阅读数:114

本文一共[544]字,预计阅读时长:1分钟~
chrome github

HRC20 Token 标准

HECO 完全兼容以太坊 ERC20 标准,interface 和 event 如下:

// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/E...
// ----------------------------------------------------------------------------
contract ERC20Interface {

function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);

}
标准请参考:

eip-20

实现请参考:

openzeppelin-contracts

创建合约教程

1.下载MetaMask钱包

官网地址:https://metamask.io

浏览器插件下载(国内):https://ext.chrome.360.cn/web...

2.选择网络,自定义RPC

3.填入HECO网络信息

网络名称(随意填):火币生态链或Huobi ECO Chain

新增 RPC 网址:https://http-mainnet-node.huo...

链 ID:128

符号(选填):HT

区块浏览器 URL(选填): https://hecoinfo.com

4.访问HRC20网站 https://huofabi.com

版权声明:本文为[mxkfz]所创,转载请带上原文链接,感谢。 https://my.oschina.net/u/4523926/blog/5021126