ETH Price: $3,919.03 (+5.66%)

Contract Diff Checker

Contract Name:
ERC20

Contract Source Code:

File 1 of 1 : ERC20

/**
 * This smart contract is deployed to replace the previous DORA ERC-20
 * smart contract 0xbc4171f45EF0EF66E76F979dF021a34B46DCc81d.
 */

// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

library SafeMath {
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        assert(b <= a);
        return a - b;
    }

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

contract ERC20 {
    using SafeMath for uint256;

    string public constant name = 'Dorayaki';
    string public constant symbol = 'DORA';
    uint256 public constant decimals = 18;
    uint256 _totalSupply = 1000000000 ether;

    mapping(address => uint256) internal _balances;
    mapping(address => mapping(address => uint256)) internal _allowed;

    event Transfer(address indexed _from, address indexed _to, uint256 _value);
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);

    constructor(address _founder) {
        _balances[_founder] = _totalSupply;
    }

    function totalSupply() public view returns (uint256 supply) {
        return _totalSupply;
    }

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

    function transfer(address _to, uint256 _value) public returns (bool success) {
        require(_to != address(0), '');
        _balances[msg.sender] = _balances[msg.sender].sub(_value);
        _balances[_to] = _balances[_to].add(_value);
        emit Transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(
        address _from,
        address _to,
        uint256 _value
    ) public returns (bool success) {
        require(_to != address(0), '');
        _balances[_from] = _balances[_from].sub(_value);
        _allowed[_from][msg.sender] = _allowed[_from][msg.sender].sub(_value);
        _balances[_to] = _balances[_to].add(_value);
        emit Transfer(_from, _to, _value);
        return true;
    }

    function approve(address _spender, uint256 _value) public returns (bool success) {
        require(_allowed[msg.sender][_spender] == 0 || _value == 0);
        _allowed[msg.sender][_spender] = _value;
        emit Approval(msg.sender, _spender, _value);
        return true;
    }

    function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
        return _allowed[_owner][_spender];
    }
}

Please enter a contract address above to load the contract details and source code.

Context size (optional):