Contract Overview
Balance: 1.669037477963117224 Ether
Transactions: 21 txns
 Latest 21 txns

TxHash Age From To Value [TxFee]
0xbda6e2a70605dbc64364d7528714727c134898fca2e0e47fc8c18dca82623b0320 days 16 hrs ago0x2621ea417659ad69bae66af05ebe5788e533e5e7  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540 Ether0.000077448
0x979c1f71bf2bd051f099337ba03c4437ed4a81788909cc317de62265a1f966e021 days 17 hrs ago0x2621ea417659ad69bae66af05ebe5788e533e5e7  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540 Ether0.000094164
0xbdf26e0bd972f9d576c8aae6a1c94b36ba60249d7100759e95d759349df0682921 days 17 hrs ago0x2621ea417659ad69bae66af05ebe5788e533e5e7  IN   0x6d40039fa13d6abf95d29dd809caba70b638625420.286681223237269 Ether0.0000851
0x8b157b08b20134b6f1664f941f3af06a8d54f129964d98048502d309b278969921 days 17 hrs ago0x2621ea417659ad69bae66af05ebe5788e533e5e7  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540 Ether0.000093496
0x73ab2cca6d7c47f0b8535905c1828aeb4f446406fee66390b8fb49991e10a9cd21 days 17 hrs ago0x2621ea417659ad69bae66af05ebe5788e533e5e7  IN   0x6d40039fa13d6abf95d29dd809caba70b638625420.283555548604349 Ether0.000110262
0x3218459a9f5dc47fdafa6527a9b1a2dfbe74b7bbd8162dcc5d2a5b2bbfa0980b21 days 17 hrs ago0x2621ea417659ad69bae66af05ebe5788e533e5e7  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540 Ether0.000092824
0x44e4ca62985f564c6dc8168c398fa485201db95779d8d37697e867a3255d238f21 days 17 hrs ago0x2621ea417659ad69bae66af05ebe5788e533e5e7  IN   0x6d40039fa13d6abf95d29dd809caba70b638625420.283571833357201 Ether0.00011022
0xb41db77efb1dfea8b39d0cb0d697b5a78f95ccda55821ad7d3a8a42e92a459bb21 days 17 hrs ago0x2621ea417659ad69bae66af05ebe5788e533e5e7  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540 Ether0.000094358
0xbaadb595626eee0330add5294b2e204657b6253bbd67f5a5a624b4640cfd2fa721 days 17 hrs ago0x2621ea417659ad69bae66af05ebe5788e533e5e7  IN   0x6d40039fa13d6abf95d29dd809caba70b638625432.769278745674122 Ether0.00010912
0xe443a5275f20fe54859848967d19d08e15954b33b90b25af8d3546bc491b051736 days 1 hr ago0x66253d14cf139c260d8c98ba8f56064ebab7bdde  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540.23334778747297 Ether0.000083161
0xf6ac15102a52f8603a19e8a96dfee84f5ecc6aeffc1bacdbc9f6c57ff55e766236 days 1 hr ago0x66253d14cf139c260d8c98ba8f56064ebab7bdde  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540.324454674590092 Ether0.000109724
0x60c809ed7858f9529db7e48dad24907ef1e4d2d9e11ba65d18cfa6cc1ed04c3636 days 1 hr ago0x66253d14cf139c260d8c98ba8f56064ebab7bdde  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540.280160158046072 Ether0.000083242
0xe8b0df3feb55ebd29f68bcf19d1d2a6abce6840f71fb3d8d8aecc9a57902bf8b36 days 20 hrs ago0x520dffed1dc6e3e871d944bb473c3d483f5f3fb9  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540.059042603194921 Ether0.000072161
0x6f5393cf22b2e25ea023aa3fa6518a36efb9d1c6ff2b3a293447db117b76561936 days 20 hrs ago0x520dffed1dc6e3e871d944bb473c3d483f5f3fb9  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540.059177868458454 Ether0.000072266
0x76e8f3dccdcd88e06a6898ee1da12c2155d823cf5e241ccf799fa86ee121e79136 days 20 hrs ago0x520dffed1dc6e3e871d944bb473c3d483f5f3fb9  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540.069604970147706 Ether0.000072161
0xb5a16efdf8c5e512354d47447dc87de93b4488691f0c5c1fe89b1d6490bda9f737 days 5 hrs ago0x31f2e532799041fea9c72cd3f5160b45c68a8a5e  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540.065995359832165 Ether0.00005708
0x50d243ba48d1b513a5df4ba1950cd2c7caac6308cca7fa9d2299d7d703d9302a37 days 6 hrs ago0x31f2e532799041fea9c72cd3f5160b45c68a8a5e  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540.066147199637455 Ether0.000072056
0x40cbb4ca6a13d7f96537e73f7bd5cff9339be887f04b16f061e2965eda12570537 days 6 hrs ago0x31f2e532799041fea9c72cd3f5160b45c68a8a5e  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540.041024547596618 Ether0.000072161
0x37a1a4da59361429dde77cfd534fdd9922cc87d9865163d735e68686f720495837 days 6 hrs ago0x31f2e532799041fea9c72cd3f5160b45c68a8a5e  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540.025421314443184 Ether0.000071951
0x3c18f4e57e53c9fe9c8776fa9b15e9783eb07dafa61df69fc1430f1cc92c34eb37 days 6 hrs ago0x506a11d2763b61300425bbb54c9f2490cc238707  IN   0x6d40039fa13d6abf95d29dd809caba70b63862540.166666666666666 Ether0.02315771
0xf3e24e5b6e660270300501351d0ed5e9f8c126586d5401147b2c29b4f09a445837 days 7 hrs ago0x506a11d2763b61300425bbb54c9f2490cc238707  IN    Contract Creation0 Ether0.03589644
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 25 Internal Txns, Click here To View More View All
ParentTxHash Block Age From To Value
0x84201c2f0215554b6f791e74ea2c48bb147fae56634f734dbebe3902ca68230f493156720 days 16 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x637e669d9ce37c54ba3f6a3b5fc34b36a932beed0 Ether
0x84201c2f0215554b6f791e74ea2c48bb147fae56634f734dbebe3902ca68230f493156720 days 16 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x637e669d9ce37c54ba3f6a3b5fc34b36a932beed0 Ether
0x84201c2f0215554b6f791e74ea2c48bb147fae56634f734dbebe3902ca68230f493156720 days 16 hrs ago0x038cecf8e1fecfdb33d5f17bf21834cbe41ec5690x6d40039fa13d6abf95d29dd809caba70b63862540 Ether
0x84201c2f0215554b6f791e74ea2c48bb147fae56634f734dbebe3902ca68230f493156720 days 16 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x8289d4b3f50421f382d41303c2a176b72ac0b6f00 Ether
0x84201c2f0215554b6f791e74ea2c48bb147fae56634f734dbebe3902ca68230f493156720 days 16 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x8289d4b3f50421f382d41303c2a176b72ac0b6f00 Ether
0x84201c2f0215554b6f791e74ea2c48bb147fae56634f734dbebe3902ca68230f493156720 days 16 hrs ago0x038cecf8e1fecfdb33d5f17bf21834cbe41ec5690x6d40039fa13d6abf95d29dd809caba70b63862540 Ether
0x84201c2f0215554b6f791e74ea2c48bb147fae56634f734dbebe3902ca68230f493156720 days 16 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x91eccce26087e6e35f5ba4b4edce7a6d559abcc40 Ether
0x84201c2f0215554b6f791e74ea2c48bb147fae56634f734dbebe3902ca68230f493156720 days 16 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x91eccce26087e6e35f5ba4b4edce7a6d559abcc40 Ether
0x84201c2f0215554b6f791e74ea2c48bb147fae56634f734dbebe3902ca68230f493156720 days 16 hrs ago0x038cecf8e1fecfdb33d5f17bf21834cbe41ec5690x6d40039fa13d6abf95d29dd809caba70b63862540 Ether
0xbda6e2a70605dbc64364d7528714727c134898fca2e0e47fc8c18dca82623b03493156020 days 16 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x2621ea417659ad69bae66af05ebe5788e533e5e70.097624740194651795 Ether
0xbda6e2a70605dbc64364d7528714727c134898fca2e0e47fc8c18dca82623b03493156020 days 16 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x637e669d9ce37c54ba3f6a3b5fc34b36a932beed0 Ether
0xbda6e2a70605dbc64364d7528714727c134898fca2e0e47fc8c18dca82623b03493156020 days 16 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x637e669d9ce37c54ba3f6a3b5fc34b36a932beed0 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x637e669d9ce37c54ba3f6a3b5fc34b36a932beed0 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x637e669d9ce37c54ba3f6a3b5fc34b36a932beed0 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x038cecf8e1fecfdb33d5f17bf21834cbe41ec5690x6d40039fa13d6abf95d29dd809caba70b63862540 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x8289d4b3f50421f382d41303c2a176b72ac0b6f00 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x8289d4b3f50421f382d41303c2a176b72ac0b6f00 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x038cecf8e1fecfdb33d5f17bf21834cbe41ec5690x6d40039fa13d6abf95d29dd809caba70b63862540 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x91eccce26087e6e35f5ba4b4edce7a6d559abcc40 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x91eccce26087e6e35f5ba4b4edce7a6d559abcc40 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x038cecf8e1fecfdb33d5f17bf21834cbe41ec5690x6d40039fa13d6abf95d29dd809caba70b63862540 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x637e669d9ce37c54ba3f6a3b5fc34b36a932beed0 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x637e669d9ce37c54ba3f6a3b5fc34b36a932beed0 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x038cecf8e1fecfdb33d5f17bf21834cbe41ec5690x6d40039fa13d6abf95d29dd809caba70b63862540 Ether
0x467b8b9a896561e22584d6cd9a8dd88f20b7ea941a612194ada97f2b272e2629492474021 days 17 hrs ago0x6d40039fa13d6abf95d29dd809caba70b63862540x8289d4b3f50421f382d41303c2a176b72ac0b6f00 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact Match)
Contract Name: UpcityMarket
Compiler Version: v0.5.2+commit.1df8f40c
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.5;

// solhint-disable-next-line

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

  /**
  * @dev Multiplies two numbers, reverts on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
    if (a == 0) {
      return 0;
    }

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

    return c;
  }

  /**
  * @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    require(b > 0); // Solidity only automatically asserts 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;
  }

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

    return c;
  }

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

    return c;
  }

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

/*
    Utilities & Common Modifiers
*/
/// @dev Modernized version of Utils from
/// https://github.com/bancorprotocol/contracts/blob/master/solidity/contracts/Utils.sol
contract Utils {

    // verifies that an amount is greater than zero
    modifier greaterThanZero(uint256 _amount) {
        require(_amount > 0);
        _;
    }

    // validates an address - currently only checks that it isn't null
    modifier validAddress(address _address) {
        require(_address != address(0));
        _;
    }

    // verifies that the address is different than this contract address
    modifier notThis(address _address) {
        require(_address != address(this));
        _;
    }

    // Overflow protected math functions

    /**
        @dev returns the sum of _x and _y, asserts if the calculation overflows

        @param _x   value 1
        @param _y   value 2

        @return sum
    */
    function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) {
        uint256 z = _x + _y;
        assert(z >= _x);
        return z;
    }

    /**
        @dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number

        @param _x   minuend
        @param _y   subtrahend

        @return difference
    */
    function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) {
        assert(_x >= _y);
        return _x - _y;
    }

    /**
        @dev returns the product of multiplying _x by _y, asserts if the calculation overflows

        @param _x   factor 1
        @param _y   factor 2

        @return product
    */
    function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) {
        uint256 z = _x * _y;
        assert(_x == 0 || z / _x == _y);
        return z;
    }
}

/// @dev Slightly stripped down and modernized version of BancorFormula from
/// https://github.com/bancorprotocol/contracts/blob/master/solidity/contracts/BancorFormula.sol
contract BancorFormula is Utils {
    uint256 private constant ONE = 1;
    uint32 private constant MAX_WEIGHT = 1000000;
    uint8 private constant MIN_PRECISION = 32;
    uint8 private constant MAX_PRECISION = 127;

    /**
        Auto-generated via 'PrintIntScalingFactors.py'
    */
    uint256 private constant FIXED_1 = 0x080000000000000000000000000000000;
    uint256 private constant FIXED_2 = 0x100000000000000000000000000000000;
    uint256 private constant MAX_NUM = 0x200000000000000000000000000000000;

    /**
        Auto-generated via 'PrintLn2ScalingFactors.py'
    */
    uint256 private constant LN2_NUMERATOR   = 0x3f80fe03f80fe03f80fe03f80fe03f8;
    uint256 private constant LN2_DENOMINATOR = 0x5b9de1d10bf4103d647b0955897ba80;

    /**
        Auto-generated via 'PrintFunctionOptimalLog.py' and 'PrintFunctionOptimalExp.py'
    */
    uint256 private constant OPT_LOG_MAX_VAL = 0x15bf0a8b1457695355fb8ac404e7a79e3;
    uint256 private constant OPT_EXP_MAX_VAL = 0x800000000000000000000000000000000;

    /**
        Auto-generated via 'PrintFunctionBancorFormula.py'
    */
    uint256[128] private maxExpArray;
    function _bancorInit() internal {
    //  maxExpArray[  0] = 0x6bffffffffffffffffffffffffffffffff;
    //  maxExpArray[  1] = 0x67ffffffffffffffffffffffffffffffff;
    //  maxExpArray[  2] = 0x637fffffffffffffffffffffffffffffff;
    //  maxExpArray[  3] = 0x5f6fffffffffffffffffffffffffffffff;
    //  maxExpArray[  4] = 0x5b77ffffffffffffffffffffffffffffff;
    //  maxExpArray[  5] = 0x57b3ffffffffffffffffffffffffffffff;
    //  maxExpArray[  6] = 0x5419ffffffffffffffffffffffffffffff;
    //  maxExpArray[  7] = 0x50a2ffffffffffffffffffffffffffffff;
    //  maxExpArray[  8] = 0x4d517fffffffffffffffffffffffffffff;
    //  maxExpArray[  9] = 0x4a233fffffffffffffffffffffffffffff;
    //  maxExpArray[ 10] = 0x47165fffffffffffffffffffffffffffff;
    //  maxExpArray[ 11] = 0x4429afffffffffffffffffffffffffffff;
    //  maxExpArray[ 12] = 0x415bc7ffffffffffffffffffffffffffff;
    //  maxExpArray[ 13] = 0x3eab73ffffffffffffffffffffffffffff;
    //  maxExpArray[ 14] = 0x3c1771ffffffffffffffffffffffffffff;
    //  maxExpArray[ 15] = 0x399e96ffffffffffffffffffffffffffff;
    //  maxExpArray[ 16] = 0x373fc47fffffffffffffffffffffffffff;
    //  maxExpArray[ 17] = 0x34f9e8ffffffffffffffffffffffffffff;
    //  maxExpArray[ 18] = 0x32cbfd5fffffffffffffffffffffffffff;
    //  maxExpArray[ 19] = 0x30b5057fffffffffffffffffffffffffff;
    //  maxExpArray[ 20] = 0x2eb40f9fffffffffffffffffffffffffff;
    //  maxExpArray[ 21] = 0x2cc8340fffffffffffffffffffffffffff;
    //  maxExpArray[ 22] = 0x2af09481ffffffffffffffffffffffffff;
    //  maxExpArray[ 23] = 0x292c5bddffffffffffffffffffffffffff;
    //  maxExpArray[ 24] = 0x277abdcdffffffffffffffffffffffffff;
    //  maxExpArray[ 25] = 0x25daf6657fffffffffffffffffffffffff;
    //  maxExpArray[ 26] = 0x244c49c65fffffffffffffffffffffffff;
    //  maxExpArray[ 27] = 0x22ce03cd5fffffffffffffffffffffffff;
    //  maxExpArray[ 28] = 0x215f77c047ffffffffffffffffffffffff;
    //  maxExpArray[ 29] = 0x1fffffffffffffffffffffffffffffffff;
    //  maxExpArray[ 30] = 0x1eaefdbdabffffffffffffffffffffffff;
    //  maxExpArray[ 31] = 0x1d6bd8b2ebffffffffffffffffffffffff;
        maxExpArray[ 32] = 0x1c35fedd14ffffffffffffffffffffffff;
        maxExpArray[ 33] = 0x1b0ce43b323fffffffffffffffffffffff;
        maxExpArray[ 34] = 0x19f0028ec1ffffffffffffffffffffffff;
        maxExpArray[ 35] = 0x18ded91f0e7fffffffffffffffffffffff;
        maxExpArray[ 36] = 0x17d8ec7f0417ffffffffffffffffffffff;
        maxExpArray[ 37] = 0x16ddc6556cdbffffffffffffffffffffff;
        maxExpArray[ 38] = 0x15ecf52776a1ffffffffffffffffffffff;
        maxExpArray[ 39] = 0x15060c256cb2ffffffffffffffffffffff;
        maxExpArray[ 40] = 0x1428a2f98d72ffffffffffffffffffffff;
        maxExpArray[ 41] = 0x13545598e5c23fffffffffffffffffffff;
        maxExpArray[ 42] = 0x1288c4161ce1dfffffffffffffffffffff;
        maxExpArray[ 43] = 0x11c592761c666fffffffffffffffffffff;
        maxExpArray[ 44] = 0x110a688680a757ffffffffffffffffffff;
        maxExpArray[ 45] = 0x1056f1b5bedf77ffffffffffffffffffff;
        maxExpArray[ 46] = 0x0faadceceeff8bffffffffffffffffffff;
        maxExpArray[ 47] = 0x0f05dc6b27edadffffffffffffffffffff;
        maxExpArray[ 48] = 0x0e67a5a25da4107fffffffffffffffffff;
        maxExpArray[ 49] = 0x0dcff115b14eedffffffffffffffffffff;
        maxExpArray[ 50] = 0x0d3e7a392431239fffffffffffffffffff;
        maxExpArray[ 51] = 0x0cb2ff529eb71e4fffffffffffffffffff;
        maxExpArray[ 52] = 0x0c2d415c3db974afffffffffffffffffff;
        maxExpArray[ 53] = 0x0bad03e7d883f69bffffffffffffffffff;
        maxExpArray[ 54] = 0x0b320d03b2c343d5ffffffffffffffffff;
        maxExpArray[ 55] = 0x0abc25204e02828dffffffffffffffffff;
        maxExpArray[ 56] = 0x0a4b16f74ee4bb207fffffffffffffffff;
        maxExpArray[ 57] = 0x09deaf736ac1f569ffffffffffffffffff;
        maxExpArray[ 58] = 0x0976bd9952c7aa957fffffffffffffffff;
        maxExpArray[ 59] = 0x09131271922eaa606fffffffffffffffff;
        maxExpArray[ 60] = 0x08b380f3558668c46fffffffffffffffff;
        maxExpArray[ 61] = 0x0857ddf0117efa215bffffffffffffffff;
        maxExpArray[ 62] = 0x07ffffffffffffffffffffffffffffffff;
        maxExpArray[ 63] = 0x07abbf6f6abb9d087fffffffffffffffff;
        maxExpArray[ 64] = 0x075af62cbac95f7dfa7fffffffffffffff;
        maxExpArray[ 65] = 0x070d7fb7452e187ac13fffffffffffffff;
        maxExpArray[ 66] = 0x06c3390ecc8af379295fffffffffffffff;
        maxExpArray[ 67] = 0x067c00a3b07ffc01fd6fffffffffffffff;
        maxExpArray[ 68] = 0x0637b647c39cbb9d3d27ffffffffffffff;
        maxExpArray[ 69] = 0x05f63b1fc104dbd39587ffffffffffffff;
        maxExpArray[ 70] = 0x05b771955b36e12f7235ffffffffffffff;
        maxExpArray[ 71] = 0x057b3d49dda84556d6f6ffffffffffffff;
        maxExpArray[ 72] = 0x054183095b2c8ececf30ffffffffffffff;
        maxExpArray[ 73] = 0x050a28be635ca2b888f77fffffffffffff;
        maxExpArray[ 74] = 0x04d5156639708c9db33c3fffffffffffff;
        maxExpArray[ 75] = 0x04a23105873875bd52dfdfffffffffffff;
        maxExpArray[ 76] = 0x0471649d87199aa990756fffffffffffff;
        maxExpArray[ 77] = 0x04429a21a029d4c1457cfbffffffffffff;
        maxExpArray[ 78] = 0x0415bc6d6fb7dd71af2cb3ffffffffffff;
        maxExpArray[ 79] = 0x03eab73b3bbfe282243ce1ffffffffffff;
        maxExpArray[ 80] = 0x03c1771ac9fb6b4c18e229ffffffffffff;
        maxExpArray[ 81] = 0x0399e96897690418f785257fffffffffff;
        maxExpArray[ 82] = 0x0373fc456c53bb779bf0ea9fffffffffff;
        maxExpArray[ 83] = 0x034f9e8e490c48e67e6ab8bfffffffffff;
        maxExpArray[ 84] = 0x032cbfd4a7adc790560b3337ffffffffff;
        maxExpArray[ 85] = 0x030b50570f6e5d2acca94613ffffffffff;
        maxExpArray[ 86] = 0x02eb40f9f620fda6b56c2861ffffffffff;
        maxExpArray[ 87] = 0x02cc8340ecb0d0f520a6af58ffffffffff;
        maxExpArray[ 88] = 0x02af09481380a0a35cf1ba02ffffffffff;
        maxExpArray[ 89] = 0x0292c5bdd3b92ec810287b1b3fffffffff;
        maxExpArray[ 90] = 0x0277abdcdab07d5a77ac6d6b9fffffffff;
        maxExpArray[ 91] = 0x025daf6654b1eaa55fd64df5efffffffff;
        maxExpArray[ 92] = 0x0244c49c648baa98192dce88b7ffffffff;
        maxExpArray[ 93] = 0x022ce03cd5619a311b2471268bffffffff;
        maxExpArray[ 94] = 0x0215f77c045fbe885654a44a0fffffffff;
        maxExpArray[ 95] = 0x01ffffffffffffffffffffffffffffffff;
        maxExpArray[ 96] = 0x01eaefdbdaaee7421fc4d3ede5ffffffff;
        maxExpArray[ 97] = 0x01d6bd8b2eb257df7e8ca57b09bfffffff;
        maxExpArray[ 98] = 0x01c35fedd14b861eb0443f7f133fffffff;
        maxExpArray[ 99] = 0x01b0ce43b322bcde4a56e8ada5afffffff;
        maxExpArray[100] = 0x019f0028ec1fff007f5a195a39dfffffff;
        maxExpArray[101] = 0x018ded91f0e72ee74f49b15ba527ffffff;
        maxExpArray[102] = 0x017d8ec7f04136f4e5615fd41a63ffffff;
        maxExpArray[103] = 0x016ddc6556cdb84bdc8d12d22e6fffffff;
        maxExpArray[104] = 0x015ecf52776a1155b5bd8395814f7fffff;
        maxExpArray[105] = 0x015060c256cb23b3b3cc3754cf40ffffff;
        maxExpArray[106] = 0x01428a2f98d728ae223ddab715be3fffff;
        maxExpArray[107] = 0x013545598e5c23276ccf0ede68034fffff;
        maxExpArray[108] = 0x01288c4161ce1d6f54b7f61081194fffff;
        maxExpArray[109] = 0x011c592761c666aa641d5a01a40f17ffff;
        maxExpArray[110] = 0x0110a688680a7530515f3e6e6cfdcdffff;
        maxExpArray[111] = 0x01056f1b5bedf75c6bcb2ce8aed428ffff;
        maxExpArray[112] = 0x00faadceceeff8a0890f3875f008277fff;
        maxExpArray[113] = 0x00f05dc6b27edad306388a600f6ba0bfff;
        maxExpArray[114] = 0x00e67a5a25da41063de1495d5b18cdbfff;
        maxExpArray[115] = 0x00dcff115b14eedde6fc3aa5353f2e4fff;
        maxExpArray[116] = 0x00d3e7a3924312399f9aae2e0f868f8fff;
        maxExpArray[117] = 0x00cb2ff529eb71e41582cccd5a1ee26fff;
        maxExpArray[118] = 0x00c2d415c3db974ab32a51840c0b67edff;
        maxExpArray[119] = 0x00bad03e7d883f69ad5b0a186184e06bff;
        maxExpArray[120] = 0x00b320d03b2c343d4829abd6075f0cc5ff;
        maxExpArray[121] = 0x00abc25204e02828d73c6e80bcdb1a95bf;
        maxExpArray[122] = 0x00a4b16f74ee4bb2040a1ec6c15fbbf2df;
        maxExpArray[123] = 0x009deaf736ac1f569deb1b5ae3f36c130f;
        maxExpArray[124] = 0x00976bd9952c7aa957f5937d790ef65037;
        maxExpArray[125] = 0x009131271922eaa6064b73a22d0bd4f2bf;
        maxExpArray[126] = 0x008b380f3558668c46c91c49a2f8e967b9;
        maxExpArray[127] = 0x00857ddf0117efa215952912839f6473e6;
    }

    /**
        @dev given a token supply, connector balance, weight and a deposit amount (in the connector token),
        calculates the return for a given conversion (in the main token)

        Formula:
        Return = _supply * ((1 + _depositAmount / _connectorBalance) ^ (_connectorWeight / 1000000) - 1)

        @param _supply              token total supply
        @param _connectorBalance    total connector balance
        @param _connectorWeight     connector weight, represented in ppm, 1-1000000
        @param _depositAmount       deposit amount, in connector token

        @return purchase return amount
    */
    function calculatePurchaseReturn(uint256 _supply, uint256 _connectorBalance, uint32 _connectorWeight, uint256 _depositAmount) internal view returns (uint256) {
        // validate input
        require(_supply > 0 && _connectorBalance > 0 && _connectorWeight > 0 && _connectorWeight <= MAX_WEIGHT);

        // special case for 0 deposit amount
        if (_depositAmount == 0)
            return 0;

        // special case if the weight = 100%
        if (_connectorWeight == MAX_WEIGHT)
            return safeMul(_supply, _depositAmount) / _connectorBalance;

        uint256 result;
        uint8 precision;
        uint256 baseN = safeAdd(_depositAmount, _connectorBalance);
        (result, precision) = power(baseN, _connectorBalance, _connectorWeight, MAX_WEIGHT);
        uint256 temp = safeMul(_supply, result) >> precision;
        return temp - _supply;
    }

    /**
        @dev given a token supply, connector balance, weight and a sell amount (in the main token),
        calculates the return for a given conversion (in the connector token)

        Formula:
        Return = _connectorBalance * (1 - (1 - _sellAmount / _supply) ^ (1 / (_connectorWeight / 1000000)))

        @param _supply              token total supply
        @param _connectorBalance    total connector
        @param _connectorWeight     constant connector Weight, represented in ppm, 1-1000000
        @param _sellAmount          sell amount, in the token itself

        @return sale return amount
    */
    function calculateSaleReturn(uint256 _supply, uint256 _connectorBalance, uint32 _connectorWeight, uint256 _sellAmount) internal view returns (uint256) {
        // validate input
        require(_supply > 0 && _connectorBalance > 0 && _connectorWeight > 0 && _connectorWeight <= MAX_WEIGHT && _sellAmount <= _supply);

        // special case for 0 sell amount
        if (_sellAmount == 0)
            return 0;

        // special case for selling the entire supply
        if (_sellAmount == _supply)
            return _connectorBalance;

        // special case if the weight = 100%
        if (_connectorWeight == MAX_WEIGHT)
            return safeMul(_connectorBalance, _sellAmount) / _supply;

        uint256 result;
        uint8 precision;
        uint256 baseD = _supply - _sellAmount;
        (result, precision) = power(_supply, baseD, MAX_WEIGHT, _connectorWeight);
        uint256 temp1 = safeMul(_connectorBalance, result);
        uint256 temp2 = _connectorBalance << precision;
        return (temp1 - temp2) / result;
    }

    /**
        General Description:
            Determine a value of precision.
            Calculate an integer approximation of (_baseN / _baseD) ^ (_expN / _expD) * 2 ^ precision.
            Return the result along with the precision used.

        Detailed Description:
            Instead of calculating "base ^ exp", we calculate "e ^ (log(base) * exp)".
            The value of "log(base)" is represented with an integer slightly smaller than "log(base) * 2 ^ precision".
            The larger "precision" is, the more accurately this value represents the real value.
            However, the larger "precision" is, the more bits are required in order to store this value.
            And the exponentiation function, which takes "x" and calculates "e ^ x", is limited to a maximum exponent (maximum value of "x").
            This maximum exponent depends on the "precision" used, and it is given by "maxExpArray[precision] >> (MAX_PRECISION - precision)".
            Hence we need to determine the highest precision which can be used for the given input, before calling the exponentiation function.
            This allows us to compute "base ^ exp" with maximum accuracy and without exceeding 256 bits in any of the intermediate computations.
            This functions assumes that "_expN < 2 ^ 256 / log(MAX_NUM - 1)", otherwise the multiplication should be replaced with a "safeMul".
    */
    function power(uint256 _baseN, uint256 _baseD, uint32 _expN, uint32 _expD) private view returns (uint256, uint8) {
        assert(_baseN < MAX_NUM);

        uint256 baseLog;
        uint256 base = _baseN * FIXED_1 / _baseD;
        if (base < OPT_LOG_MAX_VAL) {
            baseLog = optimalLog(base);
        }
        else {
            baseLog = generalLog(base);
        }

        uint256 baseLogTimesExp = baseLog * _expN / _expD;
        if (baseLogTimesExp < OPT_EXP_MAX_VAL) {
            return (optimalExp(baseLogTimesExp), MAX_PRECISION);
        }
        else {
            uint8 precision = findPositionInMaxExpArray(baseLogTimesExp);
            return (generalExp(baseLogTimesExp >> (MAX_PRECISION - precision), precision), precision);
        }
    }

    /**
        Compute log(x / FIXED_1) * FIXED_1.
        This functions assumes that "x >= FIXED_1", because the output would be negative otherwise.
    */
    function generalLog(uint256 x) private pure returns (uint256) {
        uint256 res = 0;

        // If x >= 2, then we compute the integer part of log2(x), which is larger than 0.
        if (x >= FIXED_2) {
            uint8 count = floorLog2(x / FIXED_1);
            x >>= count; // now x < 2
            res = count * FIXED_1;
        }

        // If x > 1, then we compute the fraction part of log2(x), which is larger than 0.
        if (x > FIXED_1) {
            for (uint8 i = MAX_PRECISION; i > 0; --i) {
                x = (x * x) / FIXED_1; // now 1 < x < 4
                if (x >= FIXED_2) {
                    x >>= 1; // now 1 < x < 2
                    res += ONE << (i - 1);
                }
            }
        }

        return res * LN2_NUMERATOR / LN2_DENOMINATOR;
    }

    /**
        Compute the largest integer smaller than or equal to the binary logarithm of the input.
    */
    function floorLog2(uint256 _n) private pure returns (uint8) {
        uint8 res = 0;

        if (_n < 256) {
            // At most 8 iterations
            while (_n > 1) {
                _n >>= 1;
                res += 1;
            }
        }
        else {
            // Exactly 8 iterations
            for (uint8 s = 128; s > 0; s >>= 1) {
                if (_n >= (ONE << s)) {
                    _n >>= s;
                    res |= s;
                }
            }
        }

        return res;
    }

    /**
        The global "maxExpArray" is sorted in descending order, and therefore the following statements are equivalent:
        - This function finds the position of [the smallest value in "maxExpArray" larger than or equal to "x"]
        - This function finds the highest position of [a value in "maxExpArray" larger than or equal to "x"]
    */
    function findPositionInMaxExpArray(uint256 _x) private view returns (uint8) {
        uint8 lo = MIN_PRECISION;
        uint8 hi = MAX_PRECISION;

        while (lo + 1 < hi) {
            uint8 mid = (lo + hi) / 2;
            if (maxExpArray[mid] >= _x)
                lo = mid;
            else
                hi = mid;
        }

        if (maxExpArray[hi] >= _x)
            return hi;
        if (maxExpArray[lo] >= _x)
            return lo;

        assert(false);
        return 0;
    }

    /**
        This function can be auto-generated by the script 'PrintFunctionGeneralExp.py'.
        It approximates "e ^ x" via maclaurin summation: "(x^0)/0! + (x^1)/1! + ... + (x^n)/n!".
        It returns "e ^ (x / 2 ^ precision) * 2 ^ precision", that is, the result is upshifted for accuracy.
        The global "maxExpArray" maps each "precision" to "((maximumExponent + 1) << (MAX_PRECISION - precision)) - 1".
        The maximum permitted value for "x" is therefore given by "maxExpArray[precision] >> (MAX_PRECISION - precision)".
    */
    function generalExp(uint256 _x, uint8 _precision) private pure returns (uint256) {
        uint256 xi = _x;
        uint256 res = 0;

        xi = (xi * _x) >> _precision; res += xi * 0x3442c4e6074a82f1797f72ac0000000; // add x^02 * (33! / 02!)
        xi = (xi * _x) >> _precision; res += xi * 0x116b96f757c380fb287fd0e40000000; // add x^03 * (33! / 03!)
        xi = (xi * _x) >> _precision; res += xi * 0x045ae5bdd5f0e03eca1ff4390000000; // add x^04 * (33! / 04!)
        xi = (xi * _x) >> _precision; res += xi * 0x00defabf91302cd95b9ffda50000000; // add x^05 * (33! / 05!)
        xi = (xi * _x) >> _precision; res += xi * 0x002529ca9832b22439efff9b8000000; // add x^06 * (33! / 06!)
        xi = (xi * _x) >> _precision; res += xi * 0x00054f1cf12bd04e516b6da88000000; // add x^07 * (33! / 07!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000a9e39e257a09ca2d6db51000000; // add x^08 * (33! / 08!)
        xi = (xi * _x) >> _precision; res += xi * 0x000012e066e7b839fa050c309000000; // add x^09 * (33! / 09!)
        xi = (xi * _x) >> _precision; res += xi * 0x000001e33d7d926c329a1ad1a800000; // add x^10 * (33! / 10!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000002bee513bdb4a6b19b5f800000; // add x^11 * (33! / 11!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000003a9316fa79b88eccf2a00000; // add x^12 * (33! / 12!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000048177ebe1fa812375200000; // add x^13 * (33! / 13!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000005263fe90242dcbacf00000; // add x^14 * (33! / 14!)
        xi = (xi * _x) >> _precision; res += xi * 0x000000000057e22099c030d94100000; // add x^15 * (33! / 15!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000057e22099c030d9410000; // add x^16 * (33! / 16!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000052b6b54569976310000; // add x^17 * (33! / 17!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000004985f67696bf748000; // add x^18 * (33! / 18!)
        xi = (xi * _x) >> _precision; res += xi * 0x000000000000003dea12ea99e498000; // add x^19 * (33! / 19!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000000031880f2214b6e000; // add x^20 * (33! / 20!)
        xi = (xi * _x) >> _precision; res += xi * 0x000000000000000025bcff56eb36000; // add x^21 * (33! / 21!)
        xi = (xi * _x) >> _precision; res += xi * 0x000000000000000001b722e10ab1000; // add x^22 * (33! / 22!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000000000001317c70077000; // add x^23 * (33! / 23!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000000000000cba84aafa00; // add x^24 * (33! / 24!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000000000000082573a0a00; // add x^25 * (33! / 25!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000000000000005035ad900; // add x^26 * (33! / 26!)
        xi = (xi * _x) >> _precision; res += xi * 0x000000000000000000000002f881b00; // add x^27 * (33! / 27!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000000000000000001b29340; // add x^28 * (33! / 28!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000000000000000000efc40; // add x^29 * (33! / 29!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000000000000000000007fe0; // add x^30 * (33! / 30!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000000000000000000000420; // add x^31 * (33! / 31!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000000000000000000000021; // add x^32 * (33! / 32!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000000000000000000000001; // add x^33 * (33! / 33!)

        return res / 0x688589cc0e9505e2f2fee5580000000 + _x + (ONE << _precision); // divide by 33! and then add x^1 / 1! + x^0 / 0!
    }

    /**
        Return log(x / FIXED_1) * FIXED_1
        Input range: FIXED_1 <= x <= LOG_EXP_MAX_VAL - 1
        Auto-generated via 'PrintFunctionOptimalLog.py'
    */
    function optimalLog(uint256 x) private pure returns (uint256) {
        uint256 res = 0;

        uint256 y;
        uint256 z;
        uint256 w;

        if (x >= 0xd3094c70f034de4b96ff7d5b6f99fcd8) {res += 0x40000000000000000000000000000000; x = x * FIXED_1 / 0xd3094c70f034de4b96ff7d5b6f99fcd8;}
        if (x >= 0xa45af1e1f40c333b3de1db4dd55f29a7) {res += 0x20000000000000000000000000000000; x = x * FIXED_1 / 0xa45af1e1f40c333b3de1db4dd55f29a7;}
        if (x >= 0x910b022db7ae67ce76b441c27035c6a1) {res += 0x10000000000000000000000000000000; x = x * FIXED_1 / 0x910b022db7ae67ce76b441c27035c6a1;}
        if (x >= 0x88415abbe9a76bead8d00cf112e4d4a8) {res += 0x08000000000000000000000000000000; x = x * FIXED_1 / 0x88415abbe9a76bead8d00cf112e4d4a8;}
        if (x >= 0x84102b00893f64c705e841d5d4064bd3) {res += 0x04000000000000000000000000000000; x = x * FIXED_1 / 0x84102b00893f64c705e841d5d4064bd3;}
        if (x >= 0x8204055aaef1c8bd5c3259f4822735a2) {res += 0x02000000000000000000000000000000; x = x * FIXED_1 / 0x8204055aaef1c8bd5c3259f4822735a2;}
        if (x >= 0x810100ab00222d861931c15e39b44e99) {res += 0x01000000000000000000000000000000; x = x * FIXED_1 / 0x810100ab00222d861931c15e39b44e99;}
        if (x >= 0x808040155aabbbe9451521693554f733) {res += 0x00800000000000000000000000000000; x = x * FIXED_1 / 0x808040155aabbbe9451521693554f733;}

        z = y = x - FIXED_1;
        w = y * y / FIXED_1;
        res += z * (0x100000000000000000000000000000000 - y) / 0x100000000000000000000000000000000; z = z * w / FIXED_1;
        res += z * (0x0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - y) / 0x200000000000000000000000000000000; z = z * w / FIXED_1;
        res += z * (0x099999999999999999999999999999999 - y) / 0x300000000000000000000000000000000; z = z * w / FIXED_1;
        res += z * (0x092492492492492492492492492492492 - y) / 0x400000000000000000000000000000000; z = z * w / FIXED_1;
        res += z * (0x08e38e38e38e38e38e38e38e38e38e38e - y) / 0x500000000000000000000000000000000; z = z * w / FIXED_1;
        res += z * (0x08ba2e8ba2e8ba2e8ba2e8ba2e8ba2e8b - y) / 0x600000000000000000000000000000000; z = z * w / FIXED_1;
        res += z * (0x089d89d89d89d89d89d89d89d89d89d89 - y) / 0x700000000000000000000000000000000; z = z * w / FIXED_1;
        res += z * (0x088888888888888888888888888888888 - y) / 0x800000000000000000000000000000000;

        return res;
    }

    /**
        Return e ^ (x / FIXED_1) * FIXED_1
        Input range: 0 <= x <= OPT_EXP_MAX_VAL - 1
        Auto-generated via 'PrintFunctionOptimalExp.py'
    */
    function optimalExp(uint256 x) private pure returns (uint256) {
        uint256 res = 0;

        uint256 y;
        uint256 z;

        z = y = x % 0x10000000000000000000000000000000;
        z = z * y / FIXED_1; res += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!)
        z = z * y / FIXED_1; res += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!)
        z = z * y / FIXED_1; res += z * 0x0168244fdac78000; // add y^04 * (20! / 04!)
        z = z * y / FIXED_1; res += z * 0x004807432bc18000; // add y^05 * (20! / 05!)
        z = z * y / FIXED_1; res += z * 0x000c0135dca04000; // add y^06 * (20! / 06!)
        z = z * y / FIXED_1; res += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!)
        z = z * y / FIXED_1; res += z * 0x000036e0f639b800; // add y^08 * (20! / 08!)
        z = z * y / FIXED_1; res += z * 0x00000618fee9f800; // add y^09 * (20! / 09!)
        z = z * y / FIXED_1; res += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!)
        z = z * y / FIXED_1; res += z * 0x0000000e30dce400; // add y^11 * (20! / 11!)
        z = z * y / FIXED_1; res += z * 0x000000012ebd1300; // add y^12 * (20! / 12!)
        z = z * y / FIXED_1; res += z * 0x0000000017499f00; // add y^13 * (20! / 13!)
        z = z * y / FIXED_1; res += z * 0x0000000001a9d480; // add y^14 * (20! / 14!)
        z = z * y / FIXED_1; res += z * 0x00000000001c6380; // add y^15 * (20! / 15!)
        z = z * y / FIXED_1; res += z * 0x000000000001c638; // add y^16 * (20! / 16!)
        z = z * y / FIXED_1; res += z * 0x0000000000001ab8; // add y^17 * (20! / 17!)
        z = z * y / FIXED_1; res += z * 0x000000000000017c; // add y^18 * (20! / 18!)
        z = z * y / FIXED_1; res += z * 0x0000000000000014; // add y^19 * (20! / 19!)
        z = z * y / FIXED_1; res += z * 0x0000000000000001; // add y^20 * (20! / 20!)
        res = res / 0x21c3677c82b40000 + y + FIXED_1; // divide by 20! and then add y^1 / 1! + y^0 / 0!

        if ((x & 0x010000000000000000000000000000000) != 0) res = res * 0x1c3d6a24ed82218787d624d3e5eba95f9 / 0x18ebef9eac820ae8682b9793ac6d1e776;
        if ((x & 0x020000000000000000000000000000000) != 0) res = res * 0x18ebef9eac820ae8682b9793ac6d1e778 / 0x1368b2fc6f9609fe7aceb46aa619baed4;
        if ((x & 0x040000000000000000000000000000000) != 0) res = res * 0x1368b2fc6f9609fe7aceb46aa619baed5 / 0x0bc5ab1b16779be3575bd8f0520a9f21f;
        if ((x & 0x080000000000000000000000000000000) != 0) res = res * 0x0bc5ab1b16779be3575bd8f0520a9f21e / 0x0454aaa8efe072e7f6ddbab84b40a55c9;
        if ((x & 0x100000000000000000000000000000000) != 0) res = res * 0x0454aaa8efe072e7f6ddbab84b40a55c5 / 0x00960aadc109e7a3bf4578099615711ea;
        if ((x & 0x200000000000000000000000000000000) != 0) res = res * 0x00960aadc109e7a3bf4578099615711d7 / 0x0002bf84208204f5977f9a8cf01fdce3d;
        if ((x & 0x400000000000000000000000000000000) != 0) res = res * 0x0002bf84208204f5977f9a8cf01fdc307 / 0x0000003c6ab775dd0b95b4cbee7e65d11;

        return res;
    }
}

/// @title Definition for a resource token used by upcity.
/// @author Lawrence Forman ([email protected])
interface IResourceToken {

	function transfer(address to, uint256 amt) external returns (bool);
	function mint(address to, uint256 amt) external;
	function burn(address from, uint256 amt) external;
	function totalSupply() external view returns (uint256);
	function balanceOf(address who) external view returns (uint256);
	function isAuthority(address addr) external view returns (bool);
	function decimals() external view returns (uint8);
}

/// @title Base contract defining common error codes.
/// @author Lawrence Forman ([email protected])
contract Errors {

	string internal constant ERROR_MAX_HEIGHT = "MAX_HEIGHT";
	string internal constant ERROR_NOT_ALLOWED = "NOT_ALLOWED";
	string internal constant ERROR_ALREADY = "ALREADY";
	string internal constant ERROR_INSUFFICIENT = "INSUFFICIENT";
	string internal constant ERROR_RESTRICTED = "RESTRICTED";
	string internal constant ERROR_UNINITIALIZED = "UNINITIALIZED";
	string internal constant ERROR_TIME_TRAVEL = "TIME_TRAVEL";
	string internal constant ERROR_INVALID = "INVALID";
	string internal constant ERROR_NOT_FOUND = "NOT_FOUND";
	string internal constant ERROR_GAS = "GAS";
	string internal constant ERROR_TRANSFER_FAILED = "TRANSFER_FAILED";
}

/// @title Base for contracts that require a separate
/// initialization step beyond the constructor.
/// @author Lawrence Forman ([email protected])
/// @dev Deriving contracts should call super._init() in their initialization step
/// to initialize the contract.
contract Uninitialized is Errors {

	/// @dev Whether the contract is fully initialized.
	bool private _isInitialized;

	/// @dev Only callable when contract is initialized.
	modifier onlyInitialized() {
		require(_isInitialized, ERROR_UNINITIALIZED);
		_;
	}

	/// @dev Only callable when contract is uninitialized.
	modifier onlyUninitialized() {
		require(!_isInitialized, ERROR_UNINITIALIZED);
		_;
	}

	/// @dev initialize the contract.
	function _init() internal onlyUninitialized {
		_isInitialized = true;
	}

}

/// @title Base class for contracts that want to restrict access to privileged
/// functions to either the contract creator or a group of addresses.
/// @author Lawrence Forman ([email protected])
/// @dev Derived contracts should set isAuthority to true for each address
/// with privileged access to functions protected by the onlyAuthority modifier.
contract Restricted is Errors {

	/// @dev Creator of this contract.
	address internal _creator;
	/// @dev Addresses that can call onlyAuthority functions.
	mapping(address=>bool) public isAuthority;

	/// @dev Set the contract creator to the sender.
	constructor() public {
		_creator = msg.sender;
	}

	/// @dev Only callable by contract creator.
	modifier onlyCreator() {
		require(msg.sender == _creator, ERROR_RESTRICTED);
		_;
	}

	/// @dev Restrict calls to only from an authority
	modifier onlyAuthority() {
		require(isAuthority[msg.sender], ERROR_RESTRICTED);
		_;
	}
}

/// @title Bancor market for UpCity's resources.
/// @author Lawrence Forman ([email protected])
contract UpcityMarket is BancorFormula, Uninitialized, Restricted {

	using SafeMath for uint256;

	// 100% or 1.0 in parts per million.
	uint32 private constant PPM_ONE = 1e6;

	// State for each resource's market.
	struct Market {
		// The resource's token.
		IResourceToken token;
		// The ether balance for this resource.
		uint256 funds;
		// Price yesterday.
		uint256 priceYesterday;
		// Time when priceYesterday was computed.
		uint64 yesterday;
	}

	/// @dev Tokens supported.
	address[] public tokens;
	/// @dev Bancor connector weight shared by all markets, in ppm.
	uint32 public connectorWeight;
	// Indiividual markets for each resource.
	mapping(address=>Market) private _markets;

	/// @dev Raised whenever resource tokens are bought.
	/// @param resource The address of the token/resource.
	/// @param to The recepient of the tokens.
	/// @param value The ether value of the tokens.
	/// @param bought The number of tokens bought.
	event Bought(
		address indexed resource,
		address indexed to,
		uint256 value,
		uint256 bought);
	/// @dev Raised whenever resource tokens are sold.
	/// @param resource The address of the token/resource.
	/// @param to The recepient of the ether.
	/// @param sold The number of tokens sold.
	/// @param value The ether value of the tokens.
	event Sold(
		address indexed resource,
		address indexed to,
		uint256 sold,
		uint256 value);
	/// @dev Raised whenever the market is funded.
	/// @param value The amount of ether deposited.
	event Funded(uint256 value);

	/// @dev Deploy the market.
	/// init() needs to be called before market functions will work.
	/// @param cw the bancor "connector weight" for all token markets, in ppm.
	constructor(uint32 cw) public {
		require(cw <= PPM_ONE);
		connectorWeight = cw;
	}

	/// @dev Fund the markets.
	/// Attached ether will be distributed evenly across all token markets.
	function() external payable onlyInitialized {
		if (msg.value > 0) {
			for (uint8 i = 0; i < tokens.length; i++) {
				Market storage market = _markets[tokens[i]];
				market.funds = market.funds.add(msg.value/tokens.length);
				_updatePriceYesterday(market, market.token.totalSupply());
			}
			emit Funded(msg.value);
		}
	}

	/// @dev Initialize and fund the markets.
	/// This can only be called once by the contract creator.
	/// Attached ether will be distributed evenly across all token markets.
	/// @param _tokens The address of each token.
	/// @param authorities Address of authorities to register.
	function init(address[] calldata _tokens, address[] calldata authorities)
			external payable onlyCreator onlyUninitialized {

		require(_tokens.length > 0, ERROR_INVALID);
		require(msg.value >= _tokens.length, ERROR_INVALID);
		// Set authorities.
		for (uint256 i = 0; i < authorities.length; i++) {
			isAuthority[authorities[i]] = true;
		}
		// Create markets.
		for (uint256 i = 0; i < _tokens.length; i++) {
			address addr = _tokens[i];
			tokens.push(addr);
			IResourceToken token = IResourceToken(addr);
			Market storage market = _markets[addr];
			market.token = token;
			market.funds = msg.value / _tokens.length;
			market.priceYesterday = _getMarketPrice(
				market.funds, token.totalSupply());
			market.yesterday = uint64(block.timestamp);
			require(market.token.isAuthority(address(this)));
		}
		_bancorInit();
		_init();
	}

	/// @dev Get the market state of a token.
	/// @param resource Address of the resource token contract.
	/// @return The price, supply, (ether) balance, and yesterday's price
	// for that token.
	function getState(address resource)
			external view returns (
				uint256 price,
				uint256 supply,
				uint256 funds,
				uint256 priceYesterday) {

		Market storage market = _markets[resource];
		require(address(market.token) == resource, ERROR_INVALID);
		price = getPrice(resource);
		supply = market.token.totalSupply();
		funds = market.funds;
		priceYesterday = market.priceYesterday;
	}

	/// @dev Get the current price of a resource.
	/// @param resource The address of the resource contract.
	/// @return The price, in wei.
	function getPrice(address resource) public view returns (uint256) {
		Market storage market = _markets[resource];
		require(address(market.token) == resource, ERROR_INVALID);
		return _getMarketPrice(market.funds, market.token.totalSupply());
	}

	/// @dev Buy some tokens with ether.
	/// @param resource The address of the resource token contract.
	/// @param to Recipient of tokens.
	/// @return The number of tokens purchased.
	function buy(address resource, address to)
			external payable onlyInitialized returns (uint256) {

		Market storage market = _markets[resource];
		require(address(market.token) == resource, ERROR_INVALID);
		require(msg.value > 0, ERROR_INVALID);
		uint256 supply = market.token.totalSupply();
		_updatePriceYesterday(market, supply);
		uint256 bought = calculatePurchaseReturn(
			supply, market.funds, connectorWeight, msg.value);
		market.funds = market.funds.add(msg.value);
		market.token.mint(to, bought);
		emit Bought(resource, to, msg.value, bought);
		return bought;
	}

	/// @dev Sell some tokens for ether.
	/// @param resource The address of the resource token contract.
	/// @param amount Amount of tokens to sell.
	/// @param to Recipient of ether.
	/// @return The number of ether received.
	function sell(address resource, uint256 amount, address payable to)
			external onlyInitialized returns (uint256) {

		Market storage market = _markets[resource];
		require(address(market.token) == resource, ERROR_INVALID);
		require(amount > 0, ERROR_INVALID);
		uint256 supply = market.token.totalSupply();
		_updatePriceYesterday(market, supply);
		market.token.burn(msg.sender, amount);
		uint256 funds = calculateSaleReturn(
			supply, market.funds, connectorWeight, amount);
		market.funds = market.funds.sub(funds);
		to.transfer(funds);
		emit Sold(resource, to, amount, funds);
		return funds;
	}

	/// @dev Burn tokens.
	/// Only an authority may call this.
	/// @param resource The address of the resource token contract.
	/// @param from The owner whose tokens will be burned.
	/// @param amount The number of tokens to burn.
	function burn(address resource, address from, uint256 amount)
			external onlyInitialized onlyAuthority {

		Market storage market = _markets[resource];
		require(address(market.token) == resource, ERROR_INVALID);
		require(amount > 0, ERROR_INVALID);
		_updatePriceYesterday(market, market.token.totalSupply());
		market.token.burn(from, amount);
	}

	/// @dev Mint tokens.
	/// Only an authority may call this.
	/// @param resource The address of the resource token contract.
	/// @param to The owner of the new tokens.
	/// @param amount The number of tokens to mint.
	function mint(address resource, address to, uint256 amount)
			external onlyInitialized onlyAuthority {

		Market storage market = _markets[resource];
		require(address(market.token) == resource, ERROR_INVALID);
		require(amount > 0, ERROR_INVALID);
		_updatePriceYesterday(market, market.token.totalSupply());
		market.token.mint(to, amount);
	}

	/// @dev Calculate the price of a market token, given funds and supply.
	/// @param funds The funds (ether) held by the market.
	/// @param supply The token's supply.
	/// @return The (ether) price.
	function _getMarketPrice(uint256 funds, uint256 supply)
			private view returns (uint256) {
		return ((1 ether) * funds) / ((supply * connectorWeight) / PPM_ONE);
	}

	/// @dev Update the price yesterday of a market.
	/// Nothing will happen if less than a day has passed since the last
	/// update.
	/// @param market The token's market instance.
	/// @param supply The current supply of the token.
	function _updatePriceYesterday(Market storage market, uint256 supply)
			private {

		uint64 _now = uint64(block.timestamp);
		if (_now > market.yesterday && _now - market.yesterday >= 86400) {
			market.priceYesterday = _getMarketPrice(market.funds, supply);
			market.yesterday = _now;
		}
	}

}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"_tokens","type":"address[]"},{"name":"authorities","type":"address[]"}],"name":"init","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"resource","type":"address"}],"name":"getState","outputs":[{"name":"price","type":"uint256"},{"name":"supply","type":"uint256"},{"name":"funds","type":"uint256"},{"name":"priceYesterday","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"isAuthority","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"resource","type":"address"},{"name":"amount","type":"uint256"},{"name":"to","type":"address"}],"name":"sell","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"resource","type":"address"}],"name":"getPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"tokens","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"resource","type":"address"},{"name":"to","type":"address"}],"name":"buy","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"connectorWeight","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"resource","type":"address"},{"name":"to","type":"address"},{"name":"amount","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"resource","type":"address"},{"name":"from","type":"address"},{"name":"amount","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"cw","type":"uint32"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"resource","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"bought","type":"uint256"}],"name":"Bought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"resource","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"sold","type":"uint256"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Sold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"value","type":"uint256"}],"name":"Funded","type":"event"}]

  Contract Creation Code Switch To Opcodes View
608060405234801561001057600080fd5b50604051602080620034328339810180604052602081101561003157600080fd5b50516080805461010060a860020a0319163361010002179055620f424063ffffffff8216111561006057600080fd5b6083805463ffffffff191663ffffffff929092169190911790556133a8806200008a6000396000f3fe6080604052600436106100955760003560e060020a900480634f64b2be1161005d5780634f64b2be14610475578063ad7fadc5146104bb578063b586c9a2146104e9578063c6c3bbe614610517578063f6b911bc1461055a57610095565b806317b010011461028b5780631bab58f51461034d5780632330f247146103a65780633540c919146103ed57806341976e0914610442575b60805460408051808201909152600d815260008051602061335d83398151915260208201529060ff16151561014b5760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156101105781810151838201526020016100f8565b50505050905090810190601f16801561013d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060003411156102895760005b60825460ff821610156102545760006084600060828460ff1681548110151561017d57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190206082549091506101c890348115156101b557fe5b600184015491900463ffffffff61059d16565b600182015580546040805160e060020a6318160ddd028152905161024b928492600160a060020a03909116916318160ddd91600480820192602092909190829003018186803b15801561021a57600080fd5b505afa15801561022e573d6000803e3d6000fd5b505050506040513d602081101561024457600080fd5b50516105b6565b50600101610158565b506040805134815290517fc4c14883ae9fd8e26d5d59e3485ed29fd126d781d7e498a4ca5c54c8268e49369181900360200190a15b005b610289600480360360408110156102a157600080fd5b8101906020810181356401000000008111156102bc57600080fd5b8201836020820111156102ce57600080fd5b803590602001918460208302840111640100000000831117156102f057600080fd5b91939092909160208101903564010000000081111561030e57600080fd5b82018360208201111561032057600080fd5b8035906020019184602083028401116401000000008311171561034257600080fd5b50909250905061062e565b34801561035957600080fd5b506103806004803603602081101561037057600080fd5b5035600160a060020a0316610a81565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156103b257600080fd5b506103d9600480360360208110156103c957600080fd5b5035600160a060020a0316610bb5565b604080519115158252519081900360200190f35b3480156103f957600080fd5b506104306004803603606081101561041057600080fd5b50600160a060020a03813581169160208101359160409091013516610bca565b60408051918252519081900360200190f35b34801561044e57600080fd5b506104306004803603602081101561046557600080fd5b5035600160a060020a0316610f22565b34801561048157600080fd5b5061049f6004803603602081101561049857600080fd5b5035611013565b60408051600160a060020a039092168252519081900360200190f35b610430600480360360408110156104d157600080fd5b50600160a060020a038135811691602001351661103b565b3480156104f557600080fd5b506104fe61135e565b6040805163ffffffff9092168252519081900360200190f35b34801561052357600080fd5b506102896004803603606081101561053a57600080fd5b50600160a060020a0381358116916020810135909116906040013561136a565b34801561056657600080fd5b506102896004803603606081101561057d57600080fd5b50600160a060020a0381358116916020810135909116906040013561166f565b6000828201838110156105af57600080fd5b9392505050565b6003820154429067ffffffffffffffff9081169082161180156105f1575060038301546201518067ffffffffffffffff918216830390911610155b1561062957610604836001015483611956565b600284015560038301805467ffffffffffffffff191667ffffffffffffffff83161790555b505050565b60805460408051808201909152600a81527f52455354524943544544000000000000000000000000000000000000000000006020820152906101009004600160a060020a031633146106c55760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b5060805460408051808201909152600d815260008051602061335d83398151915260208201529060ff161561073f5760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b50604080518082019091526007815260ca60020a6612539590531251026020820152600084116107b45760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b50604080518082019091526007815260ca60020a6612539590531251026020820152348411156108295760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b5060005b818110156108805760016081600085858581811061084757fe5b60209081029290920135600160a060020a0316835250810191909152604001600020805460ff191691151591909117905560010161082d565b5060005b83811015610a6a57600085858381811061089a57fe5b60828054600181019091557fb2244e644cfe16f72b654fbc48ff0fecec8fc59649ca8625094bebd9bd2e403501805460209283029490940135600160a060020a031673ffffffffffffffffffffffffffffffffffffffff199485168117909155600081815260849092526040909120805490931681178355925082919050863481151561092357fe5b0481600101819055506109a1816001015483600160a060020a03166318160ddd6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561097057600080fd5b505afa158015610984573d6000803e3d6000fd5b505050506040513d602081101561099a57600080fd5b5051611956565b600282015560038101805467ffffffffffffffff19164267ffffffffffffffff161790558054604080517f2330f2470000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a0390921691632330f24791602480820192602092909190829003018186803b158015610a2857600080fd5b505afa158015610a3c573d6000803e3d6000fd5b505050506040513d6020811015610a5257600080fd5b50511515610a5f57600080fd5b505050600101610884565b50610a73611986565b610a7b612158565b50505050565b600160a060020a038082166000818152608460209081526040808320805482518084019093526007835260ca60020a6612539590531251029383019390935292948594859485949093921614610b1c5760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b50610b2686610f22565b81546040805160e060020a6318160ddd0281529051929750600160a060020a03909116916318160ddd91600480820192602092909190829003018186803b158015610b7057600080fd5b505afa158015610b84573d6000803e3d6000fd5b505050506040513d6020811015610b9a57600080fd5b50516001820154600290920154959790965090949350915050565b60816020526000908152604090205460ff1681565b60805460408051808201909152600d815260008051602061335d833981519152602082015260009160ff161515610c465760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b50600160a060020a03808516600081815260846020908152604091829020805483518085019094526007845260ca60020a66125395905312510292840192909252939192911614610cdc5760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b50604080518082019091526007815260ca60020a661253959053125102602082015260008511610d515760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b5080546040805160e060020a6318160ddd0281529051600092600160a060020a0316916318160ddd916004808301926020929190829003018186803b158015610d9957600080fd5b505afa158015610dad573d6000803e3d6000fd5b505050506040513d6020811015610dc357600080fd5b50519050610dd182826105b6565b8154604080517f9dc29fac000000000000000000000000000000000000000000000000000000008152336004820152602481018890529051600160a060020a0390921691639dc29fac9160448082019260009290919082900301818387803b158015610e3c57600080fd5b505af1158015610e50573d6000803e3d6000fd5b505050600183015460835460009250610e7191849163ffffffff16896121e1565b6001840154909150610e89908263ffffffff6122ca16565b6001840155604051600160a060020a0386169082156108fc029083906000818181858888f19350505050158015610ec4573d6000803e3d6000fd5b5084600160a060020a031687600160a060020a03167f16dd16959a056953a63cf14bf427881e762e54f03d86b864efea8238dd3b822f8884604051808381526020018281526020019250505060405180910390a39695505050505050565b600160a060020a038082166000818152608460209081526040808320805482518084019093526007835260ca60020a661253959053125102938301939093529294929390929190911614610fbb5760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b50600181015481546040805160e060020a6318160ddd028152905161100a9392600160a060020a0316916318160ddd916004808301926020929190829003018186803b15801561097057600080fd5b9150505b919050565b608280548290811061102157fe5b600091825260209091200154600160a060020a0316905081565b60805460408051808201909152600d815260008051602061335d833981519152602082015260009160ff1615156110b75760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b50600160a060020a03808416600081815260846020908152604091829020805483518085019094526007845260ca60020a6612539590531251029284019290925293919291161461114d5760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b50604080518082019091526007815260ca60020a6612539590531251026020820152600034116111c25760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b5080546040805160e060020a6318160ddd0281529051600092600160a060020a0316916318160ddd916004808301926020929190829003018186803b15801561120a57600080fd5b505afa15801561121e573d6000803e3d6000fd5b505050506040513d602081101561123457600080fd5b5051905061124282826105b6565b60018201546083546000916112609184919063ffffffff16346122df565b6001840154909150611278903463ffffffff61059d16565b60018401558254604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a03888116600483015260248201859052915191909216916340c10f1991604480830192600092919082900301818387803b1580156112ea57600080fd5b505af11580156112fe573d6000803e3d6000fd5b5050505084600160a060020a031686600160a060020a03167fbf77fd13a39d14dc0da779342c14105c38d9a5d0c60f2caa22f5fd1d5525416d3484604051808381526020018281526020019250505060405180910390a395945050505050565b60835463ffffffff1681565b60805460408051808201909152600d815260008051602061335d83398151915260208201529060ff1615156113e45760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b5033600090815260816020908152604091829020548251808401909352600a83527f52455354524943544544000000000000000000000000000000000000000000009183019190915260ff1615156114815760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b50600160a060020a03808416600081815260846020908152604091829020805483518085019094526007845260ca60020a661253959053125102928401929092529391929116146115175760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b50604080518082019091526007815260ca60020a66125395905312510260208201526000831161158c5760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b506115e4818260000160009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561021a57600080fd5b8054604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483015260248201869052915191909216916340c10f1991604480830192600092919082900301818387803b15801561165157600080fd5b505af1158015611665573d6000803e3d6000fd5b5050505050505050565b60805460408051808201909152600d815260008051602061335d83398151915260208201529060ff1615156116e95760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b5033600090815260816020908152604091829020548251808401909352600a83527f52455354524943544544000000000000000000000000000000000000000000009183019190915260ff1615156117865760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b50600160a060020a03808416600081815260846020908152604091829020805483518085019094526007845260ca60020a6612539590531251029284019290925293919291161461181c5760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b50604080518082019091526007815260ca60020a6612539590531251026020820152600083116118915760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b506118e9818260000160009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561021a57600080fd5b8054604080517f9dc29fac000000000000000000000000000000000000000000000000000000008152600160a060020a0386811660048301526024820186905291519190921691639dc29fac91604480830192600092919082900301818387803b15801561165157600080fd5b608354600090620f42409063ffffffff1683020483670de0b6b3a76400000281151561197e57fe5b049392505050565b701c35fedd14ffffffffffffffffffffffff602055701b0ce43b323fffffffffffffffffffffff6021557019f0028ec1ffffffffffffffffffffffff6022557018ded91f0e7fffffffffffffffffffffff6023557017d8ec7f0417ffffffffffffffffffffff6024557016ddc6556cdbffffffffffffffffffffff6025557015ecf52776a1ffffffffffffffffffffff6026557015060c256cb2ffffffffffffffffffffff602755701428a2f98d72ffffffffffffffffffffff6028557013545598e5c23fffffffffffffffffffff602955701288c4161ce1dfffffffffffffffffffff602a557011c592761c666fffffffffffffffffffff602b5570110a688680a757ffffffffffffffffffff602c55701056f1b5bedf77ffffffffffffffffffff602d55700faadceceeff8bffffffffffffffffffff602e55700f05dc6b27edadffffffffffffffffffff602f55700e67a5a25da4107fffffffffffffffffff603055700dcff115b14eedffffffffffffffffffff603155700d3e7a392431239fffffffffffffffffff603255700cb2ff529eb71e4fffffffffffffffffff603355700c2d415c3db974afffffffffffffffffff603455700bad03e7d883f69bffffffffffffffffff603555700b320d03b2c343d5ffffffffffffffffff603655700abc25204e02828dffffffffffffffffff603755700a4b16f74ee4bb207fffffffffffffffff6038557009deaf736ac1f569ffffffffffffffffff603955700976bd9952c7aa957fffffffffffffffff603a557009131271922eaa606fffffffffffffffff603b557008b380f3558668c46fffffffffffffffff603c55700857ddf0117efa215bffffffffffffffff603d557007ffffffffffffffffffffffffffffffff603e557007abbf6f6abb9d087fffffffffffffffff603f5570075af62cbac95f7dfa7fffffffffffffff60405570070d7fb7452e187ac13fffffffffffffff6041557006c3390ecc8af379295fffffffffffffff60425570067c00a3b07ffc01fd6fffffffffffffff604355700637b647c39cbb9d3d27ffffffffffffff6044557005f63b1fc104dbd39587ffffffffffffff6045557005b771955b36e12f7235ffffffffffffff60465570057b3d49dda84556d6f6ffffffffffffff60475570054183095b2c8ececf30ffffffffffffff60485570050a28be635ca2b888f77fffffffffffff6049557004d5156639708c9db33c3fffffffffffff604a557004a23105873875bd52dfdfffffffffffff604b55700471649d87199aa990756fffffffffffff604c557004429a21a029d4c1457cfbffffffffffff604d55700415bc6d6fb7dd71af2cb3ffffffffffff604e557003eab73b3bbfe282243ce1ffffffffffff604f557003c1771ac9fb6b4c18e229ffffffffffff605055700399e96897690418f785257fffffffffff605155700373fc456c53bb779bf0ea9fffffffffff60525570034f9e8e490c48e67e6ab8bfffffffffff60535570032cbfd4a7adc790560b3337ffffffffff60545570030b50570f6e5d2acca94613ffffffffff6055557002eb40f9f620fda6b56c2861ffffffffff6056557002cc8340ecb0d0f520a6af58ffffffffff6057557002af09481380a0a35cf1ba02ffffffffff605855700292c5bdd3b92ec810287b1b3fffffffff605955700277abdcdab07d5a77ac6d6b9fffffffff605a5570025daf6654b1eaa55fd64df5efffffffff605b55700244c49c648baa98192dce88b7ffffffff605c5570022ce03cd5619a311b2471268bffffffff605d55700215f77c045fbe885654a44a0fffffffff605e557001ffffffffffffffffffffffffffffffff605f557001eaefdbdaaee7421fc4d3ede5ffffffff6060557001d6bd8b2eb257df7e8ca57b09bfffffff6061557001c35fedd14b861eb0443f7f133fffffff6062557001b0ce43b322bcde4a56e8ada5afffffff60635570019f0028ec1fff007f5a195a39dfffffff60645570018ded91f0e72ee74f49b15ba527ffffff60655570017d8ec7f04136f4e5615fd41a63ffffff60665570016ddc6556cdb84bdc8d12d22e6fffffff60675570015ecf52776a1155b5bd8395814f7fffff60685570015060c256cb23b3b3cc3754cf40ffffff6069557001428a2f98d728ae223ddab715be3fffff606a5570013545598e5c23276ccf0ede68034fffff606b557001288c4161ce1d6f54b7f61081194fffff606c5570011c592761c666aa641d5a01a40f17ffff606d55700110a688680a7530515f3e6e6cfdcdffff606e557001056f1b5bedf75c6bcb2ce8aed428ffff606f556ffaadceceeff8a0890f3875f008277fff6070556ff05dc6b27edad306388a600f6ba0bfff6071556fe67a5a25da41063de1495d5b18cdbfff6072556fdcff115b14eedde6fc3aa5353f2e4fff6073556fd3e7a3924312399f9aae2e0f868f8fff6074556fcb2ff529eb71e41582cccd5a1ee26fff6075556fc2d415c3db974ab32a51840c0b67edff6076556fbad03e7d883f69ad5b0a186184e06bff6077556fb320d03b2c343d4829abd6075f0cc5ff6078556fabc25204e02828d73c6e80bcdb1a95bf6079556fa4b16f74ee4bb2040a1ec6c15fbbf2df607a556f9deaf736ac1f569deb1b5ae3f36c130f607b556f976bd9952c7aa957f5937d790ef65037607c556f9131271922eaa6064b73a22d0bd4f2bf607d556f8b380f3558668c46c91c49a2f8e967b9607e556f857ddf0117efa215952912839f6473e6607f55565b60805460408051808201909152600d815260008051602061335d83398151915260208201529060ff16156121d15760405160e560020a62461bcd028152600401808060200182810382528381815181526020019150805190602001908083836000838110156101105781810151838201526020016100f8565b506080805460ff19166001179055565b600080851180156121f25750600084115b8015612204575060008363ffffffff16115b80156122195750620f424063ffffffff841611155b80156122255750848211155b151561223057600080fd5b81151561223f575060006122c2565b8482141561224e5750826122c2565b63ffffffff8316620f4240141561227b578461226a858461239a565b81151561227357fe5b0490506122c2565b6000808387036122908882620f4240896123be565b909350915060006122a1888561239a565b905060ff831660020a8802848183038115156122b957fe5b04955050505050505b949350505050565b6000828211156122d957600080fd5b50900390565b600080851180156122f05750600084115b8015612302575060008363ffffffff16115b80156123175750620f424063ffffffff841611155b151561232257600080fd5b811515612331575060006122c2565b63ffffffff8316620f4240141561234d578361226a868461239a565b600080600061235c85886124ae565b905061236d818888620f42406123be565b9093509150600060ff83166123828a8661239a565b60029190910a90049890980398975050505050505050565b60008282028315806123b657508284828115156123b357fe5b04145b15156105af57fe5b60008070020000000000000000000000000000000086106123db57fe5b60008086607f60020a89028115156123ef57fe5b04905070015bf0a8b1457695355fb8ac404e7a79e381101561241b57612414816124bd565b9150612427565b612424816128e2565b91505b60008563ffffffff168763ffffffff16840281151561244257fe5b04905070080000000000000000000000000000000081101561247557612467816129b0565b607f945094505050506124a5565b600061248082612dbd565b905061249860ff607f8390031660020a830482612e4f565b955093506124a592505050565b94509492505050565b6000828201838110156105af57fe5b6000808080806fd3094c70f034de4b96ff7d5b6f99fcd8861061250c576f4000000000000000000000000000000093909301926fd3094c70f034de4b96ff7d5b6f99fcd8607f60020a87020495505b6fa45af1e1f40c333b3de1db4dd55f29a78610612555576f2000000000000000000000000000000093909301926fa45af1e1f40c333b3de1db4dd55f29a7607f60020a87020495505b6f910b022db7ae67ce76b441c27035c6a1861061259e576f1000000000000000000000000000000093909301926f910b022db7ae67ce76b441c27035c6a1607f60020a87020495505b6f88415abbe9a76bead8d00cf112e4d4a886106125e7576f0800000000000000000000000000000093909301926f88415abbe9a76bead8d00cf112e4d4a8607f60020a87020495505b6f84102b00893f64c705e841d5d4064bd38610612630576f0400000000000000000000000000000093909301926f84102b00893f64c705e841d5d4064bd3607f60020a87020495505b6f8204055aaef1c8bd5c3259f4822735a28610612679576f0200000000000000000000000000000093909301926f8204055aaef1c8bd5c3259f4822735a2607f60020a87020495505b6f810100ab00222d861931c15e39b44e9986106126c2576f0100000000000000000000000000000093909301926f810100ab00222d861931c15e39b44e99607f60020a87020495505b6f808040155aabbbe9451521693554f733861061270a576e80000000000000000000000000000093909301926f808040155aabbbe9451521693554f733607f60020a87020495505b6f7fffffffffffffffffffffffffffffff1986019250829150607f60020a8280020490507001000000000000000000000000000000008381038302049390930192607f60020a8282020491507002000000000000000000000000000000006faaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa8490038302049390930192607f60020a8282020491507003000000000000000000000000000000006f999999999999999999999999999999998490038302049390930192607f60020a8282020491507004000000000000000000000000000000006f924924924924924924924924924924928490038302049390930192607f60020a8282020491507005000000000000000000000000000000006f8e38e38e38e38e38e38e38e38e38e38e8490038302049390930192607f60020a8282020491507006000000000000000000000000000000006f8ba2e8ba2e8ba2e8ba2e8ba2e8ba2e8b8490038302049390930192607f60020a8282020491507007000000000000000000000000000000006f89d89d89d89d89d89d89d89d89d89d898490038302049390930192607f60020a8282020491507008000000000000000000000000000000006f888888888888888888888888888888888490038302049390930195945050505050565b600080700100000000000000000000000000000000831061292457600061290e607f60020a85046132f1565b60ff16600281900a90940493607f60020a029150505b607f60020a83111561298457607f5b60008160ff16111561298257607f60020a8480020493507001000000000000000000000000000000008410612979576002938490049360ff600019830116900a91909101905b60001901612933565b505b6f05b9de1d10bf4103d647b0955897ba806f03f80fe03f80fe03f80fe03f80fe03f88202049392505050565b6000670168244fdac78000607f60020a6f0fffffffffffffffffffffffffffffff84168080028290048082028390048083028490049485026710e1b3be415a00009092026705a0913f6b1e000091909102010192909181830204905080664807432bc180000283019250607f60020a828202811515612a2b57fe5b04905080660c0135dca040000283019250607f60020a828202811515612a4d57fe5b049050806601b707b1cdc0000283019250607f60020a828202811515612a6f57fe5b049050806536e0f639b8000283019250607f60020a828202811515612a9057fe5b04905080650618fee9f8000283019250607f60020a828202811515612ab157fe5b04905080649c197dcc000283019250607f60020a828202811515612ad157fe5b04905080640e30dce4000283019250607f60020a828202811515612af157fe5b0490508064012ebd13000283019250607f60020a828202811515612b1157fe5b049050806317499f000283019250607f60020a828202811515612b3057fe5b049050806301a9d4800283019250607f60020a828202811515612b4f57fe5b04905080621c63800283019250607f60020a828202811515612b6d57fe5b049050806201c6380283019250607f60020a828202811515612b8b57fe5b04905080611ab80283019250607f60020a828202811515612ba857fe5b0490508061017c0283019250607f60020a828202811515612bc557fe5b0490508060140283019250607f60020a828202811515612be157fe5b6721c3677c82b40000919004938401048201607f60020a019290506f10000000000000000000000000000000851615612c3e5770018ebef9eac820ae8682b9793ac6d1e7767001c3d6a24ed82218787d624d3e5eba95f984020492505b6f20000000000000000000000000000000851615612c80577001368b2fc6f9609fe7aceb46aa619baed470018ebef9eac820ae8682b9793ac6d1e77884020492505b6f40000000000000000000000000000000851615612cc1576fbc5ab1b16779be3575bd8f0520a9f21f7001368b2fc6f9609fe7aceb46aa619baed584020492505b607f60020a851615612cf5576f454aaa8efe072e7f6ddbab84b40a55c96fbc5ab1b16779be3575bd8f0520a9f21e84020492505b700100000000000000000000000000000000851615612d36576f0960aadc109e7a3bf4578099615711ea6f454aaa8efe072e7f6ddbab84b40a55c584020492505b700200000000000000000000000000000000851615612d76576e2bf84208204f5977f9a8cf01fdce3d6f0960aadc109e7a3bf4578099615711d784020492505b700400000000000000000000000000000000851615612db4576d03c6ab775dd0b95b4cbee7e65d116e2bf84208204f5977f9a8cf01fdc30784020492505b50909392505050565b60006020607f5b8060ff168260010160ff161015612e0c576000600260ff8484011604905084600060ff831660808110612df357fe5b015410612e0257809250612e06565b8091505b50612dc4565b83600060ff831660808110612e1d57fe5b015410612e2d57915061100e9050565b83600060ff841660808110612e3e57fe5b015410612e4d5750905061100e565bfe5b60008083905060008090508360ff16858302908060020a82049150509150816f03442c4e6074a82f1797f72ac000000002810190508360ff16858302908060020a82049150509150816f0116b96f757c380fb287fd0e4000000002810190508360ff16858302908060020a82049150509150816e45ae5bdd5f0e03eca1ff439000000002810190508360ff16858302908060020a82049150509150816e0defabf91302cd95b9ffda5000000002810190508360ff16858302908060020a82049150509150816e02529ca9832b22439efff9b800000002810190508360ff16858302908060020a82049150509150816d54f1cf12bd04e516b6da8800000002810190508360ff16858302908060020a82049150509150816d0a9e39e257a09ca2d6db5100000002810190508360ff16858302908060020a82049150509150816d012e066e7b839fa050c30900000002810190508360ff16858302908060020a82049150509150816c1e33d7d926c329a1ad1a80000002810190508360ff16858302908060020a82049150509150816c02bee513bdb4a6b19b5f80000002810190508360ff16858302908060020a82049150509150816b3a9316fa79b88eccf2a0000002810190508360ff16858302908060020a82049150509150816b048177ebe1fa81237520000002810190508360ff16858302908060020a82049150509150816a5263fe90242dcbacf0000002810190508360ff16858302908060020a82049150509150816a057e22099c030d9410000002810190508360ff16858302908060020a82049150509150816957e22099c030d941000002810190508360ff16858302908060020a820491505091508169052b6b5456997631000002810190508360ff16858302908060020a8204915050915081684985f67696bf74800002810190508360ff16858302908060020a82049150509150816803dea12ea99e49800002810190508360ff16858302908060020a82049150509150816731880f2214b6e00002810190508360ff16858302908060020a820491505091508167025bcff56eb3600002810190508360ff16858302908060020a8204915050915081661b722e10ab100002810190508360ff16858302908060020a82049150509150816601317c7007700002810190508360ff16858302908060020a8204915050915081650cba84aafa0002810190508360ff16858302908060020a82049150509150816482573a0a0002810190508360ff16858302908060020a82049150509150816405035ad90002810190508360ff16858302908060020a8204915050915081632f881b0002810190508360ff16858302908060020a82049150509150816301b2934002810190508360ff16858302908060020a8204915050915081620efc4002810190508360ff16858302908060020a8204915050915081617fe002810190508360ff16858302908060020a820491505091508161042002810190508360ff16858302908060020a8204915050915081602102810190508360ff16858302908060020a8204915050915081600102810190508360ff1660019060020a02856f0688589cc0e9505e2f2fee5580000000838115156132e557fe5b04010195945050505050565b60008061010083101561331b575b6001831115613316576002909204916001016132ff565b613356565b60805b60008160ff1611156133545760ff811660020a84106133475760ff811660020a90930492908117905b600260ff9091160461331e565b505b9291505056fe554e494e495449414c495a454400000000000000000000000000000000000000a165627a7a72305820c9f100a496bfb34bae97faee56ffe5a2af3a8ad8208e6e52a041ad45e36d3121002900000000000000000000000000000000000000000000000000000000000a1220

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

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000a1220


   Swarm Source:
bzzr://c9f100a496bfb34bae97faee56ffe5a2af3a8ad8208e6e52a041ad45e36d3121

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward