ETH Price: $2,611.47 (+0.64%)

Contract

0x2706165B57E8D91f0282a4fa919B810E8103Ab86
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim Tokens84660562019-09-01 19:03:141816 days ago1567364594IN
0x2706165B...E8103Ab86
0 ETH0.000067163
Claim Tokens84660562019-09-01 19:03:141816 days ago1567364594IN
0x2706165B...E8103Ab86
0 ETH0.000048471
Claim Tokens80094952019-06-22 18:24:281887 days ago1561227868IN
0x2706165B...E8103Ab86
0 ETH0.000096952
Claim Tokens76374702019-04-25 15:57:201945 days ago1556207840IN
0x2706165B...E8103Ab86
0 ETH0.000145423
Claim Tokens73997042019-03-19 14:12:531982 days ago1553004773IN
0x2706165B...E8103Ab86
0 ETH0.0004847610
Claim Tokens73570872019-03-12 22:48:471989 days ago1552430927IN
0x2706165B...E8103Ab86
0 ETH0.000022381
Claim Tokens73570782019-03-12 22:45:531989 days ago1552430753IN
0x2706165B...E8103Ab86
0 ETH0.000048471
Claim Tokens73341162019-03-09 9:06:531993 days ago1552122413IN
0x2706165B...E8103Ab86
0 ETH0.000145423
Claim Tokens72906572019-03-02 14:07:331999 days ago1551535653IN
0x2706165B...E8103Ab86
0 ETH0.000145423
Claim Tokens72887112019-03-02 6:55:242000 days ago1551509724IN
0x2706165B...E8103Ab86
0 ETH0.000242385
Claim Tokens72771112019-02-28 3:24:302002 days ago1551324270IN
0x2706165B...E8103Ab86
0 ETH0.000242385
Claim Tokens72770652019-02-28 3:10:132002 days ago1551323413IN
0x2706165B...E8103Ab86
0 ETH0.000242385
Claim Tokens72670322019-02-25 18:53:552004 days ago1551120835IN
0x2706165B...E8103Ab86
0 ETH0.000242385
Claim Tokens72629272019-02-24 19:38:162005 days ago1551037096IN
0x2706165B...E8103Ab86
0 ETH0.000242385
Claim Tokens71260442019-01-25 22:11:002035 days ago1548454260IN
0x2706165B...E8103Ab86
0 ETH0.000096952
Claim Tokens71254632019-01-25 19:31:252035 days ago1548444685IN
0x2706165B...E8103Ab86
0 ETH0.000096952
Claim Tokens71239522019-01-25 12:21:312036 days ago1548418891IN
0x2706165B...E8103Ab86
0 ETH0.000290856
Claim Tokens71152422019-01-23 19:08:412037 days ago1548270521IN
0x2706165B...E8103Ab86
0 ETH0.000145423
Claim Tokens71117862019-01-23 2:41:272038 days ago1548211287IN
0x2706165B...E8103Ab86
0 ETH0.000145423
Claim Tokens70898172019-01-19 0:03:182042 days ago1547856198IN
0x2706165B...E8103Ab86
0 ETH0.000145423
Claim Tokens70866582019-01-18 10:33:162043 days ago1547807596IN
0x2706165B...E8103Ab86
0 ETH0.00038788
Claim Tokens70789412019-01-17 1:22:242044 days ago1547688144IN
0x2706165B...E8103Ab86
0 ETH0.000044772
Claim Tokens70789392019-01-17 1:22:072044 days ago1547688127IN
0x2706165B...E8103Ab86
0 ETH0.000096952
Claim Tokens70759842019-01-16 12:52:332045 days ago1547643153IN
0x2706165B...E8103Ab86
0 ETH0.000145423
Claim Tokens70721682019-01-15 20:05:242045 days ago1547582724IN
0x2706165B...E8103Ab86
0 ETH0.000058651.21
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Babylon

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-10-24
*/

pragma solidity ^0.4.24;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
    // Gas optimization: this is cheaper than asserting '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;
    }

    c = _a * _b;
    assert(c / _a == _b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  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 _a / _b;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
    assert(_b <= _a);
    return _a - _b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
    c = _a + _b;
    assert(c >= _a);
    return c;
  }
}

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  event OwnershipRenounced(address indexed previousOwner);
  event OwnershipTransferred(
    address indexed previousOwner,
    address indexed newOwner
  );


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() 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 relinquish control of the contract.
   * @notice Renouncing to ownership will leave the contract without an owner.
   * It will not be possible to call the functions with the `onlyOwner`
   * modifier anymore.
   */
  function renounceOwnership() public onlyOwner {
    emit OwnershipRenounced(owner);
    owner = address(0);
  }

  /**
   * @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 {
    _transferOwnership(_newOwner);
  }

  /**
   * @dev Transfers control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function _transferOwnership(address _newOwner) internal {
    require(_newOwner != address(0));
    emit OwnershipTransferred(owner, _newOwner);
    owner = _newOwner;
  }
}

/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * See https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
  function totalSupply() public view returns (uint256);
  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);
}

/**
 * @title Basic token
 * @dev Basic version of StandardToken, with no allowances.
 */
contract BasicToken is ERC20Basic {
  using SafeMath for uint256;

  mapping(address => uint256) internal balances;

  uint256 internal totalSupply_;

  /**
  * @dev Total number of tokens in existence
  */
  function totalSupply() public view returns (uint256) {
    return totalSupply_;
  }

  /**
  * @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(_value <= balances[msg.sender]);
    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;
  }

  /**
  * @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) {
    return balances[_owner];
  }

}

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
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
  );
}

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure.
 * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
  function safeTransfer(
    ERC20Basic _token,
    address _to,
    uint256 _value
  )
    internal
  {
    require(_token.transfer(_to, _value));
  }

  function safeTransferFrom(
    ERC20 _token,
    address _from,
    address _to,
    uint256 _value
  )
    internal
  {
    require(_token.transferFrom(_from, _to, _value));
  }

  function safeApprove(
    ERC20 _token,
    address _spender,
    uint256 _value
  )
    internal
  {
    require(_token.approve(_spender, _value));
  }
}


/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * https://github.com/ethereum/EIPs/issues/20
 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
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(_value <= balances[_from]);
    require(_value <= allowed[_from][msg.sender]);
    require(_to != address(0));

    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
    emit 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;
    emit 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];
  }

  /**
   * @dev Increase the amount of tokens that an owner allowed to a 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
   * @param _spender The address which will spend the funds.
   * @param _addedValue The amount of tokens to increase the allowance by.
   */
  function increaseApproval(
    address _spender,
    uint256 _addedValue
  )
    public
    returns (bool)
  {
    allowed[msg.sender][_spender] = (
      allowed[msg.sender][_spender].add(_addedValue));
    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

  /**
   * @dev Decrease the amount of tokens that an owner allowed to a spender.
   * approve should be called when allowed[_spender] == 0. To decrement
   * allowed value is better to use this function to avoid 2 calls (and wait until
   * the first transaction is mined)
   * From MonolithDAO Token.sol
   * @param _spender The address which will spend the funds.
   * @param _subtractedValue The amount of tokens to decrease the allowance by.
   */
  function decreaseApproval(
    address _spender,
    uint256 _subtractedValue
  )
    public
    returns (bool)
  {
    uint256 oldValue = allowed[msg.sender][_spender];
    if (_subtractedValue >= oldValue) {
      allowed[msg.sender][_spender] = 0;
    } else {
      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
    }
    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

}

/**
 * @title Mintable token
 * @dev Simple ERC20 Token example, with mintable token creation
 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
 */
contract MintableToken is StandardToken, Ownable {
  event Mint(address indexed to, uint256 amount);
  event MintFinished();

  bool public mintingFinished = false;


  modifier canMint() {
    require(!mintingFinished);
    _;
  }

  modifier hasMintPermission() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev Function to mint tokens
   * @param _to The address that will receive the minted tokens.
   * @param _amount The amount of tokens to mint.
   * @return A boolean that indicates if the operation was successful.
   */
  function mint(
    address _to,
    uint256 _amount
  )
    public
    hasMintPermission
    canMint
    returns (bool)
  {
    totalSupply_ = totalSupply_.add(_amount);
    balances[_to] = balances[_to].add(_amount);
    emit Mint(_to, _amount);
    emit Transfer(address(0), _to, _amount);
    return true;
  }

  /**
   * @dev Function to stop minting new tokens.
   * @return True if the operation was successful.
   */
  function finishMinting() public onlyOwner canMint returns (bool) {
    mintingFinished = true;
    emit MintFinished();
    return true;
  }
}


/**
 * @title MintAndBurnToken
 *
 * @dev StandardToken that is mintable and burnable
 */
contract MintAndBurnToken is MintableToken {

  // -----------------------------------
  // BURN FUNCTIONS
  // https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC20/BurnableToken.sol
  // -----------------------------------

  event Burn(address indexed burner, uint256 value);

  /**
   * @dev Burns a specific amount of tokens.
   * @param _value The amount of token to be burned.
   */
  function burn(uint256 _value) public {
    _burn(msg.sender, _value);
  }

  function _burn(address _who, uint256 _value) internal {
    require(_value <= balances[_who], "must have balance greater than burn value");
    // no need to require value <= totalSupply, since that would imply the
    // sender's balance is greater than the totalSupply, which *should* be an assertion failure

    balances[_who] = balances[_who].sub(_value);
    totalSupply_ = totalSupply_.sub(_value);
    emit Burn(_who, _value);
    emit Transfer(_who, address(0), _value);
  }
}


/**
 * @title BabyloniaToken
 */
contract BabyloniaToken is MintAndBurnToken {

  // DetailedERC20 variables
  string public name = "Babylonia Token";
  string public symbol = "BBY";
  uint8 public decimals = 18;
}

/**
 * @title EthPriceOracleI
 * @dev Interface for interacting with MakerDAO's on-chain price oracle
 */
contract EthPriceOracleI {
    function compute() public view returns (bytes32, bool);
}

/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
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() public onlyOwner whenNotPaused {
    paused = true;
    emit Pause();
  }

  /**
   * @dev called by the owner to unpause, returns to normal state
   */
  function unpause() public onlyOwner whenPaused {
    paused = false;
    emit Unpause();
  }
}

/**
 * @title Babylon
 *
 * @dev This contract manages the exchange of Helbiz tokens for Babylonia tokens, with a locking period
 * in place before tokens can be claimed
 */
contract Babylon is Pausable {
  using SafeMath for uint256;
  using SafeERC20 for BabyloniaToken;

  event TokenExchangeCreated(address indexed recipient, uint amount, uint releasedAt);
  event TokenExchangeReleased(address indexed recipient);

  BabyloniaToken private babyloniaToken;
  StandardToken private helbizToken;
  EthPriceOracleI private ethPriceOracle;

  uint public INITIAL_CIRCULATION_BBY = 80000000; // the amount of BBY tokens available for the token swap
  uint public MIN_EXCHANGE_BBY = SafeMath.mul(1000, 10**18); // minimum amount of BBY tokens for an exchange

  uint public exchangeRate;          // HBZ tokens we receive per BBY
  uint8 public usdCentsExchangeRate; // USD cents we receive per BBY
  uint32 public exchangeLockTime;    // time (seconds) after an exchange before the sender can claim their BBY tokens
  uint public babyloniaTokensLocked; // the amount of BBY tokens locked for exchange
  bool public ethExchangeEnabled;    // whether we are accepting ETH for BBY

  struct TokenExchange {
    address recipient; // the address to receive BBY in exchange for HBZ
    uint amountHBZ;    // amount in HBZ
    uint amountBBY;    // amount in BBY
    uint amountWei;    // amount in Wei
    uint createdAt;    // datetime created
    uint releasedAt;   // datetime when BBY can be redeemed
  }

  mapping(address => uint) private activeTokenExchanges;
  TokenExchange[] private tokenExchanges;

  modifier activeTokenExchange() {
    require(activeTokenExchanges[msg.sender] != 0, "must be an active token exchange");
    _;
  }

  modifier noActiveTokenExchange() {
    require(activeTokenExchanges[msg.sender] == 0, "must not have an active token exchange");
    _;
  }

  modifier whenEthEnabled() {
    require(ethExchangeEnabled);
    _;
  }

  /**
   * Contract constructor
   * Instantiates instance of HelbizCoin (HBZ) and BabyloniaToken (BBY) contracts
   * Sets the cap for the total circulation
   * Mints 50% of the cap for this contract
   * @param _helbizCoinAddress Address of deployed HelbizCoin contract
   * @param _babyloniaTokenAddress Address of deployed BabyloniaToken contract
   * @param _ethPriceOracleAddress Address of deployed EthPriceOracle contract
   * @param _exchangeRate x HBZ => 1 BBY rate
   * @param _exchangeLockTime Number of seconds the exchanged BBY tokens are locked up for
   */
  constructor(
    address _helbizCoinAddress,
    address _babyloniaTokenAddress,
    address _ethPriceOracleAddress,
    uint8 _exchangeRate,
    uint8 _usdCentsExchangeRate,
    uint32 _exchangeLockTime
  ) public {
    helbizToken = StandardToken(_helbizCoinAddress);
    babyloniaToken = BabyloniaToken(_babyloniaTokenAddress);
    ethPriceOracle = EthPriceOracleI(_ethPriceOracleAddress);
    exchangeRate = _exchangeRate;
    usdCentsExchangeRate = _usdCentsExchangeRate;
    exchangeLockTime = _exchangeLockTime;
    paused = true;

    // take care of zero-index for storage array
    tokenExchanges.push(TokenExchange({
      recipient: address(0),
      amountHBZ: 0,
      amountBBY: 0,
      amountWei: 0,
      createdAt: 0,
      releasedAt: 0
    }));
  }

  /**
   * Do not accept ETH
   */
  function() public payable {
    require(msg.value == 0, "not accepting ETH");
  }

  /**
   * Transfers all of this contract's owned HBZ to the given address
   * @param _to The address to transfer this contract's HBZ to
   */
  function withdrawHBZ(address _to) external onlyOwner {
    require(_to != address(0), "invalid _to address");
    require(helbizToken.transfer(_to, helbizToken.balanceOf(address(this))));
  }

  /**
   * Transfers all of this contract's ETH to the given address
   * @param _to The address to transfer all this contract's ETH to
   */
  function withdrawETH(address _to) external onlyOwner {
    require(_to != address(0), "invalid _to address");
    _to.transfer(address(this).balance);
  }

  /**
   * Transfers all of this contract's BBY MINUS locked tokens to the given address
   * @param _to The address to transfer BBY to
   * @param _amountBBY The amount of BBY to transfer
   */
  function withdrawBBY(address _to, uint _amountBBY) external onlyOwner {
    require(_to != address(0), "invalid _to address");
    require(_amountBBY > 0, "_amountBBY must be greater than 0");
    require(babyloniaToken.transfer(_to, _amountBBY));
  }

  /**
   * Burns the remainder of BBY owned by this contract MINUS locked tokens
   */
  function burnRemainderBBY() public onlyOwner {
    uint amountBBY = SafeMath.sub(babyloniaToken.balanceOf(address(this)), babyloniaTokensLocked);
    babyloniaToken.burn(amountBBY);
  }

  /**
   * Sets a new exchange rate
   * @param _newRate 1 BBY => _newRate
   */
  function setExchangeRate(uint8 _newRate) external onlyOwner {
    require(_newRate > 0, "new rate must not be 0");
    exchangeRate = _newRate;
  }

  /**
   * Sets the exchange rate in USD cents (for ETH payments)
   * @param _newRate 1 BBY => _newRate
   */
  function setUSDCentsExchangeRate(uint8 _newRate) external onlyOwner {
    require(_newRate > 0, "new rate must not be 0");
    usdCentsExchangeRate = _newRate;
  }

  /**
   * Sets a new exchange lock time
   * @param _newLockTime Number of seconds the exchanged BBY tokens are locked up for
   */
  function setExchangeLockTime(uint32 _newLockTime) external onlyOwner {
    require(_newLockTime > 0, "new lock time must not be 0");
    exchangeLockTime = _newLockTime;
  }

  /**
   * Sets whether we are accepting ETH for the exchange
   * @param _enabled Is ETH enabled
   */
  function setEthExchangeEnabled(bool _enabled) external onlyOwner {
    ethExchangeEnabled = _enabled;
  }

  /**
   * Return the address of the BabyloniaToken contract
   */
  function getTokenAddress() public view returns(address) {
    return address(babyloniaToken);
  }

  /**
   * Transfers HBZ from the sender equal to _amountHBZ to this contract and creates a record for TokenExchange
   * NOTE: the address must have already approved the transfer with hbzToken.approve()
   * @param _amountHBZ Amount of HBZ tokens
   */
  function exchangeTokens(uint _amountHBZ) public whenNotPaused noActiveTokenExchange {
    // sanity check
    require(_amountHBZ >= MIN_EXCHANGE_BBY, "_amountHBZ must be greater than or equal to MIN_EXCHANGE_BBY");

    // the contract must have enough tokens - considering the locked ones
    uint amountBBY = SafeMath.div(_amountHBZ, exchangeRate);
    uint contractBalanceBBY = babyloniaToken.balanceOf(address(this));
    require(SafeMath.sub(contractBalanceBBY, babyloniaTokensLocked) >= amountBBY, "contract has insufficient BBY");

    // transfer the HBZ tokens to this contract
    require(helbizToken.transferFrom(msg.sender, address(this), _amountHBZ));

    _createExchangeRecord(_amountHBZ, amountBBY, 0);
  }

  /**
   * Accepts ETH in exchange for BBY tokens and creates a record for TokenExchange
   * NOTE: this function can only be called when the contract is paused, preventing sales in ETH during the token swap
   * @param _amountBBY Amount of BBY tokens
   */
  function exchangeEth(uint _amountBBY) public whenNotPaused whenEthEnabled noActiveTokenExchange payable {
    // sanity check
    require(_amountBBY > 0, "_amountBBY must be greater than 0");

    bytes32 val;
    (val,) = ethPriceOracle.compute();
    // divide to get the number of cents in 1 ETH
    uint256 usdCentsPerETH = SafeMath.div(uint256(val), 10**16);

    // calculate the price of BBY in Wei
    uint256 priceInWeiPerBBY = SafeMath.div(10**18, SafeMath.div(usdCentsPerETH, usdCentsExchangeRate));

    // total cost in Wei for _amountBBY
    uint256 totalPriceInWei = SafeMath.mul(priceInWeiPerBBY, _amountBBY);

    // ensure the user sent enough funds and that we have enough BBY
    require(msg.value >= totalPriceInWei, "Insufficient ETH value");
    require(SafeMath.sub(babyloniaToken.balanceOf(address(this)), babyloniaTokensLocked) >= _amountBBY, "contract has insufficient BBY");

    // refund any overpayment
    if (msg.value > totalPriceInWei) msg.sender.transfer(msg.value - totalPriceInWei);

    _createExchangeRecord(0, _amountBBY, totalPriceInWei);
  }

  /**
   * Transfers BBY tokens to the sender
   */
  function claimTokens() public whenNotPaused activeTokenExchange {
    TokenExchange storage tokenExchange = tokenExchanges[activeTokenExchanges[msg.sender]];
    uint amountBBY = tokenExchange.amountBBY;

    // assert that we're past the lock period
    /* solium-disable-next-line security/no-block-members */
    require(block.timestamp >= tokenExchange.releasedAt, "not past locking period");

    // decrease the counter
    babyloniaTokensLocked = SafeMath.sub(babyloniaTokensLocked, tokenExchange.amountBBY);

    // delete from storage and lookup
    delete tokenExchanges[activeTokenExchanges[msg.sender]];
    delete activeTokenExchanges[msg.sender];

    // transfer BBY tokens to the sender
    babyloniaToken.safeTransfer(msg.sender, amountBBY);

    emit TokenExchangeReleased(msg.sender);
  }

  /**
   * Return the id of the owned active token exchange
   */
  function getActiveTokenExchangeId() public view activeTokenExchange returns(uint) {
    return activeTokenExchanges[msg.sender];
  }

  /**
   * Returns a token exchange with the given id
   * @param _id the id of the record to retrieve (optional)
   */
  function getActiveTokenExchangeById(uint _id)
    public
    view
    returns(
      address recipient,
      uint amountHBZ,
      uint amountBBY,
      uint amountWei,
      uint createdAt,
      uint releasedAt
    )
  {
    // sanity check
    require(tokenExchanges[_id].recipient != address(0));

    TokenExchange storage tokenExchange = tokenExchanges[_id];

    recipient = tokenExchange.recipient;
    amountHBZ = tokenExchange.amountHBZ;
    amountBBY = tokenExchange.amountBBY;
    amountWei = tokenExchange.amountWei;
    createdAt = tokenExchange.createdAt;
    releasedAt = tokenExchange.releasedAt;
  }

  /**
   * Returns the number of token exchanges in the storage array
   * NOTE: the length will be inaccurate as we are deleting array elements, leaving gaps
   */
  function getTokenExchangesCount() public view onlyOwner returns(uint) {
    return tokenExchanges.length;
  }

  /**
   * Creates a record for the token exchange
   * @param _amountHBZ The amount of HBZ tokens
   * @param _amountBBY The amount of BBY tokens
   * @param _amountWei The amount of Wei (optional - in place of _amountHBZ)
   */
  function _createExchangeRecord(uint _amountHBZ, uint _amountBBY, uint _amountWei) internal {
    /* solium-disable-next-line security/no-block-members */
    uint releasedAt = SafeMath.add(block.timestamp, exchangeLockTime);
    TokenExchange memory tokenExchange = TokenExchange({
      recipient: msg.sender,
      amountHBZ: _amountHBZ,
      amountBBY: _amountBBY,
      amountWei: _amountWei,
      createdAt: block.timestamp, // solium-disable-line security/no-block-members, whitespace
      releasedAt: releasedAt
    });
    // add to storage and lookup
    activeTokenExchanges[msg.sender] = tokenExchanges.push(tokenExchange) - 1;

    // increase the counter
    babyloniaTokensLocked = SafeMath.add(babyloniaTokensLocked, _amountBBY);

    emit TokenExchangeCreated(msg.sender, _amountHBZ, releasedAt);
  }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"getTokenAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newRate","type":"uint8"}],"name":"setUSDCentsExchangeRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"babyloniaTokensLocked","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newRate","type":"uint8"}],"name":"setExchangeRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"exchangeRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_amountHBZ","type":"uint256"}],"name":"exchangeTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"claimTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getActiveTokenExchangeId","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"getActiveTokenExchangeById","outputs":[{"name":"recipient","type":"address"},{"name":"amountHBZ","type":"uint256"},{"name":"amountBBY","type":"uint256"},{"name":"amountWei","type":"uint256"},{"name":"createdAt","type":"uint256"},{"name":"releasedAt","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"}],"name":"withdrawHBZ","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"}],"name":"withdrawETH","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newLockTime","type":"uint32"}],"name":"setExchangeLockTime","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"INITIAL_CIRCULATION_BBY","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"burnRemainderBBY","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"ethExchangeEnabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_enabled","type":"bool"}],"name":"setEthExchangeEnabled","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_amountBBY","type":"uint256"}],"name":"exchangeEth","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"exchangeLockTime","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amountBBY","type":"uint256"}],"name":"withdrawBBY","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getTokenExchangesCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MIN_EXCHANGE_BBY","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"usdCentsExchangeRate","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_helbizCoinAddress","type":"address"},{"name":"_babyloniaTokenAddress","type":"address"},{"name":"_ethPriceOracleAddress","type":"address"},{"name":"_exchangeRate","type":"uint8"},{"name":"_usdCentsExchangeRate","type":"uint8"},{"name":"_exchangeLockTime","type":"uint32"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"recipient","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"releasedAt","type":"uint256"}],"name":"TokenExchangeCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"recipient","type":"address"}],"name":"TokenExchangeReleased","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

60806040526000805460a060020a60ff02191690556304c4b400600455620000406103e8670de0b6b3a76400006401000000006200197f6200025582021704565b6005553480156200005057600080fd5b5060405160c08062001d368339810160408181528251602080850151838601516060808801516080808a015160a09a8b01516000805460028054600160a060020a0319908116600160a060020a039d8e16179091556001805482169a8d169a909a178a55600380548216998d169990991790985560ff95861660069081556007805460ff1916979095169690961764ffffffff00191661010063ffffffff909416939093029290921790925574010000000000000000000000000000000000000000339187169190911760a060020a60ff02191617815560c08a018952808a52958901868152978901868152928901868152908901868152998901868152600b8054968701815590965297517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9949091029384018054909316951694909417905592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba84015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb83015591517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbc82015591517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbd830155517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbe9091015562000288565b6000821515620002685750600062000282565b508181028183828115156200027957fe5b04146200028257fe5b92915050565b611a9e80620002986000396000f3006080604052600436106101505763ffffffff60e060020a60003504166310fe9ae881146101a857806317852f2d146101d957806325bc9722146101f457806330b1921d1461021b5780633ba0b9a9146102365780633f4ba83a1461024b578063404771261461026057806348c54b9d1461027857806349d074261461028d5780635c975abb146102a25780636082258f146102cb578063619f326214610320578063690d832014610341578063715018a6146103625780638456cb59146103775780638652805e1461038c5780638c3693eb146103aa5780638da5cb5b146103bf578063928a2d8f146103d4578063a81f1c4b146103e9578063aaf7d5b4146103fe578063b001796514610418578063bb5bc87f14610423578063c5a75a6d14610451578063c87a737e14610475578063f2fde38b1461048a578063fd0193fe146104ab578063fe86801c146104c0575b34156101a6576040805160e560020a62461bcd02815260206004820152601160248201527f6e6f7420616363657074696e6720455448000000000000000000000000000000604482015290519081900360640190fd5b005b3480156101b457600080fd5b506101bd6104eb565b60408051600160a060020a039092168252519081900360200190f35b3480156101e557600080fd5b506101a660ff600435166104fa565b34801561020057600080fd5b50610209610582565b60408051918252519081900360200190f35b34801561022757600080fd5b506101a660ff60043516610588565b34801561024257600080fd5b50610209610602565b34801561025757600080fd5b506101a6610608565b34801561026c57600080fd5b506101a660043561067e565b34801561028457600080fd5b506101a6610952565b34801561029957600080fd5b50610209610b49565b3480156102ae57600080fd5b506102b7610bc3565b604080519115158252519081900360200190f35b3480156102d757600080fd5b506102e3600435610bd3565b60408051600160a060020a0390971687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b34801561032c57600080fd5b506101a6600160a060020a0360043516610c75565b34801561034d57600080fd5b506101a6600160a060020a0360043516610df8565b34801561036e57600080fd5b506101a6610ea9565b34801561038357600080fd5b506101a6610f15565b34801561039857600080fd5b506101a663ffffffff60043516610f90565b3480156103b657600080fd5b50610209611027565b3480156103cb57600080fd5b506101bd61102d565b3480156103e057600080fd5b506101a661103c565b3480156103f557600080fd5b506102b761115d565b34801561040a57600080fd5b506101a66004351515611166565b6101a6600435611190565b34801561042f57600080fd5b506104386114e2565b6040805163ffffffff9092168252519081900360200190f35b34801561045d57600080fd5b506101a6600160a060020a03600435166024356114f3565b34801561048157600080fd5b5061020961168e565b34801561049657600080fd5b506101a6600160a060020a03600435166116ad565b3480156104b757600080fd5b506102096116cd565b3480156104cc57600080fd5b506104d56116d3565b6040805160ff9092168252519081900360200190f35b600154600160a060020a031690565b600054600160a060020a0316331461051157600080fd5b600060ff82161161056c576040805160e560020a62461bcd02815260206004820152601660248201527f6e65772072617465206d757374206e6f74206265203000000000000000000000604482015290519081900360640190fd5b6007805460ff191660ff92909216919091179055565b60085481565b600054600160a060020a0316331461059f57600080fd5b600060ff8216116105fa576040805160e560020a62461bcd02815260206004820152601660248201527f6e65772072617465206d757374206e6f74206265203000000000000000000000604482015290519081900360640190fd5b60ff16600655565b60065481565b600054600160a060020a0316331461061f57600080fd5b60005460a060020a900460ff16151561063757600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b60008054819060a060020a900460ff161561069857600080fd5b336000908152600a602052604090205415610723576040805160e560020a62461bcd02815260206004820152602660248201527f6d757374206e6f74206861766520616e2061637469766520746f6b656e20657860448201527f6368616e67650000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6005548310156107a3576040805160e560020a62461bcd02815260206004820152603c60248201527f5f616d6f756e7448425a206d7573742062652067726561746572207468616e2060448201527f6f7220657175616c20746f204d494e5f45584348414e47455f42425900000000606482015290519081900360840190fd5b6107af836006546116dc565b6001546040805160e060020a6370a082310281523060048201529051929450600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b15801561080257600080fd5b505af1158015610816573d6000803e3d6000fd5b505050506040513d602081101561082c57600080fd5b505160085490915082906108419083906116f3565b1015610897576040805160e560020a62461bcd02815260206004820152601d60248201527f636f6e74726163742068617320696e73756666696369656e7420424259000000604482015290519081900360640190fd5b600254604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690529051600160a060020a03909216916323b872dd916064808201926020929091908290030181600087803b15801561090a57600080fd5b505af115801561091e573d6000803e3d6000fd5b505050506040513d602081101561093457600080fd5b5051151561094157600080fd5b61094d83836000611705565b505050565b60008054819060a060020a900460ff161561096c57600080fd5b336000908152600a602052604090205415156109d2576040805160e560020a62461bcd02815260206004820181905260248201527f6d75737420626520616e2061637469766520746f6b656e2065786368616e6765604482015290519081900360640190fd5b336000908152600a6020526040902054600b805490919081106109f157fe5b906000526020600020906006020191508160020154905081600501544210151515610a66576040805160e560020a62461bcd02815260206004820152601760248201527f6e6f742070617374206c6f636b696e6720706572696f64000000000000000000604482015290519081900360640190fd5b610a7660085483600201546116f3565b600855336000908152600a6020526040902054600b80549091908110610a9857fe5b600091825260208083206006909202909101805473ffffffffffffffffffffffffffffffffffffffff191681556001808201849055600282018490556003820184905560048201849055600590910183905533808452600a90925260408320929092559054610b1a91600160a060020a0391909116908363ffffffff6118e516565b60405133907f3f3b096b9d4e4698e0611d075803fe0595c28eb0ea20d54bf89789ac0f7b508490600090a25050565b336000908152600a60205260408120541515610baf576040805160e560020a62461bcd02815260206004820181905260248201527f6d75737420626520616e2061637469766520746f6b656e2065786368616e6765604482015290519081900360640190fd5b50336000908152600a602052604090205490565b60005460a060020a900460ff1681565b600080600080600080600080600160a060020a0316600b89815481101515610bf757fe5b6000918252602090912060069091020154600160a060020a03161415610c1c57600080fd5b600b805489908110610c2a57fe5b6000918252602090912060069091020180546001820154600283015460038401546004850154600590950154600160a060020a039094169d929c50909a509850919650945092505050565b600054600160a060020a03163314610c8c57600080fd5b600160a060020a0381161515610cec576040805160e560020a62461bcd02815260206004820152601360248201527f696e76616c6964205f746f206164647265737300000000000000000000000000604482015290519081900360640190fd5b6002546040805160e060020a6370a082310281523060048201529051600160a060020a039092169163a9059cbb91849184916370a082319160248083019260209291908290030181600087803b158015610d4557600080fd5b505af1158015610d59573d6000803e3d6000fd5b505050506040513d6020811015610d6f57600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a03909316600484015260248301919091525160448083019260209291908290030181600087803b158015610dbe57600080fd5b505af1158015610dd2573d6000803e3d6000fd5b505050506040513d6020811015610de857600080fd5b50511515610df557600080fd5b50565b600054600160a060020a03163314610e0f57600080fd5b600160a060020a0381161515610e6f576040805160e560020a62461bcd02815260206004820152601360248201527f696e76616c6964205f746f206164647265737300000000000000000000000000604482015290519081900360640190fd5b604051600160a060020a03821690303180156108fc02916000818181858888f19350505050158015610ea5573d6000803e3d6000fd5b5050565b600054600160a060020a03163314610ec057600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a03163314610f2c57600080fd5b60005460a060020a900460ff1615610f4357600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a03163314610fa757600080fd5b600063ffffffff821611611005576040805160e560020a62461bcd02815260206004820152601b60248201527f6e6577206c6f636b2074696d65206d757374206e6f7420626520300000000000604482015290519081900360640190fd5b6007805463ffffffff9092166101000264ffffffff0019909216919091179055565b60045481565b600054600160a060020a031681565b60008054600160a060020a0316331461105457600080fd5b6001546040805160e060020a6370a0823102815230600482015290516110d992600160a060020a0316916370a082319160248083019260209291908290030181600087803b1580156110a557600080fd5b505af11580156110b9573d6000803e3d6000fd5b505050506040513d60208110156110cf57600080fd5b50516008546116f3565b600154604080517f42966c68000000000000000000000000000000000000000000000000000000008152600481018490529051929350600160a060020a03909116916342966c689160248082019260009290919082900301818387803b15801561114257600080fd5b505af1158015611156573d6000803e3d6000fd5b5050505050565b60095460ff1681565b600054600160a060020a0316331461117d57600080fd5b6009805460ff1916911515919091179055565b6000805481908190819060a060020a900460ff16156111ae57600080fd5b60095460ff1615156111bf57600080fd5b336000908152600a60205260409020541561124a576040805160e560020a62461bcd02815260206004820152602660248201527f6d757374206e6f74206861766520616e2061637469766520746f6b656e20657860448201527f6368616e67650000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600085116112c8576040805160e560020a62461bcd02815260206004820152602160248201527f5f616d6f756e74424259206d7573742062652067726561746572207468616e2060448201527f3000000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600354604080517f1a43c3380000000000000000000000000000000000000000000000000000000081528151600160a060020a0390931692631a43c338926004808401939192918290030181600087803b15801561132557600080fd5b505af1158015611339573d6000803e3d6000fd5b505050506040513d604081101561134f57600080fd5b5051935061136484662386f26fc100006116dc565b60075490935061138b90670de0b6b3a76400009061138690869060ff166116dc565b6116dc565b9150611397828661197f565b9050348111156113f1576040805160e560020a62461bcd02815260206004820152601660248201527f496e73756666696369656e74204554482076616c756500000000000000000000604482015290519081900360640190fd5b6001546040805160e060020a6370a082310281523060048201529051879261144792600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b1580156110a557600080fd5b101561149d576040805160e560020a62461bcd02815260206004820152601d60248201527f636f6e74726163742068617320696e73756666696369656e7420424259000000604482015290519081900360640190fd5b803411156114d65760405133903483900380156108fc02916000818181858888f193505050501580156114d4573d6000803e3d6000fd5b505b61115660008683611705565b600754610100900463ffffffff1681565b600054600160a060020a0316331461150a57600080fd5b600160a060020a038216151561156a576040805160e560020a62461bcd02815260206004820152601360248201527f696e76616c6964205f746f206164647265737300000000000000000000000000604482015290519081900360640190fd5b600081116115e8576040805160e560020a62461bcd02815260206004820152602160248201527f5f616d6f756e74424259206d7573742062652067726561746572207468616e2060448201527f3000000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561165757600080fd5b505af115801561166b573d6000803e3d6000fd5b505050506040513d602081101561168157600080fd5b50511515610ea557600080fd5b60008054600160a060020a031633146116a657600080fd5b50600b5490565b600054600160a060020a031633146116c457600080fd5b610df5816119a8565b60055481565b60075460ff1681565b600081838115156116e957fe5b0490505b92915050565b6000828211156116ff57fe5b50900390565b600061170f611a32565b600754611728904290610100900463ffffffff16611a25565b6040805160c0810182523380825260208083018a81528385018a8152606085018a8152426080870190815260a08701898152600b8054600181018255600091825289517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db960068302908101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039093169290921790915596517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba88015594517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb87015592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbc86015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbd850155517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbe90930192909255928152600a909152929092209190915560085491935091506118a19085611a25565b6008556040805186815260208101849052815133927f63ded6bbd0aa99c1f9c4314412d34d217c380bc2fcf4b4f09cf479f22b11274f928290030190a25050505050565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561194857600080fd5b505af115801561195c573d6000803e3d6000fd5b505050506040513d602081101561197257600080fd5b5051151561094d57600080fd5b6000821515611990575060006116ed565b508181028183828115156119a057fe5b04146116ed57fe5b600160a060020a03811615156119bd57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b818101828110156116ed57fe5b60c0604051908101604052806000600160a060020a03168152602001600081526020016000815260200160008152602001600081526020016000815250905600a165627a7a723058209c57525e0434e35b11f2bd5d9d6f61262fa9d6f7e19ef019149feb5a3b0871300029000000000000000000000000e34e1944e776f39b9252790a0527ebda647ae6680000000000000000000000004f8a05b6163f2fdbd4ef1555b8ac1ad845d56ff5000000000000000000000000724dd897afa7ae9634a0569b9e2f78143fea68e30000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000007800000000000000000000000000000000000000000000000000000000003b5380

Deployed Bytecode

0x6080604052600436106101505763ffffffff60e060020a60003504166310fe9ae881146101a857806317852f2d146101d957806325bc9722146101f457806330b1921d1461021b5780633ba0b9a9146102365780633f4ba83a1461024b578063404771261461026057806348c54b9d1461027857806349d074261461028d5780635c975abb146102a25780636082258f146102cb578063619f326214610320578063690d832014610341578063715018a6146103625780638456cb59146103775780638652805e1461038c5780638c3693eb146103aa5780638da5cb5b146103bf578063928a2d8f146103d4578063a81f1c4b146103e9578063aaf7d5b4146103fe578063b001796514610418578063bb5bc87f14610423578063c5a75a6d14610451578063c87a737e14610475578063f2fde38b1461048a578063fd0193fe146104ab578063fe86801c146104c0575b34156101a6576040805160e560020a62461bcd02815260206004820152601160248201527f6e6f7420616363657074696e6720455448000000000000000000000000000000604482015290519081900360640190fd5b005b3480156101b457600080fd5b506101bd6104eb565b60408051600160a060020a039092168252519081900360200190f35b3480156101e557600080fd5b506101a660ff600435166104fa565b34801561020057600080fd5b50610209610582565b60408051918252519081900360200190f35b34801561022757600080fd5b506101a660ff60043516610588565b34801561024257600080fd5b50610209610602565b34801561025757600080fd5b506101a6610608565b34801561026c57600080fd5b506101a660043561067e565b34801561028457600080fd5b506101a6610952565b34801561029957600080fd5b50610209610b49565b3480156102ae57600080fd5b506102b7610bc3565b604080519115158252519081900360200190f35b3480156102d757600080fd5b506102e3600435610bd3565b60408051600160a060020a0390971687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b34801561032c57600080fd5b506101a6600160a060020a0360043516610c75565b34801561034d57600080fd5b506101a6600160a060020a0360043516610df8565b34801561036e57600080fd5b506101a6610ea9565b34801561038357600080fd5b506101a6610f15565b34801561039857600080fd5b506101a663ffffffff60043516610f90565b3480156103b657600080fd5b50610209611027565b3480156103cb57600080fd5b506101bd61102d565b3480156103e057600080fd5b506101a661103c565b3480156103f557600080fd5b506102b761115d565b34801561040a57600080fd5b506101a66004351515611166565b6101a6600435611190565b34801561042f57600080fd5b506104386114e2565b6040805163ffffffff9092168252519081900360200190f35b34801561045d57600080fd5b506101a6600160a060020a03600435166024356114f3565b34801561048157600080fd5b5061020961168e565b34801561049657600080fd5b506101a6600160a060020a03600435166116ad565b3480156104b757600080fd5b506102096116cd565b3480156104cc57600080fd5b506104d56116d3565b6040805160ff9092168252519081900360200190f35b600154600160a060020a031690565b600054600160a060020a0316331461051157600080fd5b600060ff82161161056c576040805160e560020a62461bcd02815260206004820152601660248201527f6e65772072617465206d757374206e6f74206265203000000000000000000000604482015290519081900360640190fd5b6007805460ff191660ff92909216919091179055565b60085481565b600054600160a060020a0316331461059f57600080fd5b600060ff8216116105fa576040805160e560020a62461bcd02815260206004820152601660248201527f6e65772072617465206d757374206e6f74206265203000000000000000000000604482015290519081900360640190fd5b60ff16600655565b60065481565b600054600160a060020a0316331461061f57600080fd5b60005460a060020a900460ff16151561063757600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b60008054819060a060020a900460ff161561069857600080fd5b336000908152600a602052604090205415610723576040805160e560020a62461bcd02815260206004820152602660248201527f6d757374206e6f74206861766520616e2061637469766520746f6b656e20657860448201527f6368616e67650000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6005548310156107a3576040805160e560020a62461bcd02815260206004820152603c60248201527f5f616d6f756e7448425a206d7573742062652067726561746572207468616e2060448201527f6f7220657175616c20746f204d494e5f45584348414e47455f42425900000000606482015290519081900360840190fd5b6107af836006546116dc565b6001546040805160e060020a6370a082310281523060048201529051929450600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b15801561080257600080fd5b505af1158015610816573d6000803e3d6000fd5b505050506040513d602081101561082c57600080fd5b505160085490915082906108419083906116f3565b1015610897576040805160e560020a62461bcd02815260206004820152601d60248201527f636f6e74726163742068617320696e73756666696369656e7420424259000000604482015290519081900360640190fd5b600254604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690529051600160a060020a03909216916323b872dd916064808201926020929091908290030181600087803b15801561090a57600080fd5b505af115801561091e573d6000803e3d6000fd5b505050506040513d602081101561093457600080fd5b5051151561094157600080fd5b61094d83836000611705565b505050565b60008054819060a060020a900460ff161561096c57600080fd5b336000908152600a602052604090205415156109d2576040805160e560020a62461bcd02815260206004820181905260248201527f6d75737420626520616e2061637469766520746f6b656e2065786368616e6765604482015290519081900360640190fd5b336000908152600a6020526040902054600b805490919081106109f157fe5b906000526020600020906006020191508160020154905081600501544210151515610a66576040805160e560020a62461bcd02815260206004820152601760248201527f6e6f742070617374206c6f636b696e6720706572696f64000000000000000000604482015290519081900360640190fd5b610a7660085483600201546116f3565b600855336000908152600a6020526040902054600b80549091908110610a9857fe5b600091825260208083206006909202909101805473ffffffffffffffffffffffffffffffffffffffff191681556001808201849055600282018490556003820184905560048201849055600590910183905533808452600a90925260408320929092559054610b1a91600160a060020a0391909116908363ffffffff6118e516565b60405133907f3f3b096b9d4e4698e0611d075803fe0595c28eb0ea20d54bf89789ac0f7b508490600090a25050565b336000908152600a60205260408120541515610baf576040805160e560020a62461bcd02815260206004820181905260248201527f6d75737420626520616e2061637469766520746f6b656e2065786368616e6765604482015290519081900360640190fd5b50336000908152600a602052604090205490565b60005460a060020a900460ff1681565b600080600080600080600080600160a060020a0316600b89815481101515610bf757fe5b6000918252602090912060069091020154600160a060020a03161415610c1c57600080fd5b600b805489908110610c2a57fe5b6000918252602090912060069091020180546001820154600283015460038401546004850154600590950154600160a060020a039094169d929c50909a509850919650945092505050565b600054600160a060020a03163314610c8c57600080fd5b600160a060020a0381161515610cec576040805160e560020a62461bcd02815260206004820152601360248201527f696e76616c6964205f746f206164647265737300000000000000000000000000604482015290519081900360640190fd5b6002546040805160e060020a6370a082310281523060048201529051600160a060020a039092169163a9059cbb91849184916370a082319160248083019260209291908290030181600087803b158015610d4557600080fd5b505af1158015610d59573d6000803e3d6000fd5b505050506040513d6020811015610d6f57600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a03909316600484015260248301919091525160448083019260209291908290030181600087803b158015610dbe57600080fd5b505af1158015610dd2573d6000803e3d6000fd5b505050506040513d6020811015610de857600080fd5b50511515610df557600080fd5b50565b600054600160a060020a03163314610e0f57600080fd5b600160a060020a0381161515610e6f576040805160e560020a62461bcd02815260206004820152601360248201527f696e76616c6964205f746f206164647265737300000000000000000000000000604482015290519081900360640190fd5b604051600160a060020a03821690303180156108fc02916000818181858888f19350505050158015610ea5573d6000803e3d6000fd5b5050565b600054600160a060020a03163314610ec057600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a03163314610f2c57600080fd5b60005460a060020a900460ff1615610f4357600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a03163314610fa757600080fd5b600063ffffffff821611611005576040805160e560020a62461bcd02815260206004820152601b60248201527f6e6577206c6f636b2074696d65206d757374206e6f7420626520300000000000604482015290519081900360640190fd5b6007805463ffffffff9092166101000264ffffffff0019909216919091179055565b60045481565b600054600160a060020a031681565b60008054600160a060020a0316331461105457600080fd5b6001546040805160e060020a6370a0823102815230600482015290516110d992600160a060020a0316916370a082319160248083019260209291908290030181600087803b1580156110a557600080fd5b505af11580156110b9573d6000803e3d6000fd5b505050506040513d60208110156110cf57600080fd5b50516008546116f3565b600154604080517f42966c68000000000000000000000000000000000000000000000000000000008152600481018490529051929350600160a060020a03909116916342966c689160248082019260009290919082900301818387803b15801561114257600080fd5b505af1158015611156573d6000803e3d6000fd5b5050505050565b60095460ff1681565b600054600160a060020a0316331461117d57600080fd5b6009805460ff1916911515919091179055565b6000805481908190819060a060020a900460ff16156111ae57600080fd5b60095460ff1615156111bf57600080fd5b336000908152600a60205260409020541561124a576040805160e560020a62461bcd02815260206004820152602660248201527f6d757374206e6f74206861766520616e2061637469766520746f6b656e20657860448201527f6368616e67650000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600085116112c8576040805160e560020a62461bcd02815260206004820152602160248201527f5f616d6f756e74424259206d7573742062652067726561746572207468616e2060448201527f3000000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600354604080517f1a43c3380000000000000000000000000000000000000000000000000000000081528151600160a060020a0390931692631a43c338926004808401939192918290030181600087803b15801561132557600080fd5b505af1158015611339573d6000803e3d6000fd5b505050506040513d604081101561134f57600080fd5b5051935061136484662386f26fc100006116dc565b60075490935061138b90670de0b6b3a76400009061138690869060ff166116dc565b6116dc565b9150611397828661197f565b9050348111156113f1576040805160e560020a62461bcd02815260206004820152601660248201527f496e73756666696369656e74204554482076616c756500000000000000000000604482015290519081900360640190fd5b6001546040805160e060020a6370a082310281523060048201529051879261144792600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b1580156110a557600080fd5b101561149d576040805160e560020a62461bcd02815260206004820152601d60248201527f636f6e74726163742068617320696e73756666696369656e7420424259000000604482015290519081900360640190fd5b803411156114d65760405133903483900380156108fc02916000818181858888f193505050501580156114d4573d6000803e3d6000fd5b505b61115660008683611705565b600754610100900463ffffffff1681565b600054600160a060020a0316331461150a57600080fd5b600160a060020a038216151561156a576040805160e560020a62461bcd02815260206004820152601360248201527f696e76616c6964205f746f206164647265737300000000000000000000000000604482015290519081900360640190fd5b600081116115e8576040805160e560020a62461bcd02815260206004820152602160248201527f5f616d6f756e74424259206d7573742062652067726561746572207468616e2060448201527f3000000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561165757600080fd5b505af115801561166b573d6000803e3d6000fd5b505050506040513d602081101561168157600080fd5b50511515610ea557600080fd5b60008054600160a060020a031633146116a657600080fd5b50600b5490565b600054600160a060020a031633146116c457600080fd5b610df5816119a8565b60055481565b60075460ff1681565b600081838115156116e957fe5b0490505b92915050565b6000828211156116ff57fe5b50900390565b600061170f611a32565b600754611728904290610100900463ffffffff16611a25565b6040805160c0810182523380825260208083018a81528385018a8152606085018a8152426080870190815260a08701898152600b8054600181018255600091825289517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db960068302908101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039093169290921790915596517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba88015594517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb87015592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbc86015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbd850155517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbe90930192909255928152600a909152929092209190915560085491935091506118a19085611a25565b6008556040805186815260208101849052815133927f63ded6bbd0aa99c1f9c4314412d34d217c380bc2fcf4b4f09cf479f22b11274f928290030190a25050505050565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561194857600080fd5b505af115801561195c573d6000803e3d6000fd5b505050506040513d602081101561197257600080fd5b5051151561094d57600080fd5b6000821515611990575060006116ed565b508181028183828115156119a057fe5b04146116ed57fe5b600160a060020a03811615156119bd57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b818101828110156116ed57fe5b60c0604051908101604052806000600160a060020a03168152602001600081526020016000815260200160008152602001600081526020016000815250905600a165627a7a723058209c57525e0434e35b11f2bd5d9d6f61262fa9d6f7e19ef019149feb5a3b0871300029

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000e34e1944e776f39b9252790a0527ebda647ae6680000000000000000000000004f8a05b6163f2fdbd4ef1555b8ac1ad845d56ff5000000000000000000000000724dd897afa7ae9634a0569b9e2f78143fea68e30000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000007800000000000000000000000000000000000000000000000000000000003b5380

-----Decoded View---------------
Arg [0] : _helbizCoinAddress (address): 0xE34e1944E776f39B9252790a0527eBDa647aE668
Arg [1] : _babyloniaTokenAddress (address): 0x4f8a05B6163F2FDbd4Ef1555b8ac1AD845d56ff5
Arg [2] : _ethPriceOracleAddress (address): 0x724dd897AfA7aE9634a0569B9E2f78143fEA68e3
Arg [3] : _exchangeRate (uint8): 8
Arg [4] : _usdCentsExchangeRate (uint8): 120
Arg [5] : _exchangeLockTime (uint32): 3888000

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000e34e1944e776f39b9252790a0527ebda647ae668
Arg [1] : 0000000000000000000000004f8a05b6163f2fdbd4ef1555b8ac1ad845d56ff5
Arg [2] : 000000000000000000000000724dd897afa7ae9634a0569b9e2f78143fea68e3
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000078
Arg [5] : 00000000000000000000000000000000000000000000000000000000003b5380


Swarm Source

bzzr://9c57525e0434e35b11f2bd5d9d6f61262fa9d6f7e19ef019149feb5a3b087130

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.