ETH Price: $2,046.41 (-4.79%)

Transaction Decoder

Block:
6079836 at Aug-03-2018 08:44:57 AM +UTC
Transaction Fee:
0.0001918728 ETH $0.39
Gas Used:
79,947 Gas / 2.4 Gwei

Emitted Events:

55 MosesToken.Transfer( from=[Receiver] AirDropContract, to=[Sender] 0x69837c3c0ac07b83f0468df0f3e48f013d2c5a96, value=200000000000000000000 )
56 AirDropContract.FundTransfer( backer=[Sender] 0x69837c3c0ac07b83f0468df0f3e48f013d2c5a96, amount=200, isContribution=True )

Account State Difference:

  Address   Before After State Difference Code
0x3cD90241...8efc66004
0x420a4315...653a3317e
0x69837C3c...13d2c5a96
0.0004371357 Eth
Nonce: 1
0.0002452629 Eth
Nonce: 2
0.0001918728
(MiningPoolHub: Old Address)
14,833.79626288615222391 Eth14,833.79645475895222391 Eth0.0001918728

Execution Trace

AirDropContract.CALL( )
  • MosesToken.transfer( _to=0x69837C3c0AC07B83F0468DF0f3e48f013d2c5a96, _value=200000000000000000000 ) => ( True )
    File 1 of 2: AirDropContract
    pragma solidity ^0.4.24;
    
    library SafeMath {
    
        function mul(uint256 a, uint256 b) internal pure returns (uint256) {
            if (a == 0) {
                return 0;
            }
            uint256 c = a * b;
            assert(c / a == b);
            return c;
        }
    
        function div(uint256 a, uint256 b) internal pure returns (uint256) {
            // assert(b > 0); // Solidity automatically throws when dividing by 0
            uint256 c = a / b;
            // assert(a == b * c + a % b); // There is no case in which this doesn't hold
            return c;
        }
    
        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 Ownable {
    
        address public owner;
    
        constructor() public {
            owner = msg.sender;
        }
    
        modifier onlyOwner {
            require(msg.sender == owner);
            _;
        }
    
        function transferOwnership(address newOwner) onlyOwner public {
            owner = newOwner;
        }
    }
    
    contract Erc20Token {
        function balanceOf(address _owner) constant public returns (uint256);
    
        function transfer(address _to, uint256 _value) public returns (bool);
    }
    
    contract AirDropContract is Ownable {
    
        using SafeMath for uint256;
    
        Erc20Token public tokenRewardContract;
    
        uint256 public totalAirDropToken;
    
        address public collectorAddress;
    
        mapping(address => uint256) public balanceOf;
    
        event FundTransfer(address backer, uint256 amount, bool isContribution);
        event Additional(uint amount);
        event Burn(uint amount);
        event CollectAirDropTokenBack(address collectorAddress,uint256 airDropTokenNum);
    
        /**
         * Constructor function
         */
        constructor(
            address _tokenRewardContract,
            address _collectorAddress
        ) public {
            totalAirDropToken = 2e7;
            tokenRewardContract = Erc20Token(_tokenRewardContract);
            collectorAddress = _collectorAddress;
        }
    
        /**
         * Fallback function
         *
         * The function without name is the default function that is called whenever anyone sends funds to a contract
         */
        function() payable public {
            require(totalAirDropToken > 0);
            require(balanceOf[msg.sender] == 0);
            uint256 amount = getCurrentCandyAmount();
            require(amount > 0);
    
            totalAirDropToken = totalAirDropToken.sub(amount);
            balanceOf[msg.sender] = amount;
    
            tokenRewardContract.transfer(msg.sender, amount * 1e18);
            emit FundTransfer(msg.sender, amount, true);
        }
    
        function getCurrentCandyAmount() private view returns (uint256 amount){
            if (totalAirDropToken >= 10e6) {
                return 200;
            } else if (totalAirDropToken >= 2.5e6) {
                return 150;
            } else if (totalAirDropToken >= 0.5e6) {
                return 100;
            } else if (totalAirDropToken >= 50) {
                return 50;
            } else {
                return 0;
            }
        }
    
        /**
         *  Add airdrop tokens
         */
        function additional(uint256 amount) public onlyOwner {
            require(amount > 0);
    
            totalAirDropToken = totalAirDropToken.add(amount);
            emit Additional(amount);
        }
    
        /**
        *  burn airdrop tokens
        */
        function burn(uint256 amount) public onlyOwner {
            require(amount > 0);
    
            totalAirDropToken = totalAirDropToken.sub(amount);
            emit Burn(amount);
        }
    
    
        /**
         *  The owner of the contract modifies the recovery address of the token
         */
        function modifyCollectorAddress(address newCollectorAddress) public onlyOwner returns (bool) {
            collectorAddress = newCollectorAddress;
        }
    
        /**
         *  Recovery of remaining tokens
         */
        function collectAirDropTokenBack(uint256 airDropTokenNum) public onlyOwner {
            require(totalAirDropToken > 0);
            require(collectorAddress != 0x0);
    
            if (airDropTokenNum > 0) {
                tokenRewardContract.transfer(collectorAddress, airDropTokenNum * 1e18);
            } else {
                tokenRewardContract.transfer(collectorAddress, totalAirDropToken * 1e18);
                totalAirDropToken = 0;
            }
            emit CollectAirDropTokenBack(collectorAddress, airDropTokenNum);
        }
    
        /**
         *  Recovery donated ether
         */
        function collectEtherBack() public onlyOwner {
            uint256 b = address(this).balance;
            require(b > 0);
            require(collectorAddress != 0x0);
    
            collectorAddress.transfer(b);
        }
    
        /**
         *  Get the tokenAddress token balance of someone
         */
        function getTokenBalance(address tokenAddress, address who) view public returns (uint){
            Erc20Token t = Erc20Token(tokenAddress);
            return t.balanceOf(who);
        }
    
        /**
         *  Recycle other ERC20 tokens
         */
        function collectOtherTokens(address tokenContract) onlyOwner public returns (bool) {
            Erc20Token t = Erc20Token(tokenContract);
    
            uint256 b = t.balanceOf(address(this));
            return t.transfer(collectorAddress, b);
        }
    
    }

    File 2 of 2: MosesToken
    pragma solidity ^0.4.24;
    
    library SafeMath {
      function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
          return 0;
        }
        uint256 c = a * b;
        assert(c / a == b);
        return c;
      }
    
      function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // assert(b > 0); // Solidity automatically throws when dividing by 0
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
        return c;
      }
    
      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 Ownable {
      address public owner;
    
    
      event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    
    
      /**
       * @dev The Ownable constructor sets the original `owner` of the contract to the sender
       * account.
       */
      function Ownable() public {
        owner = msg.sender;
      }
    
    
      /**
       * @dev Throws if called by any account other than the owner.
       */
      modifier onlyOwner() {
        require(msg.sender == owner);
        _;
      }
    
    
      /**
       * @dev Allows the current owner to transfer control of the contract to a newOwner.
       * @param newOwner The address to transfer ownership to.
       */
      function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0));
        OwnershipTransferred(owner, newOwner);
        owner = newOwner;
      }
    
    }
    
    contract Pausable is Ownable {
      event Pause();
      event Unpause();
    
      bool public paused = false;
    
    
      /**
       * @dev Modifier to make a function callable only when the contract is not paused.
       */
      modifier whenNotPaused() {
        require(!paused);
        _;
      }
    
      /**
       * @dev Modifier to make a function callable only when the contract is paused.
       */
      modifier whenPaused() {
        require(paused);
        _;
      }
    
      /**
       * @dev called by the owner to pause, triggers stopped state
       */
      function pause() onlyOwner whenNotPaused public {
        paused = true;
        Pause();
      }
    
      /**
       * @dev called by the owner to unpause, returns to normal state
       */
      function unpause() onlyOwner whenPaused public {
        paused = false;
        Unpause();
      }
    }
    
    contract ERC20Basic {
      uint256 public totalSupply;
      function balanceOf(address who) public view returns (uint256);
      function transfer(address to, uint256 value) public returns (bool);
      event Transfer(address indexed from, address indexed to, uint256 value);
    }
    
    contract BasicToken is ERC20Basic {
      using SafeMath for uint256;
    
      mapping(address => uint256) balances;
    
      /**
      * @dev transfer token for a specified address
      * @param _to The address to transfer to.
      * @param _value The amount to be transferred.
      */
      function transfer(address _to, uint256 _value) public returns (bool) {
        require(_to != address(0));
        require(_value <= balances[msg.sender]);
    
        // SafeMath.sub will throw if there is not enough balance.
        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(_value);
        Transfer(msg.sender, _to, _value);
        return true;
      }
    
      /**
      * @dev Gets the balance of the specified address.
      * @param _owner The address to query the the balance of.
      * @return An uint256 representing the amount owned by the passed address.
      */
      function balanceOf(address _owner) public view returns (uint256 balance) {
        return balances[_owner];
      }
    
    }
    
    contract ERC20 is ERC20Basic {
      function allowance(address owner, address spender) public view returns (uint256);
      function transferFrom(address from, address to, uint256 value) public returns (bool);
      function approve(address spender, uint256 value) public returns (bool);
      event Approval(address indexed owner, address indexed spender, uint256 value);
    }
    
    contract StandardToken is ERC20, BasicToken {
    
      mapping (address => mapping (address => uint256)) internal allowed;
    
    
      /**
       * @dev Transfer tokens from one address to another
       * @param _from address The address which you want to send tokens from
       * @param _to address The address which you want to transfer to
       * @param _value uint256 the amount of tokens to be transferred
       */
      function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
        require(_to != address(0));
        require(_value <= balances[_from]);
        require(_value <= allowed[_from][msg.sender]);
    
        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(_value);
        allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
        Transfer(_from, _to, _value);
        return true;
      }
    
      /**
       * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
       *
       * Beware that changing an allowance with this method brings the risk that someone may use both the old
       * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
       * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
       * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
       * @param _spender The address which will spend the funds.
       * @param _value The amount of tokens to be spent.
       */
      function approve(address _spender, uint256 _value) public returns (bool) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
      }
    
      /**
       * @dev Function to check the amount of tokens that an owner allowed to a spender.
       * @param _owner address The address which owns the funds.
       * @param _spender address The address which will spend the funds.
       * @return A uint256 specifying the amount of tokens still available for the spender.
       */
      function allowance(address _owner, address _spender) public view returns (uint256) {
        return allowed[_owner][_spender];
      }
    
      /**
       * approve should be called when allowed[_spender] == 0. To increment
       * allowed value is better to use this function to avoid 2 calls (and wait until
       * the first transaction is mined)
       * From MonolithDAO Token.sol
       */
      function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
        allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
        Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
        return true;
      }
    
      function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
        uint oldValue = allowed[msg.sender][_spender];
        if (_subtractedValue > oldValue) {
          allowed[msg.sender][_spender] = 0;
        } else {
          allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
        }
        Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
        return true;
      }
    
    }
    
    contract PausableToken is StandardToken, Pausable {
    
      function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
        return super.transfer(_to, _value);
      }
    
      function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
        return super.transferFrom(_from, _to, _value);
      }
    
      function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
        return super.approve(_spender, _value);
      }
    
      function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
        return super.increaseApproval(_spender, _addedValue);
      }
    
      function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
        return super.decreaseApproval(_spender, _subtractedValue);
      }
    }
    
    contract MosesToken is PausableToken {
        string public name = "Moses";
        string public symbol = "MOS";
        uint public decimals = 18;
        uint public INITIAL_SUPPLY = 1000000000000000000000000000;
    
        function MosesToken() public {
            totalSupply = INITIAL_SUPPLY;
            balances[msg.sender] = INITIAL_SUPPLY;
        }
    }