Contract Overview
ETH Balance: 0 Ether
No Of Transactions: 3 txns
  Latest 3 txns

TxHash Age From To Value [TxFee]
0x098470374750c643c997f74ed2a5ed7e28b815262b6574bbef6f385d5a6230b36 days 13 hrs ago0xa6b688c110e21239f8ac46103f4700f66ab7e8cd  IN   0x72a035517c9df836143a46b0c0747a7f1ba59e150 Ether0.00057468
0xfe983338a325602856e39864c194a4eb769882c033a3e45fa096b1e270db3ebc11 days 13 hrs ago0xa6b688c110e21239f8ac46103f4700f66ab7e8cd  IN   0x72a035517c9df836143a46b0c0747a7f1ba59e150 Ether0.00172992
0xd048a25bd3f9cb9c77a48e4875f3faf22fb756dd228f55c27cb811640c414c6411 days 13 hrs ago0xa6b688c110e21239f8ac46103f4700f66ab7e8cd  IN    Contract Creation0 Ether0.02211424
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Warning: The compiled contract might be susceptible to ZeroFunctionSelector (very low-severity) Solidity compiler bugs.

Contract Source Code Verified
Contract Name: JBXICO
Compiler Version: v0.4.15+commit.bbb8e64f
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
//
// compiler: solcjs -o ./build/contracts --optimize --abi --bin <this file>
//  version: 0.4.15+commit.bbb8e64f.Emscripten.clang
//
pragma solidity ^0.4.15;

contract owned {
  address public owner;

  function owned() { owner = msg.sender; }

  modifier onlyOwner {
    if (msg.sender != owner) { revert(); }
    _;
  }

  function changeOwner( address newowner ) onlyOwner {
    owner = newowner;
  }

  function closedown() onlyOwner {
    selfdestruct( owner );
  }
}

// "extern" declare functions from token contract
interface JBX {
  function transfer(address to, uint256 value);
  function balanceOf( address owner ) constant returns (uint);
}

contract JBXICO is owned {

  uint public constant STARTTIME = 1510099200; // 08 NOV 2017 00:00 GMT
  uint public constant ENDTIME = 1512691200;   // 08 DEC 2017 00:00 GMT
  uint public constant JBXPERETH = 1500;       // price: approx $0.20 ea

  JBX public tokenSC;

  function JBXICO() {}

  function setToken( address tok ) {
    tokenSC = JBX(tok);
  }

  function() payable {
    if (now < STARTTIME || now > ENDTIME)
      revert();

    // (amountinwei/weipereth * jbx/eth) * ( (100 + bonuspercent)/100 )
    // = amountinwei*jbxpereth/weipereth*(bonus+100)/100
    uint qty =
      div(mul(div(mul(msg.value, JBXPERETH),1000000000000000000),(bonus()+100)),100);

    if (qty > tokenSC.balanceOf(address(this)) || qty < 1)
      revert();

    tokenSC.transfer( msg.sender, qty );
  }

  // unsold tokens can be claimed by owner after sale ends
  function claimUnsold() onlyOwner {
    if ( now < ENDTIME )
      revert();

    tokenSC.transfer( owner, tokenSC.balanceOf(address(this)) );
  }

  function withdraw( uint amount ) onlyOwner returns (bool) {
    if (amount <= this.balance)
      return owner.send( amount );

    return false;
  }

  function bonus() constant returns(uint) {
    uint elapsed = now - STARTTIME;

    if (elapsed < 48 hours) return 50;
    if (elapsed < 2 weeks) return 20;
    if (elapsed < 3 weeks) return 10;
    if (elapsed < 4 weeks) return 5;
    return 0;
  }

  // ref:
  // github.com/OpenZeppelin/zeppelin-solidity/
  // blob/master/contracts/math/SafeMath.sol
  function mul(uint256 a, uint256 b) constant returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) constant returns (uint256) {
    uint256 c = a / b;
    return c;
  }
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"tok","type":"address"}],"name":"setToken","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"withdraw","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"JBXPERETH","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"bonus","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"ENDTIME","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"closedown","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"div","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newowner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"tokenSC","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"mul","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"STARTTIME","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"claimUnsold","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"}]

  Contract Creation Code Switch To Opcodes View
6060604052341561000f57600080fd5b5b5b60008054600160a060020a03191633600160a060020a03161790555b5b5b6107008061003e6000396000f300606060405236156100a95763ffffffff60e060020a600035041663144fa6d781146102015780632e1a7d4d146102225780633d4123961461024c57806375b4d78c14610271578063850d9afb146102965780638da5cb5b146102bb578063955ef429146102ea578063a391c15b146102ff578063a6f9dae11461032a578063c16849c01461034b578063c8a4ac9c1461037a578063cfd7ab91146103a5578063dad72332146103ca575b5b6000635a0249004210806100c15750635a29d60042115b156100cb57600080fd5b6101056100fe6100ee6100e0346105dc6103df565b670de0b6b3a764000061040e565b6100f661042a565b6064016103df565b606461040e565b600154909150600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561016157600080fd5b6102c65a03f1151561017257600080fd5b505050604051805190508111806101895750600181105b1561019357600080fd5b600154600160a060020a031663a9059cbb338360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156101e957600080fd5b6102c65a03f115156101fa57600080fd5b5050505b50005b341561020c57600080fd5b610220600160a060020a036004351661048d565b005b341561022d57600080fd5b6102386004356104b9565b604051901515815260200160405180910390f35b341561025757600080fd5b61025f61051f565b60405190815260200160405180910390f35b341561027c57600080fd5b61025f61042a565b60405190815260200160405180910390f35b34156102a157600080fd5b61025f610525565b60405190815260200160405180910390f35b34156102c657600080fd5b6102ce61052d565b604051600160a060020a03909116815260200160405180910390f35b34156102f557600080fd5b61022061053c565b005b341561030a57600080fd5b61025f60043560243561040e565b60405190815260200160405180910390f35b341561033557600080fd5b610220600160a060020a0360043516610568565b005b341561035657600080fd5b6102ce6105b0565b604051600160a060020a03909116815260200160405180910390f35b341561038557600080fd5b61025f6004356024356103df565b60405190815260200160405180910390f35b34156103b057600080fd5b61025f6105bf565b60405190815260200160405180910390f35b34156103d557600080fd5b6102206105c7565b005b60008282028315806103fb57508284828115156103f857fe5b04145b151561040357fe5b8091505b5092915050565b600080828481151561041c57fe5b0490508091505b5092915050565b6000635a0248ff1942016202a3008110156104485760329150610489565b6212750081101561045c5760149150610489565b621baf8081101561047057600a9150610489565b6224ea008110156104845760059150610489565b600091505b5090565b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b6000805433600160a060020a039081169116146104d557600080fd5b600160a060020a03301631821161051557600054600160a060020a031682156108fc0283604051600060405180830381858888f193505050509050610519565b5060005b5b919050565b6105dc81565b635a29d60081565b600054600160a060020a031681565b60005433600160a060020a0390811691161461055757600080fd5b600054600160a060020a0316ff5b5b565b60005433600160a060020a0390811691161461058357600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600154600160a060020a031681565b635a02490081565b60005433600160a060020a039081169116146105e257600080fd5b635a29d6004210156105f357600080fd5b60015460008054600160a060020a039283169263a9059cbb9291169083906370a082319030906040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561065e57600080fd5b6102c65a03f1151561066f57600080fd5b5050506040518051905060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156106bc57600080fd5b6102c65a03f115156106cd57600080fd5b5050505b5b5600a165627a7a7230582032e6337b4247ed746f3ec98bb8108a44647de0b7771de66bb5264ed917180c660029

   Swarm Source:
bzzr://32e6337b4247ed746f3ec98bb8108a44647de0b7771de66bb5264ed917180c66
View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward