Contract Overview
ETH Balance: 1 Ether
No Of Transactions: 6 txns
  Latest 6 txns

TxHash Age From To Value [TxFee]
0xf28181e3a14f308ff28cf613a5a3ab74471a106f37e439425efa5c8ca0f0a0ef66 days 7 hrs ago0x58fd15b07767200953229a8a4c54d28a4a96851a  IN   0x8b7ce1f8c673032afbe7bf257685b9d5cf1912bb0 Ether0.0022486
0x90121bd5104873cad4976e643570685215d6770b1c1713f4d14b0989d642182d66 days 7 hrs ago0x162358112b34053db878696a362b4924c4375a9a  IN   0x8b7ce1f8c673032afbe7bf257685b9d5cf1912bb1 Ether0.0041893
0x78f1938e36f6b1aab831bf1449edb314fe368af23aa85ccf96c424d391aed6a466 days 7 hrs ago0xb8451e4cb76ca4967815b02b4d16cf0fadc0779c  IN   0x8b7ce1f8c673032afbe7bf257685b9d5cf1912bb0 Ether0.0081884
0xfd323531733780777b398df46fc7dc378c159439b16870cca2057bdd6b3f588166 days 7 hrs ago0xb8451e4cb76ca4967815b02b4d16cf0fadc0779c  IN   0x8b7ce1f8c673032afbe7bf257685b9d5cf1912bb0 Ether0.0064073
0xc0f186f24694dc84ecf9ce4b5e5e061e9bad01f2d84be63c23fcb95af66e32eb66 days 7 hrs ago0xb8451e4cb76ca4967815b02b4d16cf0fadc0779c  IN   0x8b7ce1f8c673032afbe7bf257685b9d5cf1912bb3 Ether0.0041652
0x12634e1db6bad16331fc7169145633f9fb41f8947b17f0b117244887c46cad8066 days 7 hrs ago0xb8451e4cb76ca4967815b02b4d16cf0fadc0779c  IN    Contract Creation0 Ether0.1049593
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
  Latest 1 Internal Transaction

ParentTxHash Block Age From To Value
0x78f1938e36f6b1aab831bf1449edb314fe368af23aa85ccf96c424d391aed6a4167072666 days 7 hrs ago0x8b7ce1f8c673032afbe7bf257685b9d5cf1912bb0x0663529218b2dc6b9118057943a81054badb4f763 Ether
[ Download CSV Export  ] 
Warning: The compiled contract might be susceptible to ZeroFunctionSelector (very low-severity), DelegateCallReturnValue (low-severity), ECRecoverMalformedInput (medium-severity) Solidity compiler bugs.

Contract Source Code Verified
Contract Name: EnjinBuyer
Compiler Version: v0.4.13+commit.fb4cb1a
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.13;


//honda dev is
//0x0DEf032533Cf84020D12C6dDB007128a2C77d775
// Enjin ICO group buyer
// Avtor: Janez

// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
  function transfer(address _to, uint256 _value) returns (bool success);
  function balanceOf(address _owner) constant returns (uint256 balance);
}

contract EnjinBuyer {
  mapping (address => uint256) public balances;
  mapping (address => uint256) public balances_after_buy;
  bool public bought_tokens;
  bool public token_set;
  bool public refunded;
  uint256 public contract_eth_value;
  bool public kill_switch;
  bytes32 password_hash = 0x8bf0720c6e610aace867eba51b03ab8ca908b665898b10faddc95a96e829539d;
  address public developer = 0xB8451e4cb76Ca4967815b02B4D16cf0fadc0779C;
  address public sale = 0x0663529218B2Dc6B9118057943A81054BadB4F76;
  ERC20 public token;
  uint256 public eth_minimum = 1 ether;

  function set_token(address _token) {
    require(msg.sender == developer);
    token = ERC20(_token);
    token_set = true;
  }

  // This function should only be called in the unfortunate case that Enjin should refund from a different address.
  function set_refunded(bool _refunded) {
    require(msg.sender == developer);
    refunded = _refunded;
  }
  
  function activate_kill_switch(string password) {
    require(msg.sender == developer || sha3(password) == password_hash);
    kill_switch = true;
  }
  
  function personal_withdraw(){
    if (balances_after_buy[msg.sender]>0 && msg.sender != sale) {
        uint256 eth_to_withdraw_after_buy = balances_after_buy[msg.sender];
        balances_after_buy[msg.sender] = 0;
        msg.sender.transfer(eth_to_withdraw_after_buy);
    }
    if (balances[msg.sender] == 0) return;
    require(msg.sender != sale);
    if (!bought_tokens || refunded) {
      uint256 eth_to_withdraw = balances[msg.sender];
      balances[msg.sender] = 0;
      msg.sender.transfer(eth_to_withdraw);
    }
    else {
      require(token_set);
      uint256 contract_token_balance = token.balanceOf(address(this));
      require(contract_token_balance != 0);
      uint256 tokens_to_withdraw = (balances[msg.sender] * contract_token_balance) / contract_eth_value;
      contract_eth_value -= balances[msg.sender];
      balances[msg.sender] = 0;
      uint256 fee = tokens_to_withdraw / 100;
      require(token.transfer(developer, fee));
      require(token.transfer(msg.sender, tokens_to_withdraw - fee));
    }
  }

  function withdraw(address user){
    require(bought_tokens || kill_switch);
    // We don't allow the crowdsale to withdraw its funds back (or anyone to do that on their behalf).
    require(user != sale);
    if (balances_after_buy[user]>0 && user != sale) {
        uint256 eth_to_withdraw_after_buy = balances_after_buy[user];
        balances_after_buy[user] = 0;
        user.transfer(eth_to_withdraw_after_buy);
    }
    if (balances[user] == 0) return;
    if (!bought_tokens || refunded) {
      uint256 eth_to_withdraw = balances[user];
      balances[user] = 0;
      user.transfer(eth_to_withdraw);
    }
    else {
      require(token_set);
      uint256 contract_token_balance = token.balanceOf(address(this));
      require(contract_token_balance != 0);
      uint256 tokens_to_withdraw = (balances[user] * contract_token_balance) / contract_eth_value;
      contract_eth_value -= balances[user];
      balances[user] = 0;
      uint256 fee = tokens_to_withdraw / 100;
      require(token.transfer(developer, fee));
      require(token.transfer(user, tokens_to_withdraw - fee));
    }
  }

  function purchase_tokens() {
    require(msg.sender == developer);
    if (this.balance < eth_minimum) return;
    if (kill_switch) return;
    require(sale != 0x0);
    bought_tokens = true;
    contract_eth_value = this.balance;
    require(sale.call.value(contract_eth_value)());
    require(this.balance==0);
  }
  
  function () payable {
    if (!bought_tokens) {
      balances[msg.sender] += msg.value;
    } else {
      // We might be getting a refund from Enjin's multisig wallet.
      // It could also be someone who has missed the buy, so we keep
      // track of this as well so that he can safely withdraw.
      // We might get the Enjin refund from another wallet, so this
      // is why we allow this behavior.
      balances_after_buy[msg.sender] += msg.value;
      if (msg.sender == sale && this.balance >= contract_eth_value) {
        refunded = true;
      }
    }
  }
}

    Contract ABI  
[{"constant":false,"inputs":[],"name":"purchase_tokens","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"refunded","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"user","type":"address"}],"name":"withdraw","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"bought_tokens","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"sale","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"token_set","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances_after_buy","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"kill_switch","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"eth_minimum","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"personal_withdraw","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"contract_eth_value","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"developer","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"set_token","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_refunded","type":"bool"}],"name":"set_refunded","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"password","type":"string"}],"name":"activate_kill_switch","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"payable":true,"type":"fallback"}]

  Contract Creation Code Switch To Opcodes View
60606040527f8bf0720c6e610aace867eba51b03ab8ca908b665898b10faddc95a96e829539d60055560068054600160a060020a031990811673b8451e4cb76ca4967815b02b4d16cf0fadc0779c1790915560078054909116730663529218b2dc6b9118057943a81054badb4f76179055670de0b6b3a7640000600955341561008757600080fd5b5b610d4f806100976000396000f300606060405236156100d55763ffffffff60e060020a6000350416630dc1819f811461016357806312f539501461017857806327e235e31461019f57806351cff8d9146101d05780636360fc3f146101f15780636ad1fe02146102185780638a7e30a1146102475780638e4cb2a91461026e578063a089feea1461029f578063a5c860ba146102c6578063bbf59a41146102eb578063c42bb1e414610300578063ca4b208b14610325578063cc63a3c914610354578063ce7ab6a714610375578063d4701c351461038f578063fc0c546a146103e2575b6101615b60025460ff16151561010857600160a060020a033316600090815260208190526040902080543401905561015d565b600160a060020a033381166000818152600160205260409020805434019055600754909116148015610146575060035430600160a060020a03163110155b1561015d576002805462ff00001916620100001790555b5b5b565b005b341561016e57600080fd5b610161610411565b005b341561018357600080fd5b61018b6104cc565b604051901515815260200160405180910390f35b34156101aa57600080fd5b6101be600160a060020a03600435166104db565b60405190815260200160405180910390f35b34156101db57600080fd5b610161600160a060020a03600435166104ed565b005b34156101fc57600080fd5b61018b610850565b604051901515815260200160405180910390f35b341561022357600080fd5b61022b610859565b604051600160a060020a03909116815260200160405180910390f35b341561025257600080fd5b61018b610868565b604051901515815260200160405180910390f35b341561027957600080fd5b6101be600160a060020a0360043516610876565b60405190815260200160405180910390f35b34156102aa57600080fd5b61018b610888565b604051901515815260200160405180910390f35b34156102d157600080fd5b6101be610891565b60405190815260200160405180910390f35b34156102f657600080fd5b610161610897565b005b341561030b57600080fd5b6101be610bdc565b60405190815260200160405180910390f35b341561033057600080fd5b61022b610be2565b604051600160a060020a03909116815260200160405180910390f35b341561035f57600080fd5b610161600160a060020a0360043516610bf1565b005b341561038057600080fd5b6101616004351515610c49565b005b341561039a57600080fd5b61016160046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610c7d95505050505050565b005b34156103ed57600080fd5b61022b610d14565b604051600160a060020a03909116815260200160405180910390f35b60065433600160a060020a0390811691161461042c57600080fd5b60095430600160a060020a03163110156104455761015d565b60045460ff16156104555761015d565b600754600160a060020a0316151561046c57600080fd5b6002805460ff19166001179055600160a060020a033081163160038190556007549091169060405160006040518083038185876187965a03f19250505015156104b457600080fd5b600160a060020a033016311561015d57600080fd5b5b565b60025462010000900460ff1681565b60006020819052908152604090205481565b600254600090819081908190819060ff168061050b575060045460ff165b151561051657600080fd5b600754600160a060020a038781169116141561053157600080fd5b600160a060020a0386166000908152600160205260408120541180156105655750600754600160a060020a03878116911614155b156105b257600160a060020a038616600081815260016020526040808220805492905590965086156108fc0290879051600060405180830381858888f1935050505015156105b257600080fd5b5b600160a060020a03861660009081526020819052604090205415156105d757610846565b60025460ff1615806105f1575060025462010000900460ff165b1561064357600160a060020a038616600081815260208190526040808220805492905590955085156108fc0290869051600060405180830381858888f19350505050151561063e57600080fd5b610846565b600254610100900460ff16151561065957600080fd5b600854600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156106b257600080fd5b6102c65a03f115156106c357600080fd5b50505060405180519350508215156106da57600080fd5b600354600160a060020a038716600090815260208190526040902054840281151561070157fe5b600160a060020a0388166000908152602081905260408120805460038054919091039055550491506064825b600854600654929091049250600160a060020a039081169163a9059cbb91168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561079957600080fd5b6102c65a03f115156107aa57600080fd5b5050506040518051905015156107bf57600080fd5b600854600160a060020a031663a9059cbb8783850360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561082057600080fd5b6102c65a03f1151561083157600080fd5b50505060405180519050151561084657600080fd5b5b5b505050505050565b60025460ff1681565b600754600160a060020a031681565b600254610100900460ff1681565b60016020526000908152604090205481565b60045460ff1681565b60095481565b600160a060020a033316600090815260016020526040812054819081908190819081901180156108d6575060075433600160a060020a03908116911614155b1561092357600160a060020a033316600081815260016020526040808220805492905590965086156108fc0290879051600060405180830381858888f19350505050151561092357600080fd5b5b600160a060020a033316600090815260208190526040902054151561094857610bd3565b60075433600160a060020a039081169116141561096457600080fd5b60025460ff16158061097e575060025462010000900460ff165b156109d057600160a060020a033316600081815260208190526040808220805492905590955085156108fc0290869051600060405180830381858888f1935050505015156109cb57600080fd5b610bd3565b600254610100900460ff1615156109e657600080fd5b600854600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610a3f57600080fd5b6102c65a03f11515610a5057600080fd5b5050506040518051935050821515610a6757600080fd5b600354600160a060020a0333166000908152602081905260409020548402811515610a8e57fe5b600160a060020a0333166000908152602081905260408120805460038054919091039055550491506064825b600854600654929091049250600160a060020a039081169163a9059cbb91168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610b2657600080fd5b6102c65a03f11515610b3757600080fd5b505050604051805190501515610b4c57600080fd5b600854600160a060020a031663a9059cbb3383850360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610bad57600080fd5b6102c65a03f11515610bbe57600080fd5b505050604051805190501515610bd357600080fd5b5b5b5050505050565b60035481565b600654600160a060020a031681565b60065433600160a060020a03908116911614610c0c57600080fd5b60088054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556002805461ff0019166101001790555b50565b60065433600160a060020a03908116911614610c6457600080fd5b6002805462ff0000191662010000831515021790555b50565b60065433600160a060020a0390811691161480610cf85750600554816040518082805190602001908083835b60208310610cc957805182525b601f199092019160209182019101610ca9565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020145b1515610d0357600080fd5b6004805460ff191660011790555b50565b600854600160a060020a0316815600a165627a7a7230582074025492a7322777d58195c12a47b8fe85bea6fdcd20ec5ec3462575c82251670029

   Swarm Source:
bzzr://74025492a7322777d58195c12a47b8fe85bea6fdcd20ec5ec3462575c8225167
View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward