Contract 0x62e1622a47c9fe74b2cf0bade5ecb8669ff9bfbf

Txn Hash Method
Block
From
To
Value [Txn Fee]
0xd5b8fe1a03d56bf4bbcd2644a312d9f4f2f6baf55c40a2e4dc688502745d3b860x6080604024442182021-02-25 4:10:08238 days 8 hrs ago0xc393755f33ea98869c8e2ac1b8360f1c78b7c206 IN  Contract Creation0 HT0.0010024081.5
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
InitializableERC20

Compiler Version
v0.6.9+commit.3e3065ac

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Apache-2.0 license
/**
 *Submitted for verification at hecoinfo.com on 2021-02-25
*/

// File: contracts/lib/SafeMath.sol

/*

    Copyright 2020 DODO ZOO.
    SPDX-License-Identifier: Apache-2.0

*/

pragma solidity 0.6.9;


/**
 * @title SafeMath
 * @author DODO Breeder
 *
 * @notice Math operations with safety checks that revert on error
 */
library SafeMath {
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "MUL_ERROR");

        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "DIVIDING_ERROR");
        return a / b;
    }

    function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 quotient = div(a, b);
        uint256 remainder = a - quotient * b;
        if (remainder > 0) {
            return quotient + 1;
        } else {
            return quotient;
        }
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SUB_ERROR");
        return a - b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "ADD_ERROR");
        return c;
    }

    function sqrt(uint256 x) internal pure returns (uint256 y) {
        uint256 z = x / 2 + 1;
        y = x;
        while (z < y) {
            y = z;
            z = (x / z + z) / 2;
        }
    }
}

// File: contracts/external/ERC20/InitializableERC20.sol



contract InitializableERC20 {
    using SafeMath for uint256;

    string public name;
    uint256 public decimals;
    string public symbol;
    uint256 public totalSupply;

    bool public initialized;

    mapping(address => uint256) balances;
    mapping(address => mapping(address => uint256)) internal allowed;

    event Transfer(address indexed from, address indexed to, uint256 amount);
    event Approval(address indexed owner, address indexed spender, uint256 amount);

    function init(
        address _creator,
        uint256 _totalSupply,
        string memory _name,
        string memory _symbol,
        uint256 _decimals
    ) public {
        require(!initialized, "TOKEN_INITIALIZED");
        initialized = true;
        totalSupply = _totalSupply;
        balances[_creator] = _totalSupply;
        name = _name;
        symbol = _symbol;
        decimals = _decimals;
        emit Transfer(address(0), _creator, _totalSupply);
    }

    function transfer(address to, uint256 amount) public returns (bool) {
        require(to != address(0), "TO_ADDRESS_IS_EMPTY");
        require(amount <= balances[msg.sender], "BALANCE_NOT_ENOUGH");

        balances[msg.sender] = balances[msg.sender].sub(amount);
        balances[to] = balances[to].add(amount);
        emit Transfer(msg.sender, to, amount);
        return true;
    }

    function balanceOf(address owner) public view returns (uint256 balance) {
        return balances[owner];
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public returns (bool) {
        require(to != address(0), "TO_ADDRESS_IS_EMPTY");
        require(amount <= balances[from], "BALANCE_NOT_ENOUGH");
        require(amount <= allowed[from][msg.sender], "ALLOWANCE_NOT_ENOUGH");

        balances[from] = balances[from].sub(amount);
        balances[to] = balances[to].add(amount);
        allowed[from][msg.sender] = allowed[from][msg.sender].sub(amount);
        emit Transfer(from, to, amount);
        return true;
    }

    function approve(address spender, uint256 amount) public returns (bool) {
        allowed[msg.sender][spender] = amount;
        emit Approval(msg.sender, spender, amount);
        return true;
    }

    function allowance(address owner, address spender) public view returns (uint256) {
        return allowed[owner][spender];
    }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_creator","type":"address"},{"internalType":"uint256","name":"_totalSupply","type":"uint256"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint256","name":"_decimals","type":"uint256"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50610b20806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c8063313ce56711610071578063313ce567146101c357806370a08231146101cb5780637e24f904146101f157806395d89b4114610337578063a9059cbb1461033f578063dd62ed3e1461036b576100a9565b806306fdde03146100ae578063095ea7b31461012b578063158ef93e1461016b57806318160ddd1461017357806323b872dd1461018d575b600080fd5b6100b6610399565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101576004803603604081101561014157600080fd5b506001600160a01b038135169060200135610427565b604080519115158252519081900360200190f35b61015761048d565b61017b610496565b60408051918252519081900360200190f35b610157600480360360608110156101a357600080fd5b506001600160a01b0381358116916020810135909116906040013561049c565b61017b6106cd565b61017b600480360360208110156101e157600080fd5b50356001600160a01b03166106d3565b610335600480360360a081101561020757600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561023757600080fd5b82018360208201111561024957600080fd5b8035906020019184600183028401116401000000008311171561026b57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156102be57600080fd5b8201836020820111156102d057600080fd5b803590602001918460018302840111640100000000831117156102f257600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506106ee915050565b005b6100b66107da565b6101576004803603604081101561035557600080fd5b506001600160a01b038135169060200135610832565b61017b6004803603604081101561038157600080fd5b506001600160a01b038135811691602001351661098e565b6000805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561041f5780601f106103f45761010080835404028352916020019161041f565b820191906000526020600020905b81548152906001019060200180831161040257829003601f168201915b505050505081565b3360008181526006602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60045460ff1681565b60035481565b60006001600160a01b0383166104ef576040805162461bcd60e51b8152602060048201526013602482015272544f5f414444524553535f49535f454d50545960681b604482015290519081900360640190fd5b6001600160a01b038416600090815260056020526040902054821115610551576040805162461bcd60e51b81526020600482015260126024820152710848298829c868abe9c9ea8be8a9c9eaa8e960731b604482015290519081900360640190fd5b6001600160a01b03841660009081526006602090815260408083203384529091529020548211156105c0576040805162461bcd60e51b815260206004820152601460248201527308298989eae829c868abe9c9ea8be8a9c9eaa8e960631b604482015290519081900360640190fd5b6001600160a01b0384166000908152600560205260409020546105e9908363ffffffff6109b916565b6001600160a01b03808616600090815260056020526040808220939093559085168152205461061e908363ffffffff610a0216565b6001600160a01b038085166000908152600560209081526040808320949094559187168152600682528281203382529091522054610662908363ffffffff6109b916565b6001600160a01b03808616600081815260066020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60015481565b6001600160a01b031660009081526005602052604090205490565b60045460ff161561073a576040805162461bcd60e51b81526020600482015260116024820152701513d2d15397d253925512505312569151607a1b604482015290519081900360640190fd5b6004805460ff1916600117905560038490556001600160a01b0385166000908152600560209081526040822086905584516107789291860190610a4f565b50815161078c906002906020850190610a4f565b5060018190556040805185815290516001600160a01b038716916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050505050565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561041f5780601f106103f45761010080835404028352916020019161041f565b60006001600160a01b038316610885576040805162461bcd60e51b8152602060048201526013602482015272544f5f414444524553535f49535f454d50545960681b604482015290519081900360640190fd5b336000908152600560205260409020548211156108de576040805162461bcd60e51b81526020600482015260126024820152710848298829c868abe9c9ea8be8a9c9eaa8e960731b604482015290519081900360640190fd5b336000908152600560205260409020546108fe908363ffffffff6109b916565b33600090815260056020526040808220929092556001600160a01b03851681522054610930908363ffffffff610a0216565b6001600160a01b0384166000818152600560209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6000828211156109fc576040805162461bcd60e51b815260206004820152600960248201526829aaa12fa2a92927a960b91b604482015290519081900360640190fd5b50900390565b600082820183811015610a48576040805162461bcd60e51b815260206004820152600960248201526820a2222fa2a92927a960b91b604482015290519081900360640190fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610a9057805160ff1916838001178555610abd565b82800160010185558215610abd579182015b82811115610abd578251825591602001919060010190610aa2565b50610ac9929150610acd565b5090565b610ae791905b80821115610ac95760008155600101610ad3565b9056fea264697066735822122060f44f5359570f5f4e677d5c6e049a122d4c4663a0e415819ed8d733bd7e92ed64736f6c63430006090033

Deployed ByteCode Sourcemap

1572:2451:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1642:18;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3679:203;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;3679:203:0;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;1759:23;;;:::i;1724:26::-;;;:::i;:::-;;;;;;;;;;;;;;;;3093:578;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;3093:578:0;;;;;;;;;;;;;;;;;:::i;1667:23::-;;;:::i;2972:113::-;;;;;;;;;;;;;;;;-1:-1:-1;2972:113:0;-1:-1:-1;;;;;2972:113:0;;:::i;2073:488::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2073:488:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2073:488:0;;;;;;;;-1:-1:-1;2073:488:0;;-1:-1:-1;;2073:488:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2073:488:0;;-1:-1:-1;;2073:488:0;;;-1:-1:-1;2073:488:0;;-1:-1:-1;;2073:488:0:i;:::-;;1697:20;;;:::i;2569:395::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2569:395:0;;;;;;;;:::i;3890:130::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;3890:130:0;;;;;;;;;;:::i;1642:18::-;;;;;;;;;;;;;;;-1:-1:-1;;1642:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;3679:203::-;3770:10;3745:4;3762:19;;;:7;:19;;;;;;;;-1:-1:-1;;;;;3762:28:0;;;;;;;;;;;:37;;;3815;;;;;;;3745:4;;3762:28;;3770:10;;3815:37;;;;;;;;-1:-1:-1;3870:4:0;3679:203;;;;:::o;1759:23::-;;;;;;:::o;1724:26::-;;;;:::o;3093:578::-;3207:4;-1:-1:-1;;;;;3232:16:0;;3224:48;;;;;-1:-1:-1;;;3224:48:0;;;;;;;;;;;;-1:-1:-1;;;3224:48:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;3301:14:0;;;;;;:8;:14;;;;;;3291:24;;;3283:55;;;;;-1:-1:-1;;;3283:55:0;;;;;;;;;;;;-1:-1:-1;;;3283:55:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;3367:13:0;;;;;;:7;:13;;;;;;;;3381:10;3367:25;;;;;;;;3357:35;;;3349:68;;;;;-1:-1:-1;;;3349:68:0;;;;;;;;;;;;-1:-1:-1;;;3349:68:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;3447:14:0;;;;;;:8;:14;;;;;;:26;;3466:6;3447:26;:18;:26;:::i;:::-;-1:-1:-1;;;;;3430:14:0;;;;;;;:8;:14;;;;;;:43;;;;3499:12;;;;;;;:24;;3516:6;3499:24;:16;:24;:::i;:::-;-1:-1:-1;;;;;3484:12:0;;;;;;;:8;:12;;;;;;;;:39;;;;3562:13;;;;;:7;:13;;;;;3576:10;3562:25;;;;;;;:37;;3592:6;3562:37;:29;:37;:::i;:::-;-1:-1:-1;;;;;3534:13:0;;;;;;;:7;:13;;;;;;;;3548:10;3534:25;;;;;;;;:65;;;;3615:26;;;;;;;;;;;3534:13;;3615:26;;;;;;;;;;;-1:-1:-1;3659:4:0;3093:578;;;;;:::o;1667:23::-;;;;:::o;2972:113::-;-1:-1:-1;;;;;3062:15:0;3027;3062;;;:8;:15;;;;;;;2972:113::o;2073:488::-;2269:11;;;;2268:12;2260:42;;;;;-1:-1:-1;;;2260:42:0;;;;;;;;;;;;-1:-1:-1;;;2260:42:0;;;;;;;;;;;;;;;2313:11;:18;;-1:-1:-1;;2313:18:0;2327:4;2313:18;;;2342:11;:26;;;-1:-1:-1;;;;;2379:18:0;;2313:11;2379:18;;;:8;:18;;;;;;;:33;;;2423:12;;;;2313:11;2423:12;;;;:::i;:::-;-1:-1:-1;2446:16:0;;;;:6;;:16;;;;;:::i;:::-;-1:-1:-1;2473:8:0;:20;;;2509:44;;;;;;;;-1:-1:-1;;;;;2509:44:0;;;2526:1;;2509:44;;;;;;;;;2073:488;;;;;:::o;1697:20::-;;;;;;;;;;;;;;-1:-1:-1;;1697:20:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2569:395;2631:4;-1:-1:-1;;;;;2656:16:0;;2648:48;;;;;-1:-1:-1;;;2648:48:0;;;;;;;;;;;;-1:-1:-1;;;2648:48:0;;;;;;;;;;;;;;;2734:10;2725:20;;;;:8;:20;;;;;;2715:30;;;2707:61;;;;;-1:-1:-1;;;2707:61:0;;;;;;;;;;;;-1:-1:-1;;;2707:61:0;;;;;;;;;;;;;;;2813:10;2804:20;;;;:8;:20;;;;;;:32;;2829:6;2804:32;:24;:32;:::i;:::-;2790:10;2781:20;;;;:8;:20;;;;;;:55;;;;-1:-1:-1;;;;;2862:12:0;;;;;;:24;;2879:6;2862:24;:16;:24;:::i;:::-;-1:-1:-1;;;;;2847:12:0;;;;;;:8;:12;;;;;;;;;:39;;;;2902:32;;;;;;;2847:12;;2911:10;;2902:32;;;;;;;;;;-1:-1:-1;2952:4:0;2569:395;;;;:::o;3890:130::-;-1:-1:-1;;;;;3989:14:0;;;3962:7;3989:14;;;:7;:14;;;;;;;;:23;;;;;;;;;;;;;3890:130::o;982:137::-;1040:7;1073:1;1068;:6;;1060:28;;;;;-1:-1:-1;;;1060:28:0;;;;;;;;;;;;-1:-1:-1;;;1060:28:0;;;;;;;;;;;;;;;-1:-1:-1;1106:5:0;;;982:137::o;1127:161::-;1185:7;1217:5;;;1241:6;;;;1233:28;;;;;-1:-1:-1;;;1233:28:0;;;;;;;;;;;;-1:-1:-1;;;1233:28:0;;;;;;;;;;;;;;;1279:1;1127:161;-1:-1:-1;;;1127:161:0:o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o

Swarm Source

ipfs://60f44f5359570f5f4e677d5c6e049a122d4c4663a0e415819ed8d733bd7e92ed
Block Transaction Gas Used Reward
Age Block Fee Address Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading