智能合约之短地址攻击

在了解以太坊智能合约短地址攻击之前,先要简单了解一下以太坊代币ERC-20 TOKEN 的一些基础知识。ERC(EthereumRequest for Comment)即以太坊通用征求意见协议,开发者可以通过提交EIP(Ethereum Improvement Proposal以太坊改进建议),向以太坊社区提交新的ERC标准提案。ERC-20是整个加密社区中的所有标准中名气最大的,而且大多数基于以太坊平台发布的token都基于ERC-20协议。ERC-20 TOKEN标准中,提供了一些基础函数,如下:

// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
pragma solidity ^0.4.21;


contract EIP20Interface {
    /* This is a slight change to the ERC20 base standard.
    function totalSupply() constant returns (uint256 supply);
    is replaced with:
    uint256 public totalSupply;
    This automatically creates a getter function for the totalSupply.
    This is moved to the base contract since public getter functions are not
    currently recognised as an implementation of the matching abstract
    function by the compiler.
    */
    /// total amount of tokens
    uint256 publi
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值