Skip to content
Verified contractPartial

DogToken

Address0x58c650c12feafb0fb099fcc2da02e75ec86093aa
Balance

0 ETH

 

Transactions

6

 

Compiler

solc 0.4.24

 

Same code

5 more contracts

 

Details

Compiler
solc 0.4.24+commit.e67f0147
Language
solidity
Optimization
Yes, 200 runs
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
8,144,146
Creation transaction
0xae7bf56e72…7651c7d99f

DogToken.sol

pragma solidity 0.4.24;

contract DogToken {
    //币名字
    string public name;
    //token 标志
    string public symbol;
    ////token 小数位数
    uint public decimals;

    //转账事件通知
    event Transfer(address indexed from, address indexed to, uint256 value);

    // 创建一个数组存放所有用户的余额
    mapping(address => uint256) public balanceOf;


    /* Constructor */
    constructor (uint256 initialSupply,string tokenName, string tokenSymbol, uint8 decimalUnits) public {
        //初始发币金额(总额要去除小数位数设置的长度)
        balanceOf[msg.sender] = initialSupply;
        name = tokenName;                                 
        symbol = tokenSymbol;                               
        decimals = decimalUnits; 
    }

    //转账操作
    function transfer(address _to,uint256 _value) public {
        //检查转账是否满足条件 1.转出账户余额是否充足 2.转出金额是否大于0 并且是否超出限制
        require(balanceOf[msg.sender] >= _value && balanceOf[_to] + _value >= balanceOf[_to]);
        balanceOf[msg.sender] -= _value;
        balanceOf[_to] += _value;
        //转账通知
        emit Transfer(msg.sender, _to, _value);
    }

}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.