coin

作者: 链羽 | 来源:发表于2020-08-16 00:36 被阅读0次

pragma solidity >=0.5.0 <0.7.0;

contract Coin {

    address public minter;

    mapping (address =>uint) public balances;

    event Sent(address from, address to, uint amount);

    constructor() public{

        minter =msg.sender;

    }

    function mint(address receiver,uint amount) public {

        require(msg.sender == minter);

        require(amount<1e60);

        balances[receiver]+=amount;

        emit Sent(msg.sender, receiver, amount);

    }

    function send(address receiver, uint amount) public {

        require(amount <=balances[msg.sender],"Insufficient balance.");

        balances[msg.sender] -=amount;

        balances[receiver]+=amount;

        emit Sent(msg.sender, receiver, amount);

    }

}

相关文章

  • 新加坡数字货币交易所招募经纪商及个人IB可做全球市场

    Coin&Coin永续合约正式上线交易者权益全面升级 关于Coin&Coin 多币交易所 Coin&Coin(中文...

  • coin

    pragma solidity >=0.5.0 <0.7.0; contract Coin { address...

  • 工具coin360:一眼就能看透,它在这个世界的地位

    工具coin360:一眼就能看透,它在这个世界的地位 coin360 网站coin360 各加密数字资产的可视化互...

  • 2018-05-16

    coin和token的区别? 1,从操作上来区分 打开coinmarketcap,在市值排名上选择coin或tok...

  • Coin Change

    题目You are given coins of different denominations and a to...

  • Coin Change

    题目来源一道简单的DP题,n种硬币,要求组成某个数值的硬币数最少,代码如下: 看了下讨论区,感觉可以写的更简洁一下...

  • coin change

    最简单的DP

  • coin change

    You are given coins of different denominations and a tota...

  • Coin Laundry

    那天你的硬币掉在了我身旁,我掐着腰,低着头看着你。 你低下身子去捡它,硬币被我踩到了脚下。 你的仰着头...

  • A FLIPPING COIN

    天宫上住着谁呢? 是吃人的恶魔还是善良的天使 Two Versions 第一个说的是 有一帮幸灾乐祸的小鬼 常常围...

网友评论

      本文标题:coin

      本文链接:https://www.haomeiwen.com/subject/ezwzdktx.html