ETH Price: $1,892.98 (-1.23%)

Transaction Decoder

Block:
8200553 at Jul-22-2019 12:49:39 PM +UTC
Transaction Fee:
0.0000064944 ETH $0.01
Gas Used:
21,648 Gas / 0.3 Gwei

Emitted Events:

Account State Difference:

  Address   Before After State Difference Code
0x33fc6303...d659Fb6CD
0.0006586615 Eth
Nonce: 36
0.0006521671 Eth
Nonce: 37
0.0000064944
0x3616FD03...7Cc7BB93d
(Nanopool)
4,987.817110852658420979 Eth4,987.817117347058420979 Eth0.0000064944

Execution Trace

DappToken.transfer( _to=0xd83Cf49d787DC9a56147b246d44C6622B6703fef, _value=2000000000000000000000 ) => ( success=True )
pragma solidity >=0.4.22 <0.6.0;

/**
 * @title SafeMath
 * @dev Unsigned math operations with safety checks that revert on error
 */
library SafeMath {
    /**
     * @dev Multiplies two unsigned integers, reverts on overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b);

        return c;
    }

    /**
     * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Adds two unsigned integers, reverts on overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a);

        return c;
    }

    /**
     * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
     * reverts when dividing by zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0);
        return a % b;
    }
}

contract DappToken {
    string  public name = "Block Chain Little Sister";
    string  public symbol = "BCLS";
    uint256 public totalSupply = 100000000000 * (10 ** 18);
    uint256 public decimals = 18;
    
    address public owner = 0xb2b9b6D9b0ae23C797faEa8694c8639e7BA785EB;
    address payable public beneficiary = 0xE2d19B66c02D64E8adF4D1cA8ff45679e30e4f71;
    
    uint256 public rate = 1000000;
    uint256 public zero = 2000 * (10 ** 18);
    
    using SafeMath for uint256;
    
    event Transfer(
        address indexed _from,
        address indexed _to,
        uint256 _value
    );

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

    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;
    mapping(address => bool) public registered;
    
    constructor() public {
        balanceOf[owner] = totalSupply;
        emit Transfer(address(0), owner, totalSupply);
    }

    function transfer(address _to, uint256 _value) public returns (bool success) {
        
        balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
        balanceOf[_to] = balanceOf[_to].add(_value);

        emit Transfer(msg.sender, _to, _value);

        return true;
    }

    function approve(address _spender, uint256 _value) public returns (bool success) {
        
        allowance[msg.sender][_spender] = _value;

        emit Approval(msg.sender, _spender, _value);

        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
        require(_value <= balanceOf[_from]);
        require(_value <= allowance[_from][msg.sender]);

        balanceOf[_from] = balanceOf[_from].sub(_value);
        balanceOf[_to] = balanceOf[_to].add(_value);

        allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);

        emit Transfer(_from, _to, _value);

        return true;
    }
    
    function() payable external {
        uint256 out = 0;
        if(!registered[msg.sender]) {
            out = out.add(zero);
            registered[msg.sender] = true;
        }
        
        if (msg.value > 0) {
            out = out.add(msg.value.mul(rate));
        }
        
        balanceOf[owner] = balanceOf[owner].sub(out);
        balanceOf[msg.sender] = balanceOf[msg.sender].add(out);
        
        emit Transfer(owner, msg.sender, out);
        
        if (msg.value > 0) {
            beneficiary.transfer(msg.value);
        }
    }
}